This repository is a reusable Python 3.12+ package template for small, well-tested libraries. Keep changes focused, keep the public API intentional, and prefer standard-library solutions unless a third-party dependency clearly improves the maintenance story.
- Create and activate a virtual environment:
python -m venv .venvsource .venv/bin/activate
- The preferred interpreter target lives in
.python-version(3.12). - Install local tooling with
make dev. - For a frozen environment based on
uv.lock, usemake repro.
Use the smallest useful check while iterating, then run the full gate before merging.
- Fast local loop:
make fmtmake lintmake typemake test
- If docs changed:
make docs-checkmake docs
- If the example changed:
make run-example
- Pre-merge baseline:
make ci
- Pre-publish baseline:
make release-check
- The supported public surface is whatever is re-exported from
src/python_template/__init__.py. - Prefer adding new public behavior to stable top-level modules before creating deeper internal package trees.
- If you add internal helper modules later, prefix them with
_and keep them out of the top-level exports unless there is a deliberate API decision.
- Keep tests deterministic and offline by default.
- Update tests, docs, and examples alongside behavior changes.
- Avoid broad dependency growth in the base install.
- Keep this template easy to fork: simple defaults beat clever abstractions.
Update this file whenever the contributor workflow changes, especially when setup commands, validation commands, or the public API expectations change.