Skip to content

Add new or missing socket constants on linux #8101

Closed

Description

@hauntsaninja

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.

Activity

  1. AlexWaygood commented on Jun 19, 2022

    @AlexWaygood
    Member

    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:

  2. added
    stubs: incompleteAnnotations or sub-modules missing from an existing package or module
    on Jul 13, 2022
  3. AlexWaygood commented on Nov 1, 2023

    @AlexWaygood
    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:


  4. added
    help wantedAn actionable problem of low to medium complexity where a PR would be very welcome
    on Nov 1, 2023
  5. changed the title [-]Add new or missing socket constants[/-] [+]Add new or missing socket constants on linux[/+] on Nov 18, 2023
  6. tungol commented on Nov 26, 2024

    @tungol
    Contributor

    I removed the two broad linux allowlist entries as part of #13044 . This issue can probably be closed now.

  7. AlexWaygood commented on Nov 26, 2024

    @AlexWaygood
    Member

    Fantastic, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedAn actionable problem of low to medium complexity where a PR would be very welcomestubs: incompleteAnnotations or sub-modules missing from an existing package or module

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions