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.
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 making about.py fall back to reading PKG-INFO when packageVersion isn't set. It was broken for two reasons:
Net effect: v1.0.22 was tagged but never uploaded, and even if it had been, it would install as 4.15.0 in uv.
Fix
setup.py (all 4 packages) — add _resolve_version() that:
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:
Verification
Downloaded live v1.0.21 sdist from fury and ran setup.py --version without packageVersion set:
Also rebuilt a fresh sdist end-to-end (build with packageVersion=1.0.99, extract, rebuild wheel without env var): the wheel's METADATA reports Version: 1.0.99 matching PKG-INFO.
Follow-up
After this merges and publishes cleanly to fury, mappedgpt-bot's Dockerfile can drop the packageVersion=1.0.21 shim on the uv sync line, and its [[tool.uv.dependency-metadata]] overrides can be removed.