-
-
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
Support invoking mypy from setuptools #994
Conversation
0755e5b
to
333d0ad
Compare
@@ -203,6 +203,9 @@ def default_data_dir(bin_dir: str) -> str: | |||
# TODO fix this logic | |||
if not bin_dir: | |||
# Default to directory containing this file's parent. | |||
if os.path.dirname(os.path.dirname(__file__)).endswith('.egg'): | |||
return os.path.join(os.path.dirname(os.path.dirname(__file__)), | |||
'lib', 'mypy') | |||
return os.path.dirname(os.path.dirname(__file__)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's factor out os.path.dirname(os.path.dirname(__file__))
into a local variable so we don't have to repeat it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Thanks for sending this in! Will be glad to have this feature. Made some comments. |
333d0ad
to
848654a
Compare
Thanks for the feedback @gnprice! I dropped comments in to explain some of the less-obvious things, LMK if that makes sense. |
By default, this will typecheck all of the package modules. We still need to figure out how to handle third-party modules. Passing in `--mypy-args="--use-python-path"` will also include any dependent modules, but nearly all of them fail to typecheck. This will fix python#992
848654a
to
5cba9aa
Compare
Sorry for such a basic question, but what exactly is the use case that this solves? I actually don't have context on this issue. (I expect that this is useful thing once I understand this a little better.) |
@JukkaL |
Ok, sounds good -- thanks! I just rebased and merged your PR. It would be really nice if you could contribute a documentation update for this :-) (see |
Thanks @JukkaL! I'll update docs as well. |
By default, this will typecheck all of the package modules. We still need to figure out how to handle third-party modules. Passing in `--mypy-args="--use-python-path"` will also include any dependent modules, but nearly all of them fail to typecheck. This will fix #992
By default, this will typecheck all of the package modules.
We still need to figure out how to handle third-party modules.
Passing in
--mypy-args="--use-python-path"
will also includeany dependent modules, but nearly all of them fail to typecheck.
This will fix #992