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

Add new or missing socket constants on linux #8101

Open
hauntsaninja opened this issue Jun 19, 2022 · 2 comments
Open

Add new or missing socket constants on linux #8101

hauntsaninja opened this issue Jun 19, 2022 · 2 comments
Labels
help wanted An actionable problem of low to medium complexity where a PR would be very welcome stubs: incomplete Annotations or sub-modules missing from an existing package or module

Comments

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Jun 19, 2022

We currently silence many errors from socket constants in stubtest, because the availability of some constants cannot be expressed in the type system (and probably also because historically we weren't always the best at specifying all platform differences exactly). However, this means we don't notice new additions.

On macOS, with python3.10:

λ python3.10 -m mypy.stubtest --custom-typeshed-dir ~/dev/typeshed socket --concise | grep 'is not present in stub'
socket.CAPI is not present in stub
socket.IP_RECVTOS is not present in stub
socket.PF_SYSTEM is not present in stub
socket.SYSPROTO_CONTROL is not present in stub
socket.TCP_KEEPALIVE is not present in stub
socket.TCP_NOTSENT_LOWAT is not present in stub
[...]

I can add PRs for these / check this for Linux. Filing this issue mainly as a reminder for myself to do so. Would be good if someone wants to take another look at Windows.

@AlexWaygood
Copy link
Member

AlexWaygood commented Jun 19, 2022

I'm in favour of adding these, and of getting some more coverage from stubtest. I can take a look on Windows to see what needs adding.

Missing socket constants have also been requested a few times by users:

@AlexWaygood AlexWaygood added the stubs: incomplete Annotations or sub-modules missing from an existing package or module label Jul 13, 2022
@AlexWaygood
Copy link
Member

Stubtest is enabled for all the socket constants on Windows and macOS these days, but we still have two very broad allowlist entries on linux:


@AlexWaygood AlexWaygood added the help wanted An actionable problem of low to medium complexity where a PR would be very welcome label Nov 1, 2023
@AlexWaygood AlexWaygood changed the title Add new or missing socket constants Nov 18, 2023
hauntsaninja added a commit to hauntsaninja/typeshed that referenced this issue Jan 2, 2024
Match the documentation more closely

Fixes some of python#8101
hauntsaninja added a commit that referenced this issue Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted An actionable problem of low to medium complexity where a PR would be very welcome stubs: incomplete Annotations or sub-modules missing from an existing package or module
2 participants