Install luxonis-ml before the NumPy pin returns - #278
Conversation
The RVC4 image holds NumPy 1.x, because the SNPE tools read garbage under the 2.x ABI. luxonis-ml requires NumPy 2.x. `PIP_CONSTRAINT` gave pip both rules at the same time, so the install of luxonis-ml v0.10.0 stopped with `ResolutionImpossible`. Install luxonis-ml first, then put the pinned NumPy back. The image build solves the same conflict in the same two steps. A wheel that is built against NumPy 2.x also runs with NumPy 1.x, so the downgrade keeps the environment usable. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe integration workflow records the installed NumPy version, installs ChangesCI NumPy installation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: 🟡 Moderate · up to The workflow’s integration installation command can break when ML_REF is set because of incorrect quoting, leaving the CI job unable to install luxonis-ml and run its tests. Fix this command before merging. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #278 +/- ##
=======================================
Coverage 99.12% 99.12%
=======================================
Files 83 83
Lines 6861 6861
=======================================
Hits 6801 6801
Misses 60 60
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Purpose
The
Test Modelconverter / rvc4 2.32.6job fails in LuxonisML PR#486
(run).
The
Run integration testsstep stops before the first test:The root cause is the
PIP_CONSTRAINTthat #277 added. The RVC4 imageholds NumPy 1.x, because the SNPE tools read garbage under the 2.x ABI.
The constraint file gave pip that pin, and luxonis-ml asks for NumPy
2.x. pip cannot satisfy both rules at the same time, so the resolution
fails.
Specification
The install now runs in two steps:
pip installluxonis-ml with no constraint. pip pulls NumPy 2.x in.pip install -r /tmp/numpy-pin.txtputs the image's NumPy back.The RVC4 image build has the same conflict and solves it in the same
way:
docker/rvc4/Dockerfileinstallsrequirements.txtfirst, then itapplies
numpy<2frommodelconverter/packages/rvc4/requirements.txt.This change makes the CI install agree with the image build.
The downgrade is safe. A wheel that is built against NumPy 2.x also runs
with NumPy 1.x, because NumPy 2.0 keeps backward binary compatibility.
Dependencies & Potential Impact
No runtime dependency additions. The change touches CI only.
Two follow-ups stay open:
release/v0.10.0pins the reusable workflow atLuxonis/modelconverter/.github/workflows/ci.yaml@673f11c. That pinneeds the SHA of this fix after the merge.
requirements.txtstill pinsluxonis-ml[...]~=0.9.0. PyPI has 0.9.1as the newest release, so the pin stays as it is. It needs a bump
after v0.10.0 goes to PyPI.
Testing & Validation
python:3.10-slimcontainer:luxonis-ml[data,nn_archive]~=0.9.0, thennumpy<2on top. NumPybecame 1.26.4, which matches the CI log.
luxonis-ml @ git+...@release/v0.10.0in that container. NumPy went1.26.4 → 2.2.6 → 1.26.4.
luxonis_ml.__version__reported 0.10.0 andcv2.__version__reported 4.14.0.(
LuxonisDataset,LuxonisLoader,ArchiveGenerator,is_nn_archive,Config,CONFIG_VERSION,PreprocessingBlock,BaseModelExtraForbid,PathType,Params,Environ,LuxonisConfig,LuxonisFileSystem,PUT_FILE_REGISTRY,environ,setup_logging,Registry, and thetelemetry names) under NumPy 1.26.4. All imports passed.
intended command inside the container.
pre-commit run --files .github/workflows/ci.yaml: 8 hooks passed, 9skipped, 0 failed.
Test Modelconverter / Unit testsjob of the same LuxonisML runpassed against
release/v0.10.0, so the library API needs no change.AI Usage
Assisted-by: Claude Code:claude-opus-5 docker pre-commit
Submitted code was reviewed by a human: NO
The author is taking the responsibility for the contribution: YES
🤖 Generated with Claude Code
Summary by CodeRabbit