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

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

Closed
AWhetter opened this issue Feb 9, 2022 · 4 comments
Closed

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

AWhetter opened this issue Feb 9, 2022 · 4 comments

Comments

@AWhetter
Copy link

AWhetter commented Feb 9, 2022

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
@AA-Turner
Copy link
Member

AA-Turner commented Feb 9, 2022

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

@ethanhs
Copy link
Contributor

ethanhs commented Feb 9, 2022

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.

@JelleZijlstra
Copy link
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.

@AWhetter
Copy link
Author

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

@CAM-Gerlach CAM-Gerlach changed the title PEP-561: Clarify the rules for extension only packages. PEP 561: Clarify the rules for extension only packages. Feb 15, 2022
@CAM-Gerlach CAM-Gerlach changed the title PEP 561: Clarify the rules for extension only packages. PEP 561: Clarify the rules for extension only packages Feb 15, 2022
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

No branches or pull requests

4 participants