You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then running stubgen test.py whilst in somefolder generates an out/test.pyi file with contents:
# out/test.pyi# Stubs for test (Python 3)## NOTE: This dynamically typed stub was automatically generated by stubgen.importfoo_mod.bar_modasbar_modimportfoo_mod.bar_modclassbaz(foo_mod.foo, bar_mod.bar): ...
Note how it says foo_mod.bar_mod, rather than just foo_mod as expected.
This issue generalises to subsubpackages as well (and presumably further). That is,
Tested on Windows and Unix, with both mypy version 0.701 and the latest on the GitHub master branch, with Python 3.6.6. (At least, that's the version of Python which is bound to python on the command line, so presumably that's what stubgen is using?)
* 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 rexported unnecessarily
* Fix import sorting when having import aliases
Fixespython#13661Fixespython#7006
* 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#13661Fixes#7006
There's a bug with the import statements generated in .pyi files.
Consider the folder structure:
with file contents:
Then running
stubgen test.py
whilst insomefolder
generates anout/test.pyi
file with contents:Note how it says
foo_mod.bar_mod
, rather than justfoo_mod
as expected.This issue generalises to subsubpackages as well (and presumably further). That is,
generates
Tested on Windows and Unix, with both mypy version 0.701 and the latest on the GitHub master branch, with Python 3.6.6. (At least, that's the version of Python which is bound to
python
on the command line, so presumably that's what stubgen is using?)Possibly related? #6831
The text was updated successfully, but these errors were encountered: