Skip to content

~= version constraints (PEP 440) do not correctly set the lower version #1153

@epage

Description

@epage
  • 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: Windows 10
  • Poetry version: 0.12.16
  • Link of a Gist with the contents of your pyproject.toml file: N/A

Issue

Found this while fixing handling of pre-release (#1150)

PEP 440 says

  • ~=V.N maps to >= V.N, == V.*

Examples

~= 2.2
>= 2.2, == 2.*

~= 1.4.5
>= 1.4.5, == 1.4.*

~= 2.2.0
>= 2.2.0, == 2.2.*

~= 1.4.5.0
>= 1.4.5.0, == 1.4.5.*

but looking at the tests ~=3.5.3 maps to >=3.5.0, < 3.6 when it should map to >=3.5.3, <3.6. The trailing 3 should be setting the floor for the version

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions