Clone the repository and install the pre-commit hooks:
git clone https://github.com/InsightSoftwareConsortium/ITKPythonPackage.git
cd ITKPythonPackageInstall Pixi for managing the build environment:
curl -fsSL https://pixi.sh/install.sh | bash
pixi installInstall pre-commit hooks
pixi run pre-commit-install
# optionally run pre-commit hooks
pixi run pre-commit-runPre-commit hooks enforce all formatting and linting automatically on commit:
- Python: Ruff (formatting, linting, and import sorting)
- Shell: ShellCheck (linting), shfmt (formatting)
- TOML: Taplo (formatting)
Run against all files manually:
pre-commit run --all-filesThis project uses the ITK commit message convention, PREFIX: Description,
enforced by Commitizen:
ENH: Add support for Python 3.12 wheels
BUG: Correct cmake args not propagating to module builds
COMP: Update pre-commit hook versions
DOC: Clarify aarch64 build requirements
Valid prefixes are BUG:, COMP:, DOC:, ENH:, PERF: and STYLE:,
and the description starts with a capital letter. Commitizen will reject
commits that don't follow this format.
pip install -r docs/requirements-docs.txt
sphinx-build -W -b html docs docs/_build/htmlNox runs the same checks without a pixi environment. With uv installed:
uvx nox -l # list sessions
uvx nox # lint and tests (Python 3.11 to 3.14)
uvx nox -s tests-3.11 # one Python version
uvx nox -s docs # build the docs as CI does
uvx nox -s docs -- --serveArguments after -- go to the underlying tool, for example
uvx nox -s tests-3.12 -- -k configure. Wheel builds are not nox
sessions; use pixi run -e <platform-env> build-itk-wheels, naming the
environment as AGENTS.md describes.
- Create a branch from
main - Make your changes and ensure
pre-commit run --all-filespasses - Open a PR, fill out the template, including which platforms you tested on
- CI will run pre-commit checks automatically
For build questions or general ITK support, use the ITK Discourse forum.