@@ -131,9 +131,10 @@ type information, it is preferred that the ``*.pyi`` stubs are alongside the
131
131
corresponding ``*.py `` files. However, the stubs can also be put in a separate
132
132
package and distributed separately. Third parties can also find this method
133
133
useful if they wish to distribute stub files. The name of the stub package
134
- MUST follow the scheme ``foopkg_stubs `` for type stubs for the package named
135
- ``foopkg ``. The normal resolution order of checking ``*.pyi `` before ``*.py ``
136
- will be maintained.
134
+ MUST follow the scheme ``foopkg-stubs `` for type stubs for the package named
135
+ ``foopkg ``. Note that for stub only packages adding a py.typed marker is not
136
+ needed since the name ``*-stubs `` is enough to indicate it is a source of typing
137
+ information.
137
138
138
139
Third parties seeking to distribute stub files are encouraged to contact the
139
140
maintainer of the package about distribution alongside the package. If the
@@ -143,9 +144,13 @@ inline, then a third party stub only package can be created.
143
144
In addition, stub-only distributions SHOULD indicate which version(s)
144
145
of the runtime package are supported by indicating the runtime distribution's
145
146
version(s) through normal dependency data. For example, the
146
- stub package ``flyingcircus_stubs `` can indicate the versions of the
147
+ stub package ``flyingcircus-stubs `` can indicate the versions of the
147
148
runtime ``flyingcircus `` distribution it supports through ``install_requires ``
148
- in distutils-based tools, or the equivalent in other packaging tools.
149
+ in distutils-based tools, or the equivalent in other packaging tools. Note that
150
+ in pip 9.0, if you update ``flyingcircus-stubs ``, it will update
151
+ ``flyingcircus ``. In pip 9.0, you can use the
152
+ ``--upgrade-strategy=only-if-needed `` flag. In pip 10.0 this is the default
153
+ behavior.
149
154
150
155
151
156
Type Checker Module Resolution Order
@@ -161,7 +166,7 @@ resolve modules containing type information:
161
166
stubs to use, and patch broken stubs/inline types from packages.
162
167
163
168
3. Stub packages - these packages can supersede the installed packages.
164
- They can be found at ``foopkg_stubs `` for package ``foopkg ``.
169
+ They can be found at ``foopkg-stubs `` for package ``foopkg ``.
165
170
166
171
4. Inline packages - if there is nothing overriding the installed
167
172
package, and it opts into type checking, inline types SHOULD be used.
@@ -176,6 +181,9 @@ of that Python version. This can be queried e.g.
176
181
that the type checker allow for the user to point to a particular Python
177
182
binary, in case it is not in the path.
178
183
184
+ The normal resolution order of checking ``*.pyi `` before ``*.py ``
185
+ will be maintained.
186
+
179
187
180
188
Implementation
181
189
==============
@@ -198,6 +206,12 @@ Smith, and Guido van Rossum.
198
206
Version History
199
207
===============
200
208
209
+ * 2018-02-02
210
+
211
+ * Change stub only package suffix to be -stubs not _stubs.
212
+ * Note that py.typed is not needed for stub only packages.
213
+ * Add note about pip and upgrading stub packages.
214
+
201
215
* 2017-11-12
202
216
203
217
* Rewritten to use existing tooling only
0 commit comments