|
| 1 | +# Contributing to ITKPythonPackage |
| 2 | + |
| 3 | +## Getting Started |
| 4 | + |
| 5 | +Clone the repository and install the pre-commit hooks: |
| 6 | + |
| 7 | +```bash |
| 8 | +git clone https://github.com/InsightSoftwareConsortium/ITKPythonPackage.git |
| 9 | +cd ITKPythonPackage |
| 10 | +```` |
| 11 | + |
| 12 | +Install [Pixi](https://pixi.sh) for managing the build environment: |
| 13 | + |
| 14 | +```bash |
| 15 | +curl -fsSL https://pixi.sh/install.sh | bash |
| 16 | +pixi install |
| 17 | +``` |
| 18 | + |
| 19 | +Install pre-commit hooks |
| 20 | + |
| 21 | +```bash |
| 22 | +pixi run pre-commit-install |
| 23 | +# optionally run pre-commit hooks |
| 24 | +pixi run pre-commit-run |
| 25 | +``` |
| 26 | + |
| 27 | + |
| 28 | +## Development Workflow |
| 29 | + |
| 30 | +### Code Style |
| 31 | + |
| 32 | +Pre-commit hooks enforce all formatting and linting automatically on commit: |
| 33 | + |
| 34 | +- **Python**: Black (formatting), Ruff (linting + import sorting) |
| 35 | +- **Shell**: ShellCheck (linting), shfmt (formatting) |
| 36 | +- **TOML**: Taplo (formatting) |
| 37 | + |
| 38 | +Run against all files manually: |
| 39 | + |
| 40 | +```bash |
| 41 | +pre-commit run --all-files |
| 42 | +``` |
| 43 | + |
| 44 | +### Commit Messages |
| 45 | + |
| 46 | +This project uses [Conventional Commits](https://www.conventionalcommits.org), enforced by Commitizen: |
| 47 | + |
| 48 | +``` |
| 49 | +feat: add support for Python 3.12 wheels |
| 50 | +fix: correct cmake args not propagating to module builds |
| 51 | +chore: update pre-commit hook versions |
| 52 | +docs: clarify aarch64 build requirements |
| 53 | +``` |
| 54 | +
|
| 55 | +Commitizen will reject commits that don't follow this format. |
| 56 | +
|
| 57 | +### Building Docs |
| 58 | +
|
| 59 | +```bash |
| 60 | +pip install -r docs/requirements-docs.txt |
| 61 | +sphinx-build -W -b html docs docs/_build/html |
| 62 | +``` |
| 63 | + |
| 64 | +## Submitting a Pull Request |
| 65 | + |
| 66 | +1. Create a branch from `main` |
| 67 | +2. Make your changes and ensure `pre-commit run --all-files` passes |
| 68 | +3. Open a PR, fill out the template, including which platforms you tested on |
| 69 | +4. CI will run pre-commit checks automatically |
| 70 | + |
| 71 | +## Questions |
| 72 | + |
| 73 | +For build questions or general ITK support, use the [ITK Discourse forum](https://discourse.itk.org). |
0 commit comments