Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
All notable changes to this project are documented in this file and maintained manually. The
format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

### Changed

- `__version__` is read from the installed package metadata (`importlib.metadata`), not hardcoded,
so it can no longer disagree with `pyproject.toml` (a hardcoded one went stale in releases).

## [0.1.0] - 2026-10-05

### Added
Expand Down
6 changes: 3 additions & 3 deletions docs/src/content/docs/development/publishing.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Enable GitHub Pages once in the repository settings, with "GitHub Actions" as th

## Releases and PyPI

Before merging a release to `main`, update the version in `pyproject.toml`,
`src/app/__init__.py` and `CITATION.cff` (including its release date), and add the release notes
to `CHANGELOG.md`. On every push to `main`, the `Release` workflow:
Before merging a release to `main`, update the version in `pyproject.toml` and `CITATION.cff`
(including its release date), and add the release notes to `CHANGELOG.md`. The package's
`__version__` is read from the installed metadata, so it follows `pyproject.toml`. On every push to `main`, the `Release` workflow:

1. tags the release `vX.Y.Z` and creates the GitHub release,
2. builds the package with `uv build` and publishes it to PyPI with trusted publishing (OIDC),
Expand Down
7 changes: 6 additions & 1 deletion src/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""Template python package."""

__version__ = "0.1.0"
from importlib.metadata import PackageNotFoundError, version

try:
__version__ = version("template-python")
except PackageNotFoundError: # not installed, e.g. run from a source tree
__version__ = "0.0.0+unknown"
Loading