Skip to content

Is handling of python_version correct? #5717

@dimbleby

Description

@dimbleby

Currently poetry mostly treats python_version x.y as equivalent to python_full_version x.y.0, but is it necessarily so?

#!/usr/bin/env python3

from poetry.core.version.markers import parse_marker

m1 = parse_marker('python_version > "3.6"')
m2 = parse_marker('python_full_version == "3.6.2"')
allowed = m1.constraint.allows(m2.constraint)
print(allowed)

This prints True. But surely PEP508 says that the python_version at 3.6.2 is exactly 3.6, which does not satisfy m1.

related #2480.

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