We welcome contributions! This guide will help you get started with development.
- Fork and clone the repository
- Set up development environment:
make setup-dev - Make your changes
- Run quality checks:
make check - Submit a pull request
make setup-devThis installs the package in editable mode with development dependencies and sets up pre-commit hooks.
- Ruff: Linting and formatting
- MyPy: Type checking
- Bandit: Security scanning
- pytest: Testing
- pre-commit: Automated quality checks
- Safety: Dependency vulnerability scanning (dev dependency only)
- Typos: Spell checking
make help # Show all commands
make format # Format code with ruff
make lint # Run ruff linter
make fix # Auto-fix linting issues
make type-check # Run mypy type checker (excludes tests)
make security # Security scan with bandit
make test # Run tests with pytest
make test-cov # Tests with coverage report
make check # Run all checks (format, lint, type-check, test)
make pre-commit-run # Run pre-commit on all files
make clean # Clean build artifacts- Type annotations: Required for all public functions (MyPy excludes tests)
- Test coverage: Must maintain or improve existing coverage
- Pre-commit hooks: Must pass all automated checks
- Python 3.9+: Modern Python features encouraged
- Ruff compliance: Code must pass linting and formatting checks
Automatically run on commit:
- General checks: trailing whitespace, end-of-file fixing, YAML/TOML validation, large files, merge conflicts
- Code formatting and linting (Ruff)
- Type checking (MyPy, excludes tests)
- Security scanning (Bandit, excludes tests)
- Spell checking (Typos)
# All tests
make test
# With coverage
make test-cov
# Specific test file
python -m pytest tests/test_main.py -v
# Specific test function
python -m pytest tests/test_main.py::test_predict_basic -v- Create feature branch:
git checkout -b feature-name - Make changes in
src/directory - Run
make checkbefore committing - Commit (hooks run automatically)
- Push and create pull request
- Runtime: Add to
dependenciesinpyproject.toml - Development: Add to
devoptional dependencies - GPU support: Use
gpuoptional dependencies
src/neurostrip/ # Main package
tests/ # Test files
pyproject.toml # Project config
.pre-commit-config.yaml # Hook config
Makefile # Dev commands
All contributions must:
- Pass pre-commit hooks
- Maintain test coverage
- Include type annotations
- Pass CI checks
Questions? Open an issue or start a discussion.