Skip to content

Releasing

Version bumping

The template uses Commitizen to bump the version, keep pyproject.toml and src/python_template/__init__.py in sync, and generate the changelog from your Conventional Commits:

just release patch    # 0.1.0 → 0.1.1
just release minor    # 0.1.0 → 0.2.0
just release major    # 0.1.0 → 1.0.0

This:

  1. Runs just check (lint + typecheck + test)
  2. Bumps the version (pyproject.toml + __init__.py)
  3. Updates docs/changelog.md from the commits since the last tag
  4. Creates a release commit and a git tag vX.Y.Z
  5. Pushes commit and tag to origin

The increment can also be inferred from your commit history — omit the argument and run uv run cz bump to let Commitizen decide.

Publishing to PyPI

Create a GitHub Release from the tag. The publish.yml workflow automatically builds with uv build and publishes to PyPI using trusted publishers.

One-time PyPI setup

  1. Go to pypi.org → your project → Publishing → Add a new publisher
  2. Enter: repo namitdeb739/python-template, workflow publish.yml, environment pypi

No API tokens needed: trusted publishers use OIDC for authentication.

Build system

Uses Hatchling as the build backend, configured to package from the src/ directory.