forked from bazel-contrib/bazel-mypy-integration
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Thomas Lam <[email protected]>
- Loading branch information
Showing
4 changed files
with
26 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
|
||
|
||
import sys | ||
import mypy.modulefinder | ||
from mypy.main import main | ||
|
||
if __name__ == '__main__': | ||
additional_package_paths = [p for p in sys.path if 'pypi__' in p] | ||
original_get_site_packages_dirs = mypy.modulefinder.get_site_packages_dirs | ||
|
||
def get_site_packages_dirs(*args, **kwargs): | ||
egg_dirs, site_packages = original_get_site_packages_dirs(*args, **kwargs) | ||
site_packages += tuple(additional_package_paths) | ||
return egg_dirs, site_packages | ||
|
||
mypy.modulefinder.get_site_packages_dirs = get_site_packages_dirs | ||
main(None, sys.stdout, sys.stderr) |