You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Automatically add a py.typed file alongside stubs (#98)
* Automatically add py.typed file to generated stubs
Remove docstub-stubs in CI before regenerating them. This tests that
the `py.typed` is actually regenerated by docstub.
* Add distribution section and mention py.typed in docs
* Avoid early exit in assert-unchanged.sh
and also show git status as a summary on failure.
* Add missing py.typed to example_pkg-stubs
* Also remove examples/example_pkg-stubs before regeneration
* Disable pip's progress bar during installation
Copy file name to clipboardExpand all lines: docs/introduction.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -204,3 +204,13 @@ class Foo:
204
204
205
205
If all of the above does not solve your issue, you can fall back to writing a correct stub file by hand.
206
206
Docstub will preserve this file and integrated it with other automatically generated stubs.
207
+
208
+
209
+
## Distributing stub files
210
+
211
+
The simplest option is to include generated stubs in the [distribution package](https://packaging.python.org/en/latest/glossary/#term-Distribution-Package) alongside your source files.
212
+
For more complex setups please consult the official guide on [Packaging Type Information](https://typing.python.org/en/latest/spec/distributing.html#packaging-type-information).
213
+
214
+
As required, Docstub will automatically place an empty `py.typed` file in the root directory of generated stubs to support type checking.
215
+
If you need to [mark your stubs as partial](https://typing.python.org/en/latest/spec/distributing.html#partial-stub-packages), create the `py.typed` file beforehand.
0 commit comments