-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
-
I am on the latest Poetry version.
-
I have searched the issues of this repo and believe that this is not a duplicate.
-
If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption). -
OS version and name: Windows 10, but also in a Linux docker container running Ubuntu 18.04
-
Poetry version: 1.0.9
-
Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/Korijn/b88b1605221574f51ee72b75efc03dbe
Issue
In PEP 440, it says the following in the section "Version Matching":
If the specified version identifier is a public version identifier (no local version label), then the local version label of any candidate versions MUST be ignored when matching versions.
I believe this clause is being interpreted incorrectly by Poetry. When running poetry lock on a pyproject.toml file (see the gist linked above) with the folowing lines, poetry incorrectly reports a conflict:
torch = "1.4.0+cpu"
torchvision = "0.5.0+cpu"
1: conflict: torchvision (0.5.0+cpu) depends on torch (1.4.0)
1: ! not torch (1.4.0) is satisfied by torch (1.4.0+cpu)
1: ! which is caused by "bla depends on torch (1.4.0+cpu)"
1: ! thus: torchvision is forbidden
1: ! torchvision (0.5.0+cpu) is satisfied by torchvision (0.5.0+cpu)
1: ! which is caused by "bla depends on torchvision (0.5.0+cpu)"
1: ! thus: version solving failed
As said in the first line of the debug output, the package torchvision (0.5.0+cpu) depends on torch (1.4.0). However, I've specified that I need torch (1.4.0+cpu). The PEP says that the local identifier MUST be ignored when performing the version match for the constraint coming from the torchvision (0.5.0+cpu) package. So I would say that this conflict is actually an acceptable solution, given the constraints.
Note that Pip has no problem installing this combination of packages.
This is an issue with Poetry's solver.