-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
We can/should partition more tools by config (black, flake8, etc...) #17739
Comments
I don't think this is unique to I'm going to change the title. |
Just wanted to describe my problem to help make sure the proposed solution covers that use case. The one semi more specific part of this I can foresee is that the different configs will also need different |
In the |
Happy to test things out, but that might be an issue. Our django project is quite large and brings in ~150 3rd party deps. Building the pex for it is painfully slow and is the primary reason a large chunk of our developers (the ones who work on the django code) aren't using pants. Making people who are not working on the django code build that pex every time they want to |
So how we do |
The mypy_django_plugin requires the entire django project be included in the mypy venv along with the plugin itself. It does a |
OH yeah, that's a huge issue (albeit separate 😂 ) |
Want me to be file another issue? |
yes please! |
Exactly this. Does anyone have a workaround? |
Is your feature request related to a problem? Please describe.
Originally discussed on slack: https://pantsbuild.slack.com/archives/C046T6T9U/p1670281834539229
A large (and knotted) portion of my monorepo is a django project. We would like start using pants to do mypy type checking on it and use mypy_django_plugin. The problem is mypy config plugin installation applies everywhere and installing this plugin requires that we add our entire django project as a mypy dependency, even when checking a file that is not part of the django code.
Having the django plugin is not absolutely required to run mypy on this code, but it makes the user experience significantly better and would likely speed up fixing all the current errors.
Mypy doesn’t have support for only enabling a plugin for a subset files/roots. There is only one configuration file ($ROOT/mypy.ini) and it doesn’t support hierarchical config like pytest’s conftest.py.
To enable the django plugin in mypy you need to make the project settings module and all transitive deps (the entire django app) a mypy tool resolve dependency. The plugin throws an error if the project can’t be
django.setup()
.Describe the solution you'd like
What I need is a way in pants to specify more than one mypy config file and then specify that certain targets should use the non default one. Apparently scalafmt already somewhat does this?
Related: #17328
The text was updated successfully, but these errors were encountered: