File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ How to add new types to the local Typeshed
2
+ ------------------------------------------
3
+
4
+
5
+ If when running ``make mypy `` you receive errors about modules that can't be
6
+ found you may need to add type stubs for new modules to the ``typeshed/ ``
7
+ directory.
8
+
9
+ ::
10
+
11
+ mkdir out
12
+ stubgen --py2 module_name
13
+ mv out/module_name/* typeshed/2.7/
14
+ make mypy
15
+
16
+ Note: the module name is not always the name of the PyPI package
17
+ (``CacheControl `` vs ``cachecontrol ``).
18
+
19
+ Stubs are just that, you will still need to annotate whichever functions you
20
+ call.
21
+
22
+ Oftentimes it is simpler to comment out imports in the ``.pyi `` stubs that are
23
+ not needed yet. The goal is represent the public API, or at least the part we
24
+ use.
You can’t perform that action at this time.
0 commit comments