Skip to content

Fix dead version-injection sed in release.yml - #182

Merged
benpruitt merged 1 commit into
masterfrom
fix/release-version-injection
Oct 21, 2026
Merged

benpruitt merged 1 commit into
masterfrom
fix/release-version-injection

Conversation

@benpruitt

Copy link
Copy Markdown
Contributor

Summary

release.yml's "Configure version" steps (in build-wheels and build-sdist) were meant to apply the .devN (TestPyPI) / .postN (production rebuild) suffix on top of the base version in primer3/__init__.py, via:

sed -i.bak "s/version=.*,/version='${VERSION}',/" setup.py

setup.py no longer has a version=..., line — versioning moved to pyproject.toml's dynamic attr: primer3.__version__ a while back — so this sed silently matches nothing and does nothing. Every "test" release (is_test=true) has been publishing under the bare release version instead of a .devN build (confirmed back through 2.2.0, 2.3.0, 2.3.1, 2.4.0 on TestPyPI). It had no effect on a normal first-attempt production release (build_number=1 resolves to the same base version either way), but would silently fail to apply a .postN suffix on a production rebuild after a failed first attempt.

Fix

Patch primer3/__init__.py's __version__ line instead — the actual single source of truth, and the same line validate-version already parses to determine the base version.

Test plan

  • Locally patched __init__.py's __version__ to 2.4.0.dev1 and ran python -m build --sdist; confirmed it produced primer3_py-2.4.0.dev1.tar.gz, proving the dynamic version resolution picks up the patched value correctly.
  • Next real TestPyPI dry-run (is_test=true) should publish under a .devN-suffixed version rather than the bare release version.

🤖 Generated with Claude Code

The "Configure version" steps in build-wheels and build-sdist patched
setup.py's `version=...,` line to apply the .devN (test) / .postN
(production rebuild) suffix. That line no longer exists in setup.py --
versioning moved to pyproject.toml's dynamic `attr: primer3.__version__`
some time ago -- so the sed silently matched nothing and did nothing.

Every TestPyPI "test" release has therefore been published under the
bare release version (e.g. 2.4.0) instead of the intended 2.4.0.dev1,
confirmed back through 2.2.0, 2.3.0, and 2.3.1 on TestPyPI. This had no
effect on normal first-attempt production releases (build_number=1
resolves to the same base version either way), but would silently fail
to apply a .postN suffix on a production rebuild, and misrepresents
test builds as the final release version on TestPyPI.

Patch primer3/__init__.py's `__version__` line instead, which is both
the actual source of truth and what validate-version already parses.
Verified locally: patching __init__.py to '2.4.0.dev1' and running
`python -m build --sdist` produces primer3_py-2.4.0.dev1.tar.gz.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@benpruitt
benpruitt merged commit a48220b into master Oct 21, 2026
22 checks passed
@benpruitt
benpruitt deleted the fix/release-version-injection branch October 21, 2026 23:34
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