Repository navigation
xtcocotools: Add version 1.14.3 - #3184
Merged
Merged
Conversation
luhenry
added a commit
that referenced
this pull request
Oct 14, 2026
…-running (PR #3185, 0.3.0), home-assistant-chip-core scope note (stays queued)
luhenry
marked this pull request as draft
October 14, 2026 11:30
setup.py's get_version() only returns short_version when 'sdist' or 'bdist_wheel' is literally in sys.argv, else it reads __version__, which version.py never defines. A modern pip calls prepare_metadata_for_build_wheel first with 'dist_info' in sys.argv, hits that else branch, and the build fails with KeyError: '__version__' before any compilation happens - which is why cp313/cp314/cp314t failed here while cp312 (an older bundled pip that skips straight to bdist_wheel) did not. Broadening the check to 'dist_info'/'egg_info' too makes it match upstream's own intent on any pip version.
The previous patch broadened the sys.argv check (sdist/bdist_wheel -> also dist_info/egg_info) but kept reading the exec'd version.py names back out via locals(). That still fails on cp313/cp314/cp314t, now with KeyError: 'short_version' instead of KeyError: '__version__': PEP 667 (Python 3.13+) makes locals() inside a function always return a fresh snapshot built from the function's static fast-locals, so names only ever created by the nested exec (never assigned anywhere in get_version's own source) never survive a later locals() call, on either branch. Reproduced locally on cp3.13/cp3.11 with a minimal extract of get_version() plus xtcocotools/version.py. Exec into an explicit namespace dict instead, which sidesteps locals() entirely and is correct on every Python version.
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.
xtcocotools1.14.3Compiles the
xtcocotools._maskCython extension (COCO RLE mask API) against NumPy. Upstream publishes no riscv64 wheel.Mirrors upstream's
publish-to-pypi.ymlLinux job.Differs from upstream
setup.py bdist_wheel- upstream hand-tags a non-repaired wheel as manylinux1.requirements.txtpreinstalled with build isolation off -setup.pyimports numpy and has no[build-system]table.Testing
demos/evaluation scripts plus amaskencode/decode/area/toBbox/iou round trip.License: OK
Patches
0001-mask-use-NPY_ARRAY_OWNDATA-for-numpy-2.patch- To upstream [not submitted from this automated port run]. Without it everymaskfunction returning an array raisesAttributeErrorunder NumPy 2. Reproduces on x86.Built locally on x86_64 cp311; demos and mask checks pass.