Skip to content

Standardize workspace on headless OpenCV#383

Merged
jarcherNV merged 2 commits into
NVIDIA:mainfrom
Arison591:agent/standardize-opencv-headless
Jul 24, 2026
Merged

Standardize workspace on headless OpenCV#383
jarcherNV merged 2 commits into
NVIDIA:mainfrom
Arison591:agent/standardize-opencv-headless

Conversation

@Arison591

Copy link
Copy Markdown
Contributor

Summary

  • remove FlashVSR's unused direct dependency on the GUI-enabled opencv-python distribution
  • switch ludus-renderer's development extra to opencv-python-headless
  • regenerate both the workspace and standalone ludus-renderer lockfiles
  • add a CPU dependency-policy test that prevents workspace packages from reintroducing conflicting OpenCV distributions

Why

The opencv-python and opencv-python-headless distributions install the same cv2 namespace and should not coexist in one environment. FlashDreams already standardizes on the headless distribution for server and CI use, but FlashVSR and ludus-renderer's development extra could still bring the GUI distribution into the shared workspace.

FlashVSR does not import cv2 directly, so its extra direct dependency is unnecessary. The renderer's development dependency still provides the same Python API through the headless build.

This does not add a new third-party component: opencv-python-headless is already used throughout the workspace and recorded in THIRD-PARTY-NOTICES.

Validation

  • PYTHONPATH=flashdreams python -m pytest tests/test_dependency_policy.py -m ci_cpu -q — 1 passed
  • uv lock --check — passed
  • uv lock --check --project integrations/omnidreams/ludus-renderer — passed
  • ruff check tests/test_dependency_policy.py — passed
  • ruff format --check tests/test_dependency_policy.py — passed
  • uvx ty check tests/test_dependency_policy.py — passed
  • uvx --from reuse reuse lint — REUSE 3.3 compliant, 508/508 files covered

GPU inference was not run because this change only affects dependency metadata and its CPU policy test.

The commit is signed off under the Developer Certificate of Origin.

@copy-pr-bot

copy-pr-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@gtong-nv

Copy link
Copy Markdown
Collaborator

Hi @Arison591, thanks for the PR. Can you mark it "Ready for review" so that we can land it?
This PR should fix #363

@Arison591
Arison591 marked this pull request as ready for review July 20, 2026 23:19
@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR standardizes the workspace on opencv-python-headless by removing FlashVSR's unnecessary direct opencv-python dependency, switching ludus-renderer's dev extra to the headless variant with an explicit <5 upper bound, regenerating both lockfiles, and adding a policy test that prevents any workspace package from (re)introducing conflicting OpenCV distributions.

  • FlashVSR (integrations/flashvsr/pyproject.toml): opencv-python>=4.8 dropped from direct dependencies; FlashVSR never imports cv2 directly.
  • ludus-renderer (integrations/omnidreams/ludus-renderer/pyproject.toml): dev extra changed from opencv-python>=4.5 to opencv-python-headless>=4.5,<5; the <5 bound keeps the standalone lockfile aligned with the workspace-resolved 4.13.0.92, addressing the version-drift risk flagged in a previous review.
  • Policy test (tests/test_dependency_policy.py): Scans every workspace pyproject.toml for opencv-python, opencv-contrib-python, or opencv-contrib-python-headless and fails the ci_cpu suite if any is found.

Confidence Score: 5/5

Safe to merge — changes are confined to dependency metadata and a new policy test with no runtime behaviour impact.

The diff removes an unused direct dependency, switches one dev-extra to the headless variant with an appropriate upper bound, and adds a CI test that catches regressions. Both lockfiles resolve to the same OpenCV version (4.13.0.92). No application logic is touched.

No files require special attention.

Important Files Changed

Filename Overview
integrations/flashvsr/pyproject.toml Removes unused opencv-python direct dependency; no cv2 import in FlashVSR source.
integrations/omnidreams/ludus-renderer/pyproject.toml Switches dev extra from opencv-python to opencv-python-headless>=4.5,<5; upper bound keeps standalone resolver on 4.x.
integrations/omnidreams/ludus-renderer/uv.lock Standalone lockfile regenerated; opencv-python-headless resolves to 4.13.0.92, matching the workspace lockfile.
tests/test_dependency_policy.py New policy test scans all workspace pyproject.toml files for forbidden OpenCV distributions; logic and normalization are correct.
uv.lock Workspace lockfile removes opencv-python entry for FlashVSR; numpy resolution-markers simplified as a side-effect.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Workspace packages] -->|before PR| B[opencv-python\nGUI-enabled]
    A -->|before PR| C[opencv-python-headless\nheadless]
    B -. conflict .-> C

    A -->|after PR| D[opencv-python-headless\nheadless only]

    subgraph "Policy enforcement"
        E[tests/test_dependency_policy.py\nci_cpu marker]
        E -->|scans| F[all workspace pyproject.toml files]
        F -->|fails if found| G[opencv-python\nopencv-contrib-python\nopencv-contrib-python-headless]
    end

    D --> E
Loading

Reviews (3): Last reviewed commit: "Address OpenCV review feedback" | Re-trigger Greptile

@gtong-nv

Copy link
Copy Markdown
Collaborator

/ok to test 55980b2

@jarcherNV

Copy link
Copy Markdown
Collaborator

Thanks, this looks directionally good to me. Standardizing on opencv-python-headless makes sense, and the workspace CI passing gives good coverage for the main FlashDreams path.

One thing I think we should address before merge: the standalone integrations/omnidreams/ludus-renderer/uv.lock now resolves opencv-python-headless to 5.0.0.93, while the workspace lock remains on 4.13.0.92. Since the PR is intended to switch GUI OpenCV to headless rather than introduce an OpenCV major-version upgrade, could we either pin the standalone ludus-renderer dev extra to <5 and regenerate the lockfile, or run/record a standalone ludus-renderer smoke/test pass against the OpenCV 5 lock?

Minor follow-up: the new dependency policy test currently scans workspace member pyproject.toml files, but not the root pyproject.toml, where shared dependency groups live. It would be useful to include the root file too so future root-level dependency additions cannot reintroduce opencv-python.

Taniffer added 2 commits July 24, 2026 09:27
Signed-off-by: Haoran Qian <haoran@hust.edu.cn>
Signed-off-by: Haoran Qian <haoran@hust.edu.cn>
@jarcherNV
jarcherNV force-pushed the agent/standardize-opencv-headless branch from 8f714d3 to bef892d Compare July 24, 2026 16:27
@jarcherNV

Copy link
Copy Markdown
Collaborator

/ok to test bef892d

@jarcherNV jarcherNV left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jarcherNV
jarcherNV added this pull request to the merge queue Jul 24, 2026
Merged via the queue into NVIDIA:main with commit 44e52c7 Jul 24, 2026
8 checks passed
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.

Standardize workspace on opencv-python-headless to prevent missing cv2 installs

4 participants