Skip to content

Fix release version lookup after dynamic versioning - #29

Merged
CollierKing merged 1 commit into
mainfrom
fix/release-version-lookup
Sep 19, 2026
Merged

CollierKing merged 1 commit into
mainfrom
fix/release-version-lookup

Conversation

@CollierKing

Copy link
Copy Markdown
Owner

Problem

The Check Version step in the release workflow fails:

Run set -eu
Error: Process completed with exit code 1.

0.4.0 made the package version dynamic — hatchling reads __version__ from the package — so there is no longer a version = line in pyproject.toml. The step's grep '^version = ' pyproject.toml matches nothing, and under set -eu a failed grep aborts the job.

This was an oversight in #28: the version's source changed without updating the one place that read it.

Fix

Read __version__ from the installed package, which is the same source hatchling builds the distribution from, and fail with an explicit message if it comes back empty.

pkg_name still comes from pyproject.toml, since name is static.

Testing

Ran the step's script verbatim against a synced checkout:

pkg-name=sqlalchemy-cloudflare-d1
version=0.4.0
tag would be: v0.4.0

v0.4.0 is what mark-release uses for the tag, matching the previous behaviour.

The version became dynamic, so `grep '^version = ' pyproject.toml` matches
nothing and the Check Version step exits 1 under `set -eu`. It now reads
__version__ from the installed package, which is the source hatchling builds
from, and fails with a clear message if that comes back empty.
@CollierKing
CollierKing merged commit b44c4ea into main Sep 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant