Best to discuss before attempting to contribute. This file contains some notes to self.
- uv for managing virtual environment
- make for building docs, running tests, making releases
- pandoc for building some parts of docs
To work on a new feature:
- Make the change on a new branch
- Make sure the branch passes the checklist:
- mypy checks pass (
mypy matthewplotlib/). - Tests pass (
pytest tests/ -v), including integration tests for all examples. - Docs up to date (
make docs). - Roadmap (
pages/roadmap.md) is up to date. - Changelog (
CHANGELOG.md) is up to date. - All new features are exported in
__init__.py.
- mypy checks pass (
- Then merge into main
Notes:
- CHANGELOG entries should be concise and describe API-level changes, not implementation details.
- Important notes on implementation should be documented in the code, or, if there's no appropriate place for that, in commit notes or PR or something.
Unit tests live in tests/test_*.py for the core modules (colors, data,
colormaps, core). Integration tests in tests/test_examples.py run every
example script as a subprocess and check for successful execution and output.
When adding a new example to examples/, add a corresponding entry to the
EXAMPLES list in test_examples.py. The test_all_examples_covered test
will fail if any example is missing from the list.
Long-running or animated examples should accept a --num-frames (or similar)
argument via tyro so that integration tests can run them with a small value.
Use num_frames=0 to mean "loop forever" (the default for interactive use).
Images in images/ are used in the README as showcase material. They should
be generated manually with full-length runs, not overwritten by test runs.
To release a new version:
- Decide on a new version number (V).
- Bump
__version__in__init__.pyto V. - Bump
versioninpyproject.tomlto V. - Move changelog items from 'In development' to a new 'Version V' section.
- Commit:
git commit -m "Version V". - Tag:
git tag vV. - Push:
git push origin main --tags. - On GitHub, create a new release from the tag.
TODO: Make sure we also build docs for the new version.