Version selector always selects highest version for unpinned requirements, causes conflicts #6031
Closed
3 tasks done
Labels
kind/bug
Something isn't working as expected
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 (
-vvv
option).OS version and name: Ubuntu 20.04
Poetry version: 1.1.14
Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/SnoopJeDi/279a6c1186c09162f0235a4f9676ca75
Issue
NOTE: I am submitting this bug on behalf of a user who brought a question about this issue to #python on the Libera IRC network.
When resolving a
poetry add
command without any requirement (i.e.poetry add somepkg
), the version selector will choose the highest available version from the available versions, even if this will cause a conflict with an existing package by effectively excluding earlier versions.Reproduction
Below is the reproduction of the exact issue reported by the original user. Note that the version of
pytest
used by thepoetry new
command isv5.2
because of some hard-coded defaults in this version, but I can also reproduce this bug against ff8ae32 (which does not have this pinned version ofpytest
in thepyproject.toml
created bypoetry new
) by doingpoetry add pytest^5.2
beforepoetry add pluggy
. In both cases, the flaw can be avoided by using a more specific requirement, i.e.poetry add "pluggy<1.0"
The text was updated successfully, but these errors were encountered: