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

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.1
File Size Uploaded Provenance
templatepy-0.16.1.tar.gz 22.7 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 62.1 kB

Release files / templatepy-0.16.1.tar.gz

Download URL templatepy-0.16.1.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d8ff25dd123f095f1791d7437b20f80a81c3db3946de7a1a47fe9160c5a44e2c
BLAKE2b-256 checksum
How to use checksums
8f8cf5b409766c1bdb5575dbc6f47d462fa909380b24fb9f6e1fa3a9d346f0a8
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.1-py3-none-any.whl

Download URL templatepy-0.16.1-py3-none-any.whl
Size 39.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10503bb4b6f128b0d2971899d488fb913e96d1d5d4a6576ec96a803e05e51e6a
BLAKE2b-256 checksum
How to use checksums
44e77040d0d5c4d280791412cd3026180b4b4cf6f75dfb6407b06f22b07c0f5d
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.1

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