Releasing¶
Version bumping¶
The template uses bump-my-version to keep version numbers in sync across pyproject.toml, src/python_template/__init__.py, and [tool.commitizen]:
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 version in all configured files
- Creates a commit with message
chore(release): bump version X → Y - Creates a git tag
vX.Y.Z - Pushes commit and tag to origin
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.