Skip to content

Poetry & PEP440 Disagree on an example in the PEP. #7050

@r-richmond

Description

@r-richmond
  • Poetry version: 1.2.2
  • Python version: 3.10.8
  • OS version and name: macOS 13.0.1
  • pyproject.toml: N/A
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Discovered during the conversation in #7047.

Poetry does not return the same results as one of the examples in PEP 440.

#!/usr/bin/env python3

from poetry.core.constraints.version.version import Version
from poetry.core.constraints.version import parse_constraint

constraint = parse_constraint("==1.1.*")
version = Version.parse("1.1a1")
allowed = constraint.allows(version)
print(f"{allowed=}")

prints allowed=False which does not match the example here

cc: @dimbleby

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expectedstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions