Fix pypi wheel build (incorrect version of `opencv`)
roomrys opened this issue · 1 comments
With some changes to our dependencies from this commit (PR #1623), we now have less restrictions on the version/flavor of opencv
that is pulled in from our dependencies. Which is great!
For example, before freeing up the version/flavor of
opencv
, we needed to do this weird work-around to develop the multiview GUI (which depends on sleap-anipose which depends on aniposelib with also depends on a pinned version/flavor of opencv). The hope is that #1623 will allow us to pin the version/flavor toopencv-contrib-python<4.7.0
without issue.
Lines 50 to 51 in 0230a97
But, with great power comes great responsibility - and the dependency range on opencv
is now giving pypi too much freedom/power to decide which version of opencv
to use. In fact, now we run into errors when just trying to import opencv
!
The problem here could be two things:
- The range of versions we pin for
opencv
is wrong and we need to specifyopencv-contrib-python<4.7.0
in the pypi requirments.
Line 14 in eb14764
- One of our dependencies (or dependencies of dependencies) also depends on
opencv
and pins the wrong (or too broad) range foropencv
.
The solution would be to first try pinning the desired version of opencv-contrib-python<4.7.0
in our pypi_requirements.txt
and see if the building the pypi wheel now works (checkout how we build it in our actions to test it yourself manually). If that doesn't work, it's going to get messy - we need to find which one of our dependencies requires a conflicting version of opencv and basically figure out a way around this.
This is now resolved with #1724 + #1726 + talmolab/conda_packages#2, which combined allow us to use the conda-forge::opencv
package up to 4.8.x. In addition to getting rid of the PyPI version of opencv-python
, this conda package also ships with ffmpeg and contrib. It also shims opencv-python
, opencv-python-headless
and the contrib variants so the PyPI versions don't get pulled in.
Note: We still need to move the new sleap::tensorflow
package from sleap/label/dev
to sleap/label/main
when we release 1.4.0, but for now, this new setup works like this using the current environment.yml
.