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.3

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.3
File Size Uploaded Provenance Actions
templatepy-0.16.3.tar.gz 23.5 kB Without provenance Details for templatepy-0.16.3.tar.gz

Built distribution (wheel)

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

Total release size: 63.8 kB

Release files / templatepy-0.16.3.tar.gz

Download URL templatepy-0.16.3.tar.gz
Size 23.5 kB
Tags Source
SHA-256 checksum
How to use checksums
aa2d7732190037ff258828f3536b513dacaa15380b375f379d817890455b9bcc
BLAKE2b-256 checksum
How to use checksums
af49828b5edb1961a823eb57861422d8b2435b01bc9857e1ebe2abcb2e13f99b
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.3-py3-none-any.whl

Download URL templatepy-0.16.3-py3-none-any.whl
Size 40.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f0d81884d75dacb1fb0abe010f3d654509bc81f39831c0a039867796f1e4993
BLAKE2b-256 checksum
How to use checksums
476168f2f59994ebcc24c66766980ab384a23fabd01cbd672d527615ce62fcb0
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.3

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.3 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