Skip to main content

Copier template for modern Python packages

Project description

templatepy

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 + secrets) must pass
                           merge blocked until green
                               ↓
                           merge to main (rebase)
                               ↓
                           bump.yml fires: cz bump → tag vX.Y.Z
                               ↓
                           release.yml fires on tag:
                           → 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.3.2.tar.gz (10.5 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.3.2-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: templatepy-0.3.2.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","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.3.2.tar.gz
Algorithm Hash digest
SHA256 9ed089b577c514b45b695dd31fd9e67f8fd167064826fbd69b1c9153e31c9c95
MD5 d3bd29a944f4a8f92bb283d1e98fb461
BLAKE2b-256 e4f05aeffb3871138b4f37a1e2a1ec06cbd69a95706c99fb52a8f9673874eba0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: templatepy-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","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.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 88389d647fd9664fc13a1e4a340ea9f9cfe3ffcc6514ae786eddfb264956cbf2
MD5 7d5eaf43b1b59f7b8bce4f1f2cada8ef
BLAKE2b-256 e2ddbe71c1c8197ef26482763110da1f5081bcd60c8837a4f73b5215c0472dbb

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