Skip to content

Conversation

@subhajitsaha01
Copy link
Contributor

There are two changes made to the value parameters of the prereleases setter methods of the Specifier and SpecifierSet class, since both of them are accepting None values at runtime from the unit tests. The links to the unit tests are as follows where they are accepting None values as arguments to the value parameter even though it is statically annotated as bool.

@pytest.mark.parametrize(

@pytest.mark.parametrize(

@subhajitsaha01
Copy link
Contributor Author

Hi Maintainers, is there anything I could do to get this PR resolved

@notatallshaw
Copy link
Member

I'll take a look, I agree that given prelease as None is semantically significant it should probably be accepted.

Copy link
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me since we have unit tests ensuring it works already.

Honestly I feel this is not a useful thing in the first place, but the type hints should reflect how it’s designed to work at runtime.

@notatallshaw
Copy link
Member

It would be much nicer if the contract for Specifiers had no ability to mutate them after they are created, but I don't know the process or if it's worth the effort of deprecating?

It would also be good if the tests were type hinted and type checked to catch this kind of issue, I may work on that soon.

@notatallshaw notatallshaw merged commit 3f83dea into pypa:main Oct 29, 2025
39 checks passed
@notatallshaw
Copy link
Member

@subhajitsaha01 thanks for your PR to packaging!

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.

3 participants