@@ -42,9 +42,10 @@ Making PEP 561 compatible packages
42
42
43
43
PEP 561 notes three main ways to distribute type information. The first is a
44
44
package that has only inline type annotations in the code itself. The second is
45
- a package that ships stub files with type information alongside the runtime
46
- code. The third method, also known as a "stub only package" is a package that
47
- ships type information for a package separately as stub files.
45
+ a package that ships :ref: `stub files <stub-files >` with type information
46
+ alongside the runtime code. The third method, also known as a "stub only
47
+ package" is a package that ships type information for a package separately as
48
+ stub files.
48
49
49
50
If you would like to publish a library package to a package repository (e.g.
50
51
PyPI) for either internal or external use in type checking, packages that
@@ -105,8 +106,9 @@ the setup.py might look like:
105
106
packages = [" package_b" ]
106
107
)
107
108
108
- In this example, both ``lib.py `` and ``lib.pyi `` exist. At runtime, the Python
109
- interpreter will use ``lib.py ``, but mypy will use ``lib.pyi `` instead.
109
+ In this example, both ``lib.py `` and the ``lib.pyi `` stub file exist. At
110
+ runtime, the Python interpreter will use ``lib.py ``, but mypy will use
111
+ ``lib.pyi `` instead.
110
112
111
113
If the package is stub-only (not imported at runtime), the package should have
112
114
a prefix of the runtime package name and a suffix of ``-stubs ``.
0 commit comments