Skip to content

Specifier equivalence check does not consider version equivalence #282

@uranusjr

Description

@uranusjr

Orginally reported as pypa/pip#7900.

Currently the specifier equivalence check compares the contained version as a string. packaging.version.parse should be used instead to ensure equivalent version strings are considered equal.

Minimal reproduction:

>>> from packaging.specifiers import SpecifierSet
>>> SpecifierSet("==2.8.0") == SpecifierSet("==2.8.0")
True
>>> SpecifierSet("==2.8.0") == SpecifierSet("==2.8")
False

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions