General-purpose template for CPG Python repositories. Provides project structure, linting, type checking, testing, and CI out of the box. Works as a scripts-only repo (just linting, no installation) or as an installable package — see the comments at the top of pyproject.toml.
pyproject.tomlwith hatchling build, ruff linting, mypy, pytest config.pre-commit-config.yamlwith ruff, mypy, and CPG ID checker hooks- GitHub Actions for linting and testing
src/layout with placeholder packagetest/directory with pytest
- Create a new repo from this template
- Rename
package_nameinsrc/,pyproject.toml, and hatch build config - Update the project name, description, and repository URL in
pyproject.toml - Add your dependencies to
pyproject.toml - Install:
pip install .[dev] - Run linting:
pre-commit run --all-files - Run tests:
pytest test
If you're building a cpg-flow pipeline, use the cpg-flow-pipeline-template instead. It extends this template with stages, jobs, scripts, Docker builds, and Artifact Registry CI.