Fix version resolution so uv can rebuild sdist + fix publish workflow#8
Merged
Conversation
Previous attempt (PR #7) tried to make about.py fall back to reading PKG-INFO when packageVersion isn't set, but about.py is exec()'d by setup.py so __file__ is not defined in its namespace — it silently raised NameError and fell through to '4.15.0'. That release (v1.0.22) also never made it to fury because CI's curl was hard-coded to the hyphenated sdist filename that setuptools >=69 no longer produces (PEP 625 normalizes to underscores). This change: * Reverts the broken about.py edits back to the v1.0.21 baseline. * Adds _resolve_version() in each setup.py (where __file__ is defined) that prefers packageVersion, then falls back to reading Version from the sdist's PKG-INFO, then to '4.15.0'. This makes 'uv sync' happy because the wheel it builds from the sdist reports the same version as the index entry (uv >=0.4 enforces this). * Verified locally: extracted v1.0.21 currently rebuilds as 4.15.0; with the fix it correctly rebuilds as 1.0.21. * Publish workflow: glob dist/*.tar.gz instead of hard-coding the hyphenated form, add a preflight FURY_PUSH_TOKEN check, and use curl --fail-with-body so future auth/upload failures actually fail the job.
loopingrage
approved these changes
Jul 7, 2026
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.
Background
PR #7 tried to fix an install-time metadata mismatch reported by uv (
Package metadata version 'X' does not match given version 'Y') by makingabout.pyfall back to readingPKG-INFOwhenpackageVersionisn't set. It was broken for two reasons:setup.pyreadsabout.pywithexec(f.read(), package_info). In an exec'd namespace,__file__is not defined. The_get_version()helper referencedos.path.dirname(__file__)outside itstry/except, so any timepackageVersionwas unset it raisedNameError— the exact case the fallback was supposed to handle.botbuilder_core_forked-1.0.22.tar.gz), but publish steps hard-coded the old hyphenated form (botbuilder-core-forked-1.0.22.tar.gz), socurlfailed with exit 26. The run silently failed the whole workflow — see run 28876487468.Net effect: v1.0.22 was tagged but never uploaded, and even if it had been, it would install as
4.15.0in uv.Fix
setup.py (all 4 packages) — add
_resolve_version()that:packageVersionenv var (release build in CI).PKG-INFOnext tosetup.py(uv/pip rebuild of extracted sdist).__file__is defined insetup.py's module namespace.4.15.0(unchanged final fallback).about.py (all 4 packages) — reverted back to the v1.0.21 baseline; the version logic belongs where
__file__is available..github/workflows/ci.yaml:
FURY_PUSH_TOKENis set with a clear::error::message pointing at the exactgh secret setcommand.dist/*.tar.gzfor the sdist filename instead of the old hyphenated hard-code.curl --fail-with-bodyso future upload/auth failures actually fail the job.Verification
Downloaded live v1.0.21 sdist from fury and ran
setup.py --versionwithoutpackageVersionset:4.15.0→ uv sees metadata mismatch1.0.21 != 4.15.01.0.21→ matches indexAlso rebuilt a fresh sdist end-to-end (build with
packageVersion=1.0.99, extract, rebuild wheel without env var): the wheel's METADATA reportsVersion: 1.0.99matching PKG-INFO.Follow-up
After this merges and publishes cleanly to fury, mappedgpt-bot's Dockerfile can drop the
packageVersion=1.0.21shim on theuv syncline, and its[[tool.uv.dependency-metadata]]overrides can be removed.