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
Describe the bug
If there is a file with name which contains more than one dot (for example gunicorn.conf.py)
GriffeLoader.load_module fails with KeyError here
...
File "../python3.10/site-packages/griffe/loader.py", line 407, in _load_submodule
member_parent[subparts[-1]] = self._load_module(
File "../python3.10/site-packages/griffe/mixins.py", line 85, in __setitem__
self.members[parts[0]][parts[1:]] = value # type: ignore[attr-defined]
KeyError: 'gunicorn'
Traceback (most recent call last):
File "<string>", line 1, in<module>
File "/Users/m/.local/share/virtualenvs/griffe-bug-j_gvc5DW/lib/python3.10/site-packages/griffe/loader.py", line 149, in load_module
top_module = self._load_package(package, submodules=submodules)
File "/Users/m/.local/share/virtualenvs/griffe-bug-j_gvc5DW/lib/python3.10/site-packages/griffe/loader.py", line 346, in _load_package
top_module = self._load_module(package.name, package.path, submodules=submodules)
File "/Users/m/.local/share/virtualenvs/griffe-bug-j_gvc5DW/lib/python3.10/site-packages/griffe/loader.py", line 362, in _load_module
return self._load_module_path(module_name, module_path, submodules, parent)
File "/Users/m/.local/share/virtualenvs/griffe-bug-j_gvc5DW/lib/python3.10/site-packages/griffe/loader.py", line 390, in _load_module_path
self._load_submodules(module)
File "/Users/m/.local/share/virtualenvs/griffe-bug-j_gvc5DW/lib/python3.10/site-packages/griffe/loader.py", line 395, in _load_submodules
self._load_submodule(module, subparts, subpath)
File "/Users/m/.local/share/virtualenvs/griffe-bug-j_gvc5DW/lib/python3.10/site-packages/griffe/loader.py", line 406, in _load_submodule
member_parent[subparts[-1]] = self._load_module(
File "/Users/m/.local/share/virtualenvs/griffe-bug-j_gvc5DW/lib/python3.10/site-packages/griffe/mixins.py", line 83, in __setitem__
self.members[parts[0]][parts[1:]] = value # type: ignore[attr-defined]
KeyError: 'some'
Expected behavior
Name for .py files with more then one dot symbol works
System (please complete the following information):
griffe version: 0.22.0
Python version: 3.10.1
OS: [Mac]
Additional context
Encountered this behavior using mkdocs with mkdocstrings and python handler to generate
documentation for project with fastapi api's with a lot of gunicorn.conf.py
The text was updated successfully, but these errors were encountered:
Describe the bug
If there is a file with name which contains more than one dot (for example
gunicorn.conf.py
)GriffeLoader.load_module fails with KeyError here
https://github.com/mkdocstrings/griffe/blob/master/src/griffe/mixins.py#L82-L83
To Reproduce
Steps to reproduce the behavior:
python -c "import griffe.loader;griffe.loader.GriffeLoader().load_module('test')"
Expected behavior
Name for .py files with more then one dot symbol works
System (please complete the following information):
griffe
version: 0.22.0Additional context
Encountered this behavior using mkdocs with mkdocstrings and python handler to generate
documentation for project with fastapi api's with a lot of
gunicorn.conf.py
The text was updated successfully, but these errors were encountered: