Closed the-13th-letter closed 2 months ago
Thanks for bug report @the-13th-letter :slightly_smiling_face: I was able to replicate. Will push a fix asap :smile:
Should be fixed in v0.42.2 :slightly_smiling_face:
That was really fast. Thank you kindly.
Description of the bug
When importing modules within a package and using an alias, Griffe incorrectly determines the target of that alias to be the top-level package, not the leaf module.
To Reproduce
Note here that the alias
parse
is resolving tourllib
. It should resolve tourllib.parse
instead.Here too the alias
ET
is resolving toxml
instead of toxml.etree.ElementTree
.Full traceback
(Included above.)
Expected behavior
The aliases should resolve correctly.
Environment information
(Griffe was installed from PyPI.)
Additional context
I originally encountered this issue while documenting (with
mkdocs
,mkdocstrings
andmkdocs-autorefs
) a modulexxx.yyy.B
that was importingxxx.yyy.A
asA
.mkdocstrings
failed to resolve/expand references toA.SomeClass
asxxx.yyy.A.SomeClass
, and instead linked to the (non-existing)xxx.SomeClass
instead.