Skip to content

PEP 561: Clarify the rules for extension only packages #2318

Closed

Description

@AWhetter

PEP-0561 does not mention extension packages, packages that consist of just an .so file. Given that PEP-484 mentions extension modules as a use case for stub files, should PEP-561 make it more clear what the ideal layout of an extension only package is?
It appears to be valid to have a package structure like the following:

.../site-packages/
    mypackage/
        __init__.pyi
        py.typed
    mypackage.cpython-37m-x86_64-linux-gnu.so

Activity

  1. AA-Turner commented on Feb 9, 2022

    @AA-Turner
    Member

    We rarely update Accepted PEPs -- this might be better to add to typing documentation. Pinging @ethanhs as author and @JelleZijlstra as a typing ecosytem expert for where the best place to put this information would be (CPython typing docs, python/typing docs, etc).

    A

  2. emmatyping commented on Feb 9, 2022

    @emmatyping
    Member

    PEP 561 does say

    This PEP does not support distributing typing information as part of module-only distributions .;.. The single-file module should be refactored into a package and indicate that the package supports typing as described above.

    So I think your layout is correct. I think this could be clarified in the python/typing docs.

  3. JelleZijlstra commented on Feb 9, 2022

    @JelleZijlstra
    Member

    Yes, an issue on the PEPs repo isn't the right place to discuss this. I think we can put it in https://typing.readthedocs.io/en/latest/ (still under construction), so feel free to open an issue over at github.com/python/typing.

  4. AWhetter commented on Feb 10, 2022

    @AWhetter
    Author

    I've opened an issue with typing, which is linked above. Thank you for the help everyone!

  5. changed the title [-]PEP-561: Clarify the rules for extension only packages.[/-] [+]PEP 561: Clarify the rules for extension only packages.[/+] on Feb 15, 2022
  6. changed the title [-]PEP 561: Clarify the rules for extension only packages.[/-] [+]PEP 561: Clarify the rules for extension only packages[/+] on Feb 15, 2022
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions