dwave-system icon indicating copy to clipboard operation
dwave-system copied to clipboard

Potential dependency conflicts between dwave-system and dimod

Open NeolithEra opened this issue 5 years ago • 2 comments

Hi, as shown in the following full dependency graph of dwave-system, dwave-system requires dimod >=0.9.0,<0.10.0, dwave-system requires dwave-networkx >=0.8.4 (dwave-networkx 0.8.4 will be installed, i.e., the newest version satisfying the version constraint), and directed dependency dwave-networkx 0.8.4 transitively introduces dimod >=0.8.0. Obviously, there are multiple version constraints set for dimod in this project. However, according to pip's “first found wins” installation strategy, dimod 0.9.1 (i.e., the newest version satisfying constraint >=0.9.0,<0.10.0) is the actually installed version. Although the first found package version dimod 0.9.1 just satisfies the later dependency constraint (dimod >=0.8.0), such installed version is very close to the upper bound of the version constraint of Dimod specified by dwave-networkx 0.8.4 . Once dwave-networkx upgrades,its newest version will be installed. Therefore, it will easily cause a dependency conflict (build failure), if the upgraded dwave-networkx version introduces a higher version of Dimod, violating its another version constraint >=0.9.0,<0.10.0. According to the release history of dwave-networkx, it habitually upgrates Dimod in its recent releases. For instance, dwave-networkx 0.6.9 upgrated Dimod’s constraint from >=0.6.8,<0.8.0 to >=0.6.8,<0.9.0, dwave-networkx 0.7.0 upgrated Dimod’s constraint from >=0.6.8,<0.9.0 to >=0.8.0,<0.9.0, and dwave-networkx 0.8.4 upgrated Dimod’s constraint from >=0.8.0,<0.9.0 to >=0.8.0. As such, it is a warm warning of a potential dependency conflict issue for dwave-system.

Dependency tree

dwave-system - 0.9.1
| +- dimod(install version:0.9.1 version range:>=0.9.0,<0.10.0)
| | +- numpy(install version:1.18.4 version range:>=1.16.0,<2.0.0)
| | +- six(install version:1.14.0 version range:>=1.10.0,<2.0.0)
| +- dwave-cloud-client(install version:0.7.2 version range:>=0.6.0,<0.8.0)
| | +- click(install version:7.1.1 version range:>=7.0)
| | +- homebase(install version:1.0.1 version range:>=1.0)
| | +- plucky(install version: version range:>=0.4.3)
| | +- python-dateutil(install version:2.8.1 version range:>=2.7)
| | +- requests(install version:2.23.0 version range:>=2.18)
| | | +- certifi(install version:2020.4.5.1 version range:>=2017.4.17)
| | | +- chardet(install version:3.0.4 version range:>=3.0.2,<4)
| | | +- idna(install version:2.9 version range:>=2.5,<3)
| | | +- urllib3(install version:1.25.9 version range:>=1.21.1,<1.26)
| | +- six(install version:1.14.0 version range:>=1.10)
| +- dwave-networkx(install version:0.8.6 version range:>=0.8.4)
| | +- decorator(install version:4.4.2 version range:>=4.1.0,<5.0.0)
| | +- dimod(install version:0.9.1 version range:>=0.8.0)
| | | +- numpy(install version:1.18.4 version range:>=1.16.0,<2.0.0)
| | | +- six(install version:1.14.0 version range:>=1.10.0,<2.0.0)
| | +- networkx(install version:2.4 version range:>=2.0,<3.0)
| | | +- decorator(install version:4.4.2 version range:>=4.3.0)
| +- homebase(install version:1.0.1 version range:>=1.0.0,<2.0.0)
| +- minorminer(install version:0.1.9 version range:>=0.1.3,<0.2.0)
| +- networkx(install version:2.4 version range:>=2.0,<3.0)
| | +- decorator(install version:4.4.2 version range:>=4.3.0)
| +- numpy(install version:1.18.4 version range:>=1.14.0,<2.0.0)
| +- six(install version:1.14.0 version range:>=1.11.0,<2.0.0) 

Thanks for your help. Best, Neolith

NeolithEra avatar May 12 '20 14:05 NeolithEra

Suggested Solution

  1. Loosen the version range of dimod to be >=0.9.0.
  2. Remove your direct dependency dimod, and use the dimod transitively introduced by dwave-networkx.
  3. Change your direct dependency dwave-networkx to be >=0.8.4,<=0.8.6. @randomir Which solution do you prefer, 1 ,2 or 3? Please let me know your choice. May I pull a request to solve this issue?

NeolithEra avatar May 12 '20 14:05 NeolithEra

Thank you for bringing this to our attention, @NeolithEra.

For the same reasons listed on dwave-neal#79, I recommend a 4th option: dwave-networkx>=0.8.4,<0.9.0.

randomir avatar May 15 '20 20:05 randomir

Closing as resolved.

arcondello avatar Jan 26 '23 18:01 arcondello