mypy
mypy copied to clipboard
stubgen: multiple fixes to the generated imports
- Fix handling of nested imports. Instead of assuming that a name is imported from a top level package, look in the imports for this name starting from the parent submodule up until the import is found
- Fix "from imports" getting reexported unnecessarily
- Fix import sorting when having import aliases
Fixes #13661 Fixes #7006