Skip to content

xtcocotools: Add version 1.14.3 - #3184

Merged
riseproject-dev[bot] merged 3 commits into
mainfrom
xtcocotools
Oct 26, 2026
Merged

riseproject-dev[bot] merged 3 commits into
mainfrom
xtcocotools

Conversation

@luhenry

@luhenry luhenry commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Compiles the xtcocotools._mask Cython extension (COCO RLE mask API) against NumPy. Upstream publishes no riscv64 wheel.

Mirrors upstream's publish-to-pypi.yml Linux job.

Differs from upstream

  • cibuildwheel instead of setup.py bdist_wheel - upstream hand-tags a non-repaired wheel as manylinux1.
  • requirements.txt preinstalled with build isolation off - setup.py imports numpy and has no [build-system] table.

Testing

  • Upstream has no test suite; runs its three demos/ evaluation scripts plus a mask encode/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 every mask function returning an array raises AttributeError under NumPy 2. Reproduces on x86.

Built locally on x86_64 cp311; demos and mask checks pass.

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
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.
@luhenry
luhenry marked this pull request as ready for review October 26, 2026 08:33
@riseproject-dev
riseproject-dev Bot merged commit 599276f into main Oct 26, 2026
9 checks passed
@riseproject-dev
riseproject-dev Bot deleted the xtcocotools branch October 26, 2026 08:36
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