Skip to content

Derive PyPI version from release tag - #149

Merged
sjw36 merged 1 commit into
mainfrom
version-from-tag
Jul 8, 2026
Merged

Derive PyPI version from release tag#149
sjw36 merged 1 commit into
mainfrom
version-from-tag

Conversation

@sjw36

@sjw36 sjw36 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Replace the hardcoded version="0.2.3" in setup.py with get_version(), which resolves the package version from the release tag pushed in CI.

Precedence: KNEXUS_WHEEL_VERSION override -> GITHUB_REF / GITHUB_REF_NAME (the v* tag on a tag push) -> git describe --tags (local tagged builds) -> DEFAULT_VERSION fallback. A leading "v" is stripped so v0.2.3 -> 0.2.3.

CI uses GITHUB_REF rather than git describe because actions/checkout does a shallow clone without tags, but the env vars are always set on the tag push that triggers the PyPI publish job.

Replace the hardcoded version="0.2.3" in setup.py with get_version(),
which resolves the package version from the release tag pushed in CI.

Precedence: KNEXUS_WHEEL_VERSION override -> GITHUB_REF /
GITHUB_REF_NAME (the v* tag on a tag push) -> git describe --tags
(local tagged builds) -> DEFAULT_VERSION fallback. A leading "v" is
stripped so v0.2.3 -> 0.2.3.

CI uses GITHUB_REF rather than git describe because actions/checkout
does a shallow clone without tags, but the env vars are always set on
the tag push that triggers the PyPI publish job.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sjw36
sjw36 merged commit 5b691d2 into main Jul 8, 2026
26 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