python / python/typing

Clarify the method of distribution for stub files with extension only packages.

Open
#1,061 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

topic: documentation
Dominant language
Python
Stars
1.8k
Forks
302
Avg merge
23h
Merged PRs (30d)
8

Description

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, could the typing documentation 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

@ethanhs suggested in https://github.com/python/peps/issues/2318 that this is the correct way of doing things.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the PEP-0561 and PEP-484 references in the issue, then review the typing documentation for package distribution and stub files. Clarify whether the shown extension-only package layout is supported and document the ideal layout, including the placement of init.pyi and py.typed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.