Skip to content
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

socket: rework to match docs more closely, improve accuracy on linux #11219

Merged
merged 7 commits into from
Jan 4, 2024

Conversation

hauntsaninja
Copy link
Collaborator

@hauntsaninja hauntsaninja commented Jan 2, 2024

Match the documentation more closely

Fixes some of #8101 , in particular I no longer see any missing constants on the Linux machines I have access to

Match the documentation more closely

Fixes some of python#8101
@hauntsaninja hauntsaninja changed the title [socket] rework socket: rework to match docs more closely, improve accuracy on linux Jan 2, 2024
@hauntsaninja hauntsaninja marked this pull request as ready for review January 2, 2024 10:09

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Jan 2, 2024

Diff from mypy_primer, showing the effect of this PR on open source code:

trio (https://github.com/python-trio/trio)
+ src/trio/_socket.py:376: error: Unused "type: ignore" comment  [unused-ignore]

@hauntsaninja
Copy link
Collaborator Author

(This PR might be a little tricky to review, but I'm fairly confident. We check socket with stubtest quite tightly on macOS and Windows, and I've manually confirmed we fix stuff without regressions on Linux. Primer is also good)

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

LGTM, when skimming over it and going by your comment and the primer output. Please merge in a day or two, unless someone else wants to do a deep review.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Haven't done a proper review here (and I can't without access to a Linux machine :), but this all looks highly plausible, and I trust your judgement + stubtest!

How many stubtest errors would there be in CI if we removed the blanket allowlist entries for linux now, do you know? Is it low enough that we could remove the blanket entries and just enumerate all the errors? (Doesn't need to be done in this PR, I'm just curious!)

@hauntsaninja hauntsaninja merged commit 2cafcc9 into python:main Jan 4, 2024
68 checks passed
@hauntsaninja hauntsaninja deleted the socket-more branch January 4, 2024 22:36
@hauntsaninja
Copy link
Collaborator Author

Yes, just enumerating all the errors would be great. There's still quite a few errors... this PR only eliminates ones that are certainly errors, where we're missing things in the stubs.

The cases where we're missing things at runtime are trickier, because I don't know whether that's just the Linux machines I have access to or if it's real. So I might try to whittle down what I can, and when I give up I'll just allowlist how many ever are left.

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