Skip to content

Install luxonis-ml before the NumPy pin returns - #278

Merged
kozlov721 merged 1 commit into
mainfrom
fix/luxonis-ml-v0.10.0
Aug 14, 2026
Merged

Install luxonis-ml before the NumPy pin returns#278
kozlov721 merged 1 commit into
mainfrom
fix/luxonis-ml-v0.10.0

Conversation

@kozlov721

@kozlov721 kozlov721 commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Purpose

The Test Modelconverter / rvc4 2.32.6 job fails in LuxonisML PR
#486
(run).
The Run integration tests step stops before the first test:

ERROR: Cannot install luxonis-ml[data,nn-archive]==0.10.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    luxonis-ml[data,nn-archive] 0.10.0 depends on numpy~=2.2; extra == "data"
    The user requested (constraint) numpy==1.26.4

ERROR: ResolutionImpossible

The root cause is the PIP_CONSTRAINT that #277 added. The RVC4 image
holds 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:

  1. pip install luxonis-ml with no constraint. pip pulls NumPy 2.x in.
  2. pip install -r /tmp/numpy-pin.txt puts the image's NumPy back.

The RVC4 image build has the same conflict and solves it in the same
way: docker/rvc4/Dockerfile installs requirements.txt first, then it
applies numpy<2 from modelconverter/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:

  • LuxonisML release/v0.10.0 pins the reusable workflow at
    Luxonis/modelconverter/.github/workflows/ci.yaml@673f11c. That pin
    needs the SHA of this fix after the merge.
  • requirements.txt still pins luxonis-ml[...]~=0.9.0. PyPI has 0.9.1
    as the newest release, so the pin stays as it is. It needs a bump
    after v0.10.0 goes to PyPI.

Testing & Validation

  • Reproduced the RVC4 image state in a python:3.10-slim container:
    luxonis-ml[data,nn_archive]~=0.9.0, then numpy<2 on top. NumPy
    became 1.26.4, which matches the CI log.
  • Ran the new install command against
    luxonis-ml @ git+...@release/v0.10.0 in that container. NumPy went
    1.26.4 → 2.2.6 → 1.26.4. luxonis_ml.__version__ reported 0.10.0 and
    cv2.__version__ reported 4.14.0.
  • Imported all 20 luxonis-ml names that modelconverter uses
    (LuxonisDataset, LuxonisLoader, ArchiveGenerator, is_nn_archive,
    Config, CONFIG_VERSION, PreprocessingBlock, BaseModelExtraForbid,
    PathType, Params, Environ, LuxonisConfig, LuxonisFileSystem,
    PUT_FILE_REGISTRY, environ, setup_logging, Registry, and the
    telemetry names) under NumPy 1.26.4. All imports passed.
  • Ran the step script with a stub CLI. The nested quoting produces the
    intended command inside the container.
  • pre-commit run --files .github/workflows/ci.yaml: 8 hooks passed, 9
    skipped, 0 failed.
  • The Test Modelconverter / Unit tests job of the same LuxonisML run
    passed 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

  • Tests
    • Improved integration test environment setup by preserving the existing NumPy version during package installation.
    • Removed persistent pip constraint usage to make dependency handling more reliable.

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>
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The integration workflow records the installed NumPy version, installs luxonis-ml without a persistent pip constraint, and restores NumPy afterward.

Changes

CI NumPy installation

Layer / File(s) Summary
Preserve NumPy during ML installation
.github/workflows/ci.yaml
The workflow saves the current NumPy version, installs luxonis-ml normally, and reinstalls the saved version. The previous PIP_CONSTRAINT flow was removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: 🟡 Moderate · up to 4d078

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)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the CI installation order change for luxonis-ml and the NumPy pin.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/luxonis-ml-v0.10.0

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kozlov721
kozlov721 marked this pull request as ready for review August 14, 2026 16:59
@kozlov721
kozlov721 requested a review from a team as a code owner August 14, 2026 16:59
@kozlov721
kozlov721 requested review from klemen1999 and removed request for a team August 14, 2026 16:59
coderabbitai[bot]

This comment was marked as low quality.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.12%. Comparing base (673f11c) to head (4d07856).
✅ All tests successful. No failed tests found.

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           
Flag Coverage Δ
conversion 44.62% <ø> (ø)
unit 78.74% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@kozlov721
kozlov721 merged commit e8bb246 into main Aug 14, 2026
13 checks passed
@kozlov721
kozlov721 deleted the fix/luxonis-ml-v0.10.0 branch August 14, 2026 18:24
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.

3 participants