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 (required for CI gate)

Repo settings → Branches → Add rule for main:

  • ✅ Require status checks: CI job
  • ✅ Require branches to be up to date
  • ✅ Require linear history

For the auto-bump workflow to push the bump commit back to main:

  • ✅ Allow specified actors to bypass → add github-actions[bot]

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

templatepy-0.14.0.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

templatepy-0.14.0-py3-none-any.whl (29.6 kB view details)

Uploaded Python 3

File details

Details for the file templatepy-0.14.0.tar.gz.

File metadata

  • Download URL: templatepy-0.14.0.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for templatepy-0.14.0.tar.gz
Algorithm Hash digest
SHA256 6bc6e5464a7a4b3b29b8e3def6d39f4893ff34fbf7b9f2741f8fc2c57a21ada3
MD5 ec4de975553a65841c1ed2f2354252ce
BLAKE2b-256 e884afccae6ef661ae3b982a76cbecf74ae6078bcff74e1010c5086b140ab93c

See more details on using hashes here.

File details

Details for the file templatepy-0.14.0-py3-none-any.whl.

File metadata

  • Download URL: templatepy-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 29.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for templatepy-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e6d167ff3547c484765f68c04a7c092c27a2acaa050c11b3f828d90e27cb553
MD5 e98b42f3a9435913ddf8baa242efa388
BLAKE2b-256 c37285db03dcd7bd26ec7375afbbeef5e4ec02da90c4ce26d1e0e7a544a0736d

See more details on using hashes here.

Release history Release notifications | RSS feed

0.15.0

2 files

This release

0.14.0 This release

2 files

0.13.0

2 files

0.12.1

2 files

0.12.0

2 files

0.11.0

2 files

0.10.3

2 files

0.10.2

2 files

0.10.1

2 files

0.10.0

2 files

0.9.1

2 files

0.9.0

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.2

2 files

0.2.9

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.3

2 files

0.2.0

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

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