Conversation
django-stubs needs to be able to add in additional dependencies to modules and is currently using monkeypatching to do it. That is 1) not great and 2) breaks under mypyc. Add a hook to support generating additional dependencies from a plugin.
Closed
JukkaL
reviewed
Mar 28, 2019
Collaborator
JukkaL
left a comment
There was a problem hiding this comment.
I left just a few minor comments.
This is good to merge, but let's wait a bit to see if this helps with the django plugin.
Contributor
|
I've checked in https://github.com/mkurnikov/django-stubs/pull/60, all tests pass with new hook and disabled monkeypatches |
JukkaL
pushed a commit
that referenced
this pull request
Mar 29, 2019
django-stubs needs to be able to add in additional dependencies to modules and is currently using monkeypatching to do it. That is 1) not great and 2) breaks under mypyc. Add a hook to support generating additional dependencies from a plugin.
ilevkivskyi
reviewed
Apr 2, 2019
|
|
||
| Priorities are defined in mypy.build (but maybe shouldn't be). | ||
| 10 is a good choice for priority. | ||
| """ |
Member
There was a problem hiding this comment.
This (+ an example) should be also added to mypy/docs/source/extending_mypy.rst.
@msullivan Will you have time to make a PR? I suppose this will be announced in the release blog post, it would be great to have some docs to link to.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
django-stubs needs to be able to add in additional dependencies to
modules and is currently using monkeypatching to do it.
That is 1) not great and 2) breaks under mypyc.
Add a hook to support generating additional dependencies from a plugin.
One thing I'm unsure about with this PR is the handling of priorities. I'm not sure that being able to specify priorities is necessary, but I am reluctant to leave them out of the API and then need to either have two hooks or a breaking change when it turns out that something does need them. The priority constants are all defined in mypy.build, which plugins probably shouldn't be importing, but moving them to a new file seems like overkill for a super marginal plugin use case.
This should allow a fix for https://github.com/mkurnikov/django-stubs/issues/48. @mkurnikov could you try updating django-stubs to work with this PR so that we can validate it and cherry-pick it for the release?