Fix pypi wheel build (incorrect version of `opencv`)
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.0without issue. https://github.com/talmolab/sleap/blob/0230a97d677be8429fa7c1ccb43de31284c6f28b/environment.yml#L50-L51
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
opencvis wrong and we need to specifyopencv-contrib-python<4.7.0in the pypi requirments. https://github.com/talmolab/sleap/blob/eb147646a79d057b508d7cbfa8f4c5e158601104/pypi_requirements.txt#L14 - One of our dependencies (or dependencies of dependencies) also depends on
opencvand 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.