Skip to content

Check for SpecifierSet syntactic consistency #306

@marfvr

Description

@marfvr

Hi,

is it possible to check whether a SpecifierSet is "satisfiable" by any version?

Example:

The specifier set "<1.0, >=1.0" is clearly not satisfiable by any version number.

from packaging.specifiers import SpecifierSet
specifier_set = SpecifierSet("<1.0, >=1.0")

I'd like an operation like:

specifier_set.satisfiable()  # returns False

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions