Skip to main content

Copier template for modern Python packages

Project description

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 (rebase)
                               ↓
                           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 (no stored token)
                           → Zenodo webhook (if enabled)

PyPI setup (one-time per repo)

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

Deploy to GitHub Pages on push to main via docs.yml (automatic).

Project details


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.12.0.tar.gz (16.0 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.12.0-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: templatepy-0.12.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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.12.0.tar.gz
Algorithm Hash digest
SHA256 ad23046a304a307dc6e4bfc6a5d726935bd6f69fb9cf8006bc8a25e65a7d310e
MD5 4289c7c3b90aa1a7fb2fac62eec15c82
BLAKE2b-256 4457069c492e3f60229014cb3a1bbfaa1dc7e147c71b12e201f7d6b0516a8f8c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: templatepy-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 28.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 23d2307e884fd5587412eee0b1cb532355ac8ba905734d6103697c5a4510981d
MD5 c104e78fabedd77719416aa44183e6ac
BLAKE2b-256 a0f51892c4484319b5756827f6fdcedec803ce232c6644d002d36a751637dbc5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page