Install a C compiler, Python 3.11, and uv. Use Xcode Command Line Tools on macOS or Visual Studio Build Tools on Windows.
uv venv --python 3.11
source .venv/bin/activate
make develop
make lint
make checks
make coverage
make distOn Windows, activate with .venv\Scripts\activate instead.
To compile another .py or .pyx module, add its path to
[tool.hatch.build.targets.wheel.hooks.cython.options.files].targets in
pyproject.toml, then run make develop again. Only explicitly selected modules
are compiled. Keep package initialization and tests as Python sources.
Run make test after changing an extension. Tests check that both example modules
load native binaries. Coverage measures Python code; the compiled _compiled.py
is excluded because builds do not enable Cython line tracing.
For portable wheels, run make dist-py-wheel on the target platform. Linux wheel
builds require Docker. Run make dist-py-sdist to build an sdist without compiling
extensions. CI runs tests against each installed wheel through cibuildwheel, then
installs the built wheel and sdist in fresh environments to verify they import.
To update the template from a clean branch:
copier update --answers-file .copier-answers.yaml --trustReview the diff and rerun the checks above before committing.