-
Notifications
You must be signed in to change notification settings - Fork 169
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
Resolve import conflicts while generating stubs #302
base: main
Are you sure you want to change the base?
Conversation
aa46c88
to
404e846
Compare
Thanks for working on this! May take me a bit to find the time to review it, sorry. |
Looks like this does need Black run over it, too. |
I'm a bit confused. If I run
What's the expectation here? |
The CI only runs black/isort on files within the |
404e846
to
9b7c3c2
Compare
Ah, thanks for the hint. It should be fixed now! I saw Maybe add |
It tries to solve #209. I don't know if this is a good solution but it solved the problem in my case. Look at
test_multiple_imported_symbols_same_name()
to get an idea of what this does.The basic idea it to do rendering of a module stub in two passes.
ModuleStub.render()
first callsImportBlockStub.resolve_import_conflicts()
, which generates a set of import renames, if necessary. This is stored in an instance ofRenderContext
. Then this context is passed to all methods relating to rendering the stubs which adjust imports and usages of affected symbols accordingly.IDK, tell me what you think.