Skip to content

Commit ce80955

Browse files
authored
Mitigate hidden opencv dependency conflicts in pixi (#6946)
### What I think it should fix most of - #6901 In short, the opencv packages are an aboslute dumpster fire. This is a good summary of relevant discussions on the matter: - opencv/opencv-python#987 In short: `opencv-python` and `opencv-contrib-python` are two distinct, conflicting packages. But `pypi` doesn't have a way of specifying package conflicts (same as our `rerun` vs `rerun-sdk` issue). If you install both, one will shadow the other, non-determinically causing some features to appear to be missing. Conda fortunately somewhat side-steps this by only providing one. Unfortunately, the pixi pypi-conda-mapping only maps `opencv-python` -> `conda: py-opencv` but doesn't handle the mapping for `opencv-contrib-python`. To solve this we now: force `opencv` to be installed via conda for both `base` and `examples`. This means any package that depends on `opencv-python` will pick up the conda version (which actually includes contrib). We still have both direct and indirect (via mediapipe) packages that depend on `opencv-contrib-python` that lead to some dangerous package-shadowing. But at least they're mostly the same package at this point. (I added a comment to the tracking issue with with pix as well: prefix-dev/pixi#771 (comment)) Also I hit some weird issues with `numpy` since `rerun-sdk` has a dependency on `numpy<2`. Certain permutations of packages seem to trick the solver into thinking the constraints (when pulled from pypy) are non-satisfiable. By pulling the numpy dep into conda dep list everything seems happy. ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using examples from latest `main` build: [rerun.io/viewer](https://rerun.io/viewer/pr/6946?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [rerun.io/viewer](https://rerun.io/viewer/pr/6946?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! * [x] If have noted any breaking changes to the log API in `CHANGELOG.md` and the migration guide - [PR Build Summary](https://build.rerun.io/pr/6946) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) To run all checks from `main`, comment on the PR with `@rerun-bot full-check`.
1 parent 81d7be9 commit ce80955

File tree

3 files changed

+2921
-5105
lines changed

3 files changed

+2921
-5105
lines changed

examples/python/detect_and_track_objects/pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ readme = "README.md"
66
dependencies = [
77
"numpy",
88
"opencv-contrib-python>4.6",
9-
"opencv-python>4.6",
109
"pillow",
1110
"requests>=2.31,<3",
1211
"rerun-sdk",

0 commit comments

Comments
 (0)