uv
6b7f60c1 - Fix pre-release exclusive comparison operator in uv-pep440 (#12836)

Commit
244 days ago
Fix pre-release exclusive comparison operator in uv-pep440 (#12836) From PEP 440: > The exclusive ordered comparison <V MUST NOT allow a pre-release of the specified version unless the specified version is itself a pre-release. Allowing pre-releases that are earlier than, but not equal to a specific pre-release may be accomplished by using <V.rc1 or similar. We had an additional check that would block this even if the specifier did have a pre-release. This likely didn't show up earlier because `Ranges` uses different code in the resolver. I checked these changes against `packaging` to verify their behavior: ```python print(SpecifierSet("<1").contains("1a1", prereleases=True)) # False print(SpecifierSet("<1a2").contains("1a1", prereleases=True)) # True print(SpecifierSet("<1").contains("1dev1", prereleases=True)) # False print(SpecifierSet("<1dev2").contains("1dev1", prereleases=True)) # True print(SpecifierSet("<1a2").contains("1dev1", prereleases=True)) # True ``` Closes #12834
Author
Parents
Loading