Skip to content

Implement is_unsatisfiable on SpecifierSet using intervals#1119

Open
notatallshaw wants to merge 4 commits intopypa:mainfrom
notatallshaw:is-unsatisfiable/is_unsatisfiable
Open

Implement is_unsatisfiable on SpecifierSet using intervals#1119
notatallshaw wants to merge 4 commits intopypa:mainfrom
notatallshaw:is-unsatisfiable/is_unsatisfiable

Conversation

@notatallshaw
Copy link
Member

Fixes #940
Fixes #306

This uses intervals that re-implement PEP 440 logic, the plan is to move the entire specifier machinery to use intervals, but that will be in a follow up PR. This approach focuses on relative simplicity, given that choice, and is not micro-optimized.

There are some edge cases around === that need to still be decided on, as this PR implements something closer to the specification than packaging quite implements (see #978 and #766), I will create a follow up PR to make that choice directly.

PR still needs a little clean up, so I will leave in draft for now and comment when ready for review.

@notatallshaw notatallshaw force-pushed the is-unsatisfiable/is_unsatisfiable branch 2 times, most recently from b67de8d to 7991a09 Compare March 27, 2026 01:28
@notatallshaw notatallshaw marked this pull request as ready for review March 27, 2026 01:31
@notatallshaw
Copy link
Member Author

I think this is ready for review, this attempts to be correct and implemented in an intuitive and as simple as possible way.

This does not intended to be performant, while not slow, there are a lot of opportunities for performance, but usually at the cost of adding complexity or making less intuitive .

@notatallshaw notatallshaw force-pushed the is-unsatisfiable/is_unsatisfiable branch 2 times, most recently from f4dd692 to ce9473c Compare March 27, 2026 04:10
@notatallshaw notatallshaw force-pushed the is-unsatisfiable/is_unsatisfiable branch from ce9473c to 4b067f1 Compare March 27, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an unsatisfiability check method to SpecifierSet Check for SpecifierSet syntactic consistency

1 participant