File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
lib_platform/3rd_party_stubs Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ put 3rd party stubs in this directory needed to pass mypy on travis.
2+
3+ in the travis.yml the MYPYPATH is set to this directory.
4+
5+ for local testing, put the *.pyi Files into another central directory and set the mypy path accordingly.
6+ the reason for that is, that a certain *.pyi have to be only found once by mypy, otherwise it will throw an error.
7+
8+ lets say, we have an external module "external_test" and we created an "external_test.pyi" stub file.
9+
10+ the module "external_test" is used in project_a, and project_b, and package_a imports package_b
11+
12+
13+ -- projects -- stub_directory -- external_test.pyi
14+ |
15+ -- project_A ------- package_a_dir --- 3rd_party_stubs --- external_test.pyi
16+ |
17+ -- project_B ------- package_b_dir --- 3rd_party_stubs --- external_test.pyi
18+
19+
20+ for travis test of project_A we need to set the MYPYPATH to .../projects/project_A/package_a_dir/3rd_party_stubs
21+
22+ for local tests, we need to set the MYPYPATH to .../projects/stub_directory , not to find external_test.pyi twice.
You can’t perform that action at this time.
0 commit comments