-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specifying which Python interpreter stubgen should use #965
Comments
This came to mind again today, in the context not of stubgen but of mypy itself. Someone on IRC had trouble getting mypy to find the code they were type-checking, because they were depending on a virtualenv and so Would it make sense for the same |
Good point -- retitled. |
This makes it possible to use inline types from installed packages and use installed stubs according to PEP 561. Adds `--python-executable` and `--no-site-packages` command-line options. PEP 561: https://www.python.org/dev/peps/pep-0561/ Fixes #2625, #1190, #965.
#4693 added this for mypy. |
stubgen gained support for this at some point in the last four years |
Add a
-p <path-to-python>
option to stubgen that will replace the--py2
option. Mypy would use this interpreter for these things:As pointed out by @gnprice, the current behavior of using the current Python interpreter doesn't make sense when using a virtualenv, as the virtualenv would have mypy dependencies instead of the (third party) modules targeted by stubgen. This would also allow using an arbitrary Python 2 virtualenv.
We may also need a way of specifying PYTHONPATH for the target interpreter separately from the PYTHONPATH used to run mypy.
The text was updated successfully, but these errors were encountered: