Skip to content

Fix #20: single-provider install recipe + repair command for rtmlib's dual cv2 requirement - #21

Merged
thorwhalen merged 2 commits into
mainfrom
worktree-vg-20
Sep 7, 2026
Merged

thorwhalen merged 2 commits into
mainfrom
worktree-vg-20

Conversation

@thorwhalen

Copy link
Copy Markdown
Collaborator

Summary

  • rtmlib 0.0.16 declares opencv-python and opencv-contrib-python unconditionally (no marker), and its only cv2 usage is plain-API (VideoCapture, dnn.readNetFromONNX, drawing helpers — nothing contrib-only), confirmed by extracting the wheel and grepping its source.
  • Measured that a pyproject constraint alone cannot make paces[media,pose]'s closure single-provider: pip/uv have no per-transitive-dependency exclusion for a requirement a third-party package declares unconditionally. --no-deps on rtmlib itself works (it only needs onnxruntime/tqdm beyond cv2, both easy to add back), but there's no way to express "exclude just opencv-python" as a pyproject.toml constraint without forking rtmlib.
  • So the fix here is the honest one named in the issue: a documented two-step install recipe (README) that keeps the closure single-provider, plus check_pose_requirements() now names the repair command (not just the collision) when both providers are already present, with a test that forces that branch deterministically via monkeypatch (doesn't depend on the local environment's actual installed set).

Measurement (read-only, commands used)

# which cv2 wins today, and who else claims its files
python -c "import cv2; print(cv2.__file__, cv2.__version__)"
pip show -f opencv-python opencv-contrib-python | grep "cv2/__init__.py"

# mixing's pinned single provider
grep -n opencv <mixing repo>/pyproject.toml

# rtmlib's actual declared deps + resolved closure (no install)
uv pip compile <(echo "rtmlib>=0.0.16,<0.1")

# rtmlib's cv2 usage, from the wheel itself (no install into the env)
pip download --no-deps --dest <tmp> "rtmlib>=0.0.16,<0.1"
python -m zipfile -e rtmlib-*.whl <tmp>/extracted/
grep -rn "cv2\." <tmp>/extracted --include="*.py"

Confirmed: both opencv-python and opencv-contrib-python list cv2/__init__.py in their RECORD, so whichever installs last wins and uninstalling either can leave the survivor's cv2 with missing files — exactly the failure check_pose_requirements() now names a repair for.

Test plan

  • pytest tests/test_pose.py -q — 32 passed, 1 skipped
  • pytest -q (full suite) — 218 passed, 1 skipped
  • ruff check paces/pose.py tests/test_pose.py — clean
  • new test forces the two-provider branch via monkeypatch on importlib.metadata.version, independent of what's actually installed locally

Closes #20

https://claude.ai/code/session_016W3RcNo6snhKTw44jP6QWb

rtmlib declares both opencv-python and opencv-contrib-python, unpinned,
with no marker paces can override — measured (see PR body) as a hard
requirement in rtmlib's own metadata, so it cannot be fixed with a
pyproject constraint without forking rtmlib. rtmlib only calls plain cv2
APIs, so [media]'s opencv-contrib-python already covers it: document the
two-step install that keeps the closure single-provider, and have
check_pose_requirements() name the repair command (not just the
collision) when both providers are already present.

Closes #20

Claude-Session: https://claude.ai/code/session_016W3RcNo6snhKTw44jP6QWb
…-version FFmpeg claim

- README recipe now pins rtmlib>=0.0.16,<0.1 (matching paces' own floor/ceiling)
  and doesn't claim numpy among rtmlib's "other real deps" listed there.
- check_pose_requirements()'s repair note now says the fix isn't sticky and
  points at the README recipe, matching the module docstring.
- The GPL-on-macOS FFmpeg claim is scoped to the versions actually measured
  (4.12.0.88 / 4.13.0.92); the 5.0.0.93 macOS x86_64 wheel ships no FFmpeg.

Claude-Session: https://claude.ai/code/session_016W3RcNo6snhKTw44jP6QWb
@thorwhalen
thorwhalen merged commit e11f41c into main Sep 7, 2026
12 checks passed
@thorwhalen
thorwhalen deleted the worktree-vg-20 branch September 22, 2026 13:00
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.

rtmlib pulls both cv2 providers next to mixing's opencv-contrib-python

1 participant