sleap icon indicating copy to clipboard operation
sleap copied to clipboard

Fix pypi wheel build (incorrect version of `opencv`)

Open roomrys opened this issue 1 year ago • 0 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 to opencv-contrib-python<4.7.0 without 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:

  1. The range of versions we pin for opencv is wrong and we need to specify opencv-contrib-python<4.7.0 in the pypi requirments. https://github.com/talmolab/sleap/blob/eb147646a79d057b508d7cbfa8f4c5e158601104/pypi_requirements.txt#L14
  2. One of our dependencies (or dependencies of dependencies) also depends on opencv and pins the wrong (or too broad) range for opencv.

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.

roomrys avatar Mar 20 '24 18:03 roomrys