Skip to content
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 (feature request) #5611

Closed
eric-wieser opened this issue Sep 13, 2018 · 1 comment
Closed

Support invoking mypy from setuptools (feature request) #5611

eric-wieser opened this issue Sep 13, 2018 · 1 comment

Comments

@eric-wieser
Copy link
Contributor

eric-wieser commented Sep 13, 2018

It would be great if mypy (or some external tool, mypy-setuptools or something) could provide an easy way to run mypy against just the files in a distribution.

There was some work done on this in #994 (to close #992) by @rowillia, but it was reverted without comment in 964a175 by @JukkaL.

Given the python-3.6+ dependence of mypy, and the fact it can check older python versions, I think it would make sense for this setuptools plugin to ultimately just invoke subprocess.check_call(['mypy', ...]), which would allow it to be used on python2 projects too. For this reason, it would make sense for it not to live in the mypy repo, as it would need to be installable within python instances where mypy is not.

One difficulty here is how exactly to test only the files in a distribution. Some options are:

  • Running against the source - this doesn't respect the package_dir argument in setuptools.
  • Collecting distribution.modules and distribution.packages - this will end up checking the full contents of any namespace package partially provided by this distribution
  • Inspecting an egg or wheel somehow, and letting mypy take one of these as an argument?
@msullivan
Copy link
Collaborator

I think this would need to be an external tool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants