Skip to main content

templatepy

DOI

Copier template for modern Python packages.

→ Full documentation

Stack

Tool Role
uv dependency management, virtual environments
hatchling + hatch-vcs build backend; version from git tags
commitizen Conventional Commits enforcement; auto bump on merge
ruff linting + formatting
mypy static type checking
pytest + pytest-cov testing with coverage
gitleaks secret scanning

Quickstart

uv tool install copier
copier copy gh:larsrollik/templatepy my-new-project
cd my-new-project
git init && git add -A && git commit -m "chore: initial commit from templatepy"
uv sync --extra dev
uv run pre-commit install --hook-type pre-commit --hook-type commit-msg

Update existing project

cd my-existing-project && copier update

Release flow

feature branch  →  PR  →  CI gate (lint + test) must pass
                           merge blocked until green
                               ↓
                           merge to main (merge commit)
                               ↓
                           versioning.yml fires on push to main:
                           → cz bump → tag vX.Y.Z → dispatch release.yml
                               ↓
                           release.yml (on tag / dispatch):
                           → GitHub release (wheel + sdist attached)
                           → PyPI via OIDC trusted publishing (if enable_pypi_publishing)
                           → Zenodo webhook (if enabled)

PyPI setup (one-time per repo)

Only if you answered enable_pypi_publishing: true (otherwise release.yml makes the GitHub/Forgejo release but skips the publish step). Uses OIDC trusted publishing — no API token stored in GitHub secrets.

  1. pypi.org → project → Settings → Publishing → Add trusted publisher
  2. Owner: <github-user>, Repository: <repo>, Workflow: release.yml
  3. Done — the workflow handles authentication automatically.

Branch protection (optional)

Generated projects ship a stepper that creates the repo, points you through installing the release-bot App, and installs a main-protected ruleset (require PR + review + the CI check, block force-push/deletion):

bash scripts/setup_repo.sh          # guided: create → App → protect
# or just the ruleset on an existing repo:
bash scripts/setup_branch_protection.sh

versioning.yml is adaptive: with the App configured (CI_BOT_CLIENT_ID variable + CI_BOT_PRIVATE_KEY secret; CI_BOT_APP_ID names the App as the ruleset bypass actor) it pushes the bump as that App — a ruleset bypass actor — so protection and auto-release coexist; without it, it falls back to github-actions[bot] on an unprotected main. The generated docs/repository-setup.md covers the App, its permissions, and the secrets.

Docs

uv run mkdocs serve

mkdocs.yml + the docs extra are always generated (build locally as above). Deploy to GitHub Pages on push to main via docs.yml is added only when enable_docs_publishing: true.

Optional workflows (copier answers)

Three publish/automation extras are off by default; enable per project:

  • enable_pypi_publishing — PyPI publish step in release.yml (+ OIDC id-token).
  • enable_docs_publishing — the GitHub Pages / Forgejo docs.yml deploy workflow.
  • enable_llm_pr_review — the optional LLM PR-review workflow (pr-review.yml).

When off, the corresponding workflow file is not generated at all (no "not configured" placeholder checks).

Metadata

Release files for templatepy 0.16.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for templatepy 0.16.2
File Size Uploaded Provenance Actions
templatepy-0.16.2.tar.gz 22.7 kB Without provenance Details for templatepy-0.16.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for templatepy 0.16.2
File Interpreter ABI Platform Actions
templatepy-0.16.2-py3-none-any.whl Python 3 none any Details for templatepy-0.16.2-py3-none-any.whl

Total release size: 62.1 kB

Release files / templatepy-0.16.2.tar.gz

Download URL templatepy-0.16.2.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
86eb840a292cc985f6e6004fe06a59da682bff84342364077492e1cb7047ed54
BLAKE2b-256 checksum
How to use checksums
6ddc2a76d775c5320e75b62b269707fb4fa84b0da84a18c6ccc22ce04960340a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / templatepy-0.16.2-py3-none-any.whl

Download URL templatepy-0.16.2-py3-none-any.whl
Size 39.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4b1fa4a6cb399b1c94e41554cc90dbc49d76e73ae186d14de84ab2b66060cad
BLAKE2b-256 checksum
How to use checksums
527aa6574e4c40fb2336ecce2f16adb02600516585c548f0c2d898f30a34140e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for templatepy 0.16.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.16.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page