Contributing¶
Contributions are welcome. This guide covers the development setup and contribution workflow.
Required tools¶
Two external tools must be installed separately (not managed by uv sync):
The uv package manager¶
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Or via package manager
brew install uv
The just command runner¶
# macOS/Linux
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash
# Or via package manager
brew install just
Ways to contribute¶
Report bugs¶
Report bugs at https://github.com/TUW-GEO/canvodpy-extensions/issues with the
bug report form. It asks for the package and its version, the steps to
reproduce, the error output, and the output of canvodpy doctor. Feature
requests have their own form.
Fix bugs and implement features¶
Issues tagged "bug"/"enhancement" and "help wanted" are open for contributions.
Add a new package¶
New extension packages live under packages/<name>/ and are picked up
automatically by the uv workspace (packages/*). Each package is versioned
on its own and published to PyPI (see Releasing below). A package lists
every dependency it needs, with no extras. See
packages/canvod-filemap for the expected layout (pyproject.toml, src/,
tests/, README.md).
Development workflow¶
-
Install required tools (uv and just).
-
Fork and clone the repository:
git clone git@github.com:your_name_here/canvodpy-extensions.git cd canvodpy-extensions -
Install dependencies:
uv sync just hooks -
Create a feature branch:
git checkout -b name-of-your-bugfix-or-feature -
Make changes and verify:
just test just check -
Commit using conventional commits:
git commit -m "feat(filemap): add support for recipe overrides" -
Push and create a pull request:
A maintainer reviews and merges it. Coding agents may push the feature branch and open the pull request, but never merge, pushgit push origin name-of-your-bugfix-or-featuremainor tags, or bypass a check (AGENTS.md, Git and GitHub).
Commit message format¶
<type>(<scope>): <subject>
Types: feat, fix, docs, refactor, test, chore, perf, ci
Scopes: filemap, airflow, adapters, deps, ci, docs, release
Examples:
git commit -m "feat(filemap): add recipe-based mapping for non-canonical filenames"
git commit -m "fix(filemap): handle missing site config gracefully"
git commit -m "docs: update installation instructions"
See Conventional Commits for the full specification.
Common commands¶
just --list # Show all commands
just test # Run all tests
just test-coverage # With coverage report
just check # Lint + format + type-check
Coding agents¶
AGENTS.md (root and per package) holds the instructions for coding
agents; the CLAUDE.md files import it. Task guides for agents are in
.claude/skills/. Keep them correct when you change what they describe;
just check-agent-docs checks that the paths and recipes they name exist.
Pull request guidelines¶
A new pull request starts from the template in
.github/pull_request_template.md: summary, evidence, merge danger, and a
checklist.
- Include tests for new features. New code must not reduce test coverage.
- Update the package's
README.mdand the Zensical documentation indocs/if adding or changing public API or behavior. - Ensure compatibility with Python 3.14+.
- Add yourself to
CONTRIBUTORS.mdif this is your first contribution.
Licensing¶
canvodpy-extensions is licensed under the Apache License 2.0.
By submitting a pull request, you agree that your contribution is licensed under
the same terms. The LICENSE and NOTICE files at the repository root apply to
all source files. Per-file license headers are not required.
Code quality¶
- ruff for linting and formatting
- ty for type checking
- pytest for testing with coverage
Run just check before committing.
Continuous integration¶
Every pull request and every push to main runs one workflow on GitHub
Actions, CI, which sums up its checks in one check, ci-ok. A pull
request that changes only docs skips the type check and the platform
tests (tools/ci_changes.py says which files are docs). CI runs:
- Python Code Quality: checks that
uv.lockis up to date, runs ruff (lint and format) and ty (types), and checks the paths named inAGENTS.mdfiles and skills. - Platform Tests: the test suite on Linux, Windows, and macOS. The Linux job uploads the coverage to Coveralls and posts it as a comment on the pull request.
- Docs Quality: a language check (Vale) of the changed pages, and a link check (lychee) of the built site. Pull requests check the links between our pages only; the weekly run also checks the external links and opens an issue when one fails.
Fuzzing¶
A fuzzer feeds random inputs to the parsers and looks for inputs that end
in an error the code doesn't document for bad input, a hang, or a memory
blow-up. Each target has a harness, fuzz/fuzz_<target>.py (so far
filemap: naming recipes and the file names read with them), and seed
inputs in fuzz/corpus/<target>/.
- The Fuzzing workflow runs every target for 10 minutes each week, and
opens an issue when it finds a crash. It isn't part of
ci-ok: a fuzzer can find a crash that has nothing to do with the pull request at hand. A pull request that changes the fuzzing setup or a fuzzed parser runs each target for one minute. - The tests replay every saved input on all platforms
(
fuzz/tests/test_fuzz_replay.py). - Fix a crash like any bug, and save its input in
fuzz/crashes/<target>/in the same pull request, so it stays fixed.
just fuzz filemap 600 fuzzes for 10 minutes on your machine. It needs
Linux on x86_64: atheris has no
other wheels.
Releasing¶
Releases are cut by a maintainer, never by a coding agent; only maintainers can create release tags.
Each package is versioned and released on its own. A release is the git tag
<package>-v<version>, for example canvod-filemap-v0.2.0, on main.
just versions # current version of every package
just changelog canvod-filemap # changes since its last release
just release canvod-filemap minor # or major, patch, or for example 0.2.0
just release runs the package's tests and makes one commit that
- sets the version in
packages/<package>/pyproject.toml(anduv.lock), - writes
packages/<package>/CHANGELOG.mdfrom the commits that changedpackages/<package>/(git-cliff,cliff.toml).
Commit messages become the changelog, so follow the commit convention here
and mark breaking changes (feat!: or a BREAKING CHANGE: footer).
A minor or major release also gets a release notebook: a marimo notebook
release-notes/<package>-v<version>.py that shows what is new and how to
use it. Copy release-notes/_template.py, and commit it on the release
branch (Release notebooks).
main requires a PR (branch protection), so the tag is set after the merge:
git checkout -b chore/release-canvod-filemap-0.2.0 # before just release
just release canvod-filemap 0.2.0
git push -u origin chore/release-canvod-filemap-0.2.0
gh pr create --fill
# once merged:
git checkout main && git pull
just tag canvod-filemap # tags main and pushes the tag
(Don't tag before the PR merges: a merge can produce a different commit SHA than the one you tagged, orphaning the tag.)
Pushing the tag runs release.yml, which
checks that the tag matches the package version and drafts a GitHub Release
with the tag's section of the package's CHANGELOG.md. Publish the draft by
hand. Publishing archives the repository on Zenodo, versioned by the tag:
.zenodo.json and CITATION.cff carry no version, since the packages have
different ones. Then raise the lower bound downstream (canvodpy's filemap
group) if the release needs it.
Then publish the package to PyPI by running
publish_pypi.yml
on the tag:
gh workflow run publish_pypi.yml --ref canvod-filemap-v0.2.0
It checks that the tag matches the package version, builds the package
without the workspace's [tool.uv.sources], refuses a dependency on a URL
(PyPI rejects those) and uploads with PyPI trusted publishing, so no token is
stored anywhere. The upload waits for a maintainer's approval of the pypi
environment. A package's dependencies must all be on PyPI first.
A new package under packages/ needs one step on PyPI before its first
upload: add a pending trusted publisher for the package name (owner
TUW-GEO, repository canvodpy-extensions, workflow publish_pypi.yml,
environment pypi). The first upload creates the project and turns the
pending publisher into a normal one. PyPI can refuse a second pending
publisher while one is pending; then upload that package first.
In the repository, the package's first just release starts its changelog
and tags.