Narrow >V post-release exclusion to match spec#1141
Merged
notatallshaw merged 2 commits intopypa:mainfrom Apr 5, 2026
Merged
Conversation
Member
Author
|
This one feels more intuitive to me than #1140, I am much less concerned about the behavior change it introduces, the fact that currently |
notatallshaw
added a commit
to notatallshaw/packaging
that referenced
this pull request
Apr 2, 2026
325 Hypothesis tests that verify algebraic invariants from the version specifiers specification. Each test class quotes the spec paragraph it validates. Tests are excluded from coverage and run as a separate CI job via `nox -s property_tests`. Two tests are expected to fail until pypa#1140 and pypa#1141 are merged (exclusive comparison exclusion rules).
notatallshaw
added a commit
to notatallshaw/packaging
that referenced
this pull request
Apr 2, 2026
325 Hypothesis tests that verify algebraic invariants from the version specifiers specification. Each test class quotes the spec paragraph it validates. Tests are excluded from coverage and run as a separate CI job via `nox -s property_tests`. Two tests are expected to fail until pypa#1140 and pypa#1141 are merged (exclusive comparison exclusion rules).
notatallshaw
added a commit
to notatallshaw/packaging
that referenced
this pull request
Apr 2, 2026
325 Hypothesis tests that verify algebraic invariants from the version specifiers specification. Each test class quotes the spec paragraph it validates. Tests are excluded from coverage and run as a separate CI job via `nox -s property_tests`. Two tests are expected to fail until pypa#1140 and pypa#1141 are merged (exclusive comparison exclusion rules).
notatallshaw
added a commit
to notatallshaw/packaging
that referenced
this pull request
Apr 2, 2026
325 Hypothesis tests that verify algebraic invariants from the version specifiers specification. Each test class quotes the spec paragraph it validates. Tests are excluded from coverage and run as a separate CI job via `nox -s property_tests`. Two tests are expected to fail until pypa#1140 and pypa#1141 are merged (exclusive comparison exclusion rules).
notatallshaw
added a commit
to notatallshaw/packaging
that referenced
this pull request
Apr 2, 2026
325 Hypothesis tests that verify algebraic invariants from the version specifiers specification. Each test class quotes the spec paragraph it validates. Tests are excluded from coverage and run as a separate CI job via `nox -s property_tests`. Two tests are expected to fail until pypa#1140 and pypa#1141 are merged (exclusive comparison exclusion rules).
notatallshaw
added a commit
to notatallshaw/packaging
that referenced
this pull request
Apr 2, 2026
325 Hypothesis tests that verify algebraic invariants from the version specifiers specification. Each test class quotes the spec paragraph it validates. Tests are excluded from coverage and run as a separate CI job via `nox -s property_tests`. Two tests are expected to fail until pypa#1140 and pypa#1141 are merged (exclusive comparison exclusion rules).
Member
Author
|
The tests I'm proposing in #1144 show that this fixes an edge case where the current behavior breaks the monotonic invariant, that given versions |
henryiii
approved these changes
Apr 4, 2026
# Conflicts: # tests/test_specifiers.py
f0c6483 to
48d948a
Compare
This was referenced Apr 13, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Similar to #1140 (the
<counterpart), found while looking at edge cases for #1119 and #1120.The spec says:
The current code uses
_base_versionto check this, which stripspre,post,dev, andlocalfrom both sides. This is too broad when V is a pre-release or dev release, because it treats post-releases of the base release as post-releases of V.For example,
>1.0.dev1accepts1.0but rejects1.0.post0:1.0.post0is a post-release of1.0, not of1.0.dev1. Since1.0itself is accepted, excluding1.0.post0is incoherent.The fix replaces
_base_version(prospective) == _base_version(spec)with_post_base(prospective) == spec, which checks whether the prospective version is actually a post-release of the spec version rather than just sharing its release segment.