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:
- Runs
just check(lint + typecheck + test) - Bumps the version (
pyproject.toml+__init__.py) - Updates
docs/changelog.mdfrom the commits since the last tag - Creates a release commit and a git tag
vX.Y.Z - 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¶
- Go to pypi.org → your project → Publishing → Add a new publisher
- Enter: repo
namitdeb739/python-template, workflowpublish.yml, environmentpypi
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.