Skip to content

[WIP] PEP 484: use package_data to distribute stubs #67

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions pep-0484.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1611,22 +1611,15 @@ Note that if the user decides to use the "latest" available source
package, using the "latest" stub files should generally also work if
they're updated often.

Third-party stub packages can use any location for stub storage. Type
checkers should search for them using PYTHONPATH. A default fallback
directory that is always checked is ``shared/typehints/python3.5/`` (or
3.6, etc.). Since there can only be one package installed for a given
Python version per environment, no additional versioning is performed
under that directory (just like bare directory installs by ``pip`` in
site-packages). Stub file package authors might use the following
snippet in ``setup.py``::
Third-party stub packages can use any location for stub storage. Type
checkers should search for them using PYTHONPATH. Stub file package
authors might use the following snippet in ``setup.py``::

...
data_files=[
(
'shared/typehints/python{}.{}'.format(*sys.version_info[:2]),
pathlib.Path(SRC_PATH).glob('**/*.pyi'),
),
],
package_data={
SRC_PATH: [str(p.relative_to(SRC_PATH))
for p in pathlib.Path(SRC_PATH).glob('**/*.pyi')],
},
...

The Typeshed Repo
Expand Down