Repository navigation
Fix dead version-injection sed in release.yml - #182
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
release.yml's "Configure version" steps (inbuild-wheelsandbuild-sdist) were meant to apply the.devN(TestPyPI) /.postN(production rebuild) suffix on top of the base version inprimer3/__init__.py, via:sed -i.bak "s/version=.*,/version='${VERSION}',/" setup.pysetup.pyno longer has aversion=...,line — versioning moved topyproject.toml's dynamicattr: 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.devNbuild (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=1resolves to the same base version either way), but would silently fail to apply a.postNsuffix 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 linevalidate-versionalready parses to determine the base version.Test plan
__init__.py's__version__to2.4.0.dev1and ranpython -m build --sdist; confirmed it producedprimer3_py-2.4.0.dev1.tar.gz, proving the dynamic version resolution picks up the patched value correctly.is_test=true) should publish under a.devN-suffixed version rather than the bare release version.🤖 Generated with Claude Code