-
Notifications
You must be signed in to change notification settings - Fork 267
SpecifierSet.filter should allow pre-release when no final version matches specifiers, same as Specifier.filter #872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
6234741
to
4ed82fd
Compare
FWIW, I prefer writing a method to return early, and not have large else blocks, but this PR focuses on fixing the bug without refactoring or writing code that conflicts with the existing style. |
ad6d156
to
7865467
Compare
I've updated the tests of both |
6a04147
to
8bc9a3b
Compare
This is ready for review / merge. FYI the relevant line in the spec is:
|
Fixes #856
This brings
SpecifierSet
in-line withSpecifier
and the spec. I believe this behavior was incorrectly created from #29, which determined ahead of filtering whether to allow pre-releases or not, but did not introduce a fallback when only pre-releases matched the specifiers.Interestingly, even though the old behavior is listed in the doc string there were previously no tests for this behavior:
The docstring has been updated and the equivalent tests are added.