Describe the bug
During my CI a .venv folder is created locally to run tests. The presence of this .venv folder then breaks the docs generation.
When I attempt to run mkdocs build when the .venv folder is present, I get the following error message:
ERROR - Error reading page '<redacted filepath>/<redacted filename>.md': ''
Traceback (most recent call last):
File "/Users/rsenseman/Development/<redacted project name>/docs/.venv/lib/python3.8/site-packages/griffe/loader.py", line 550, in _get_or_create_parent_module
parent_module = parent_module[parent_part]
File "/Users/rsenseman/Development/<redacted project name>/docs/.venv/lib/python3.8/site-packages/griffe/mixins.py", line 31, in __getitem__
return self.members[parts[0]][parts[1:]] # type: ignore[attr-defined]
KeyError: ''
This is unintuitive because the error message makes it look like there is some issue with the legitimate file <redacted filename>.md, but in reality what is breaking is some code in the GriffeLoader class that as far as I can tell is attempting to built out the directory structure of the repo.
Here's what the file structure of the Python project looks like with this .venv folder:

I'm not exactly sure why the .env folder specifically causes an issue, but regardless hidden/dot folder should just be ignored. I tried to use the mkdocs-exclude plugin to see if the exclusions would work with mkdocstrings but that was unsuccessful.
Debug logs
Relevant logs with sensitive project information excluded:
ERROR - Error reading page '<redacted filepath>/<redacted filename>.md': ''
Traceback (most recent call last):
File "/Users/rsenseman/Development/<redacted project name>/docs/.venv/lib/python3.8/site-packages/griffe/loader.py", line 550, in _get_or_create_parent_module
parent_module = parent_module[parent_part]
File "/Users/rsenseman/Development/<redacted repo name>/docs/.venv/lib/python3.8/site-packages/griffe/mixins.py", line 31, in __getitem__
return self.members[parts[0]][parts[1:]] # type: ignore[attr-defined]
KeyError: ''
To Reproduce
Steps to reproduce the behavior:
- Have virtual environment
.venv folder in Python project files.
- Run
mkdocs build
- This will raise the error
Expected behavior
I would expect all contents of hidden repos to be ignored.
System (please complete the following information):
griffe version: 0.32.3
- Python version:
3.8.13
- OS: mac
Additional context
I can implement a fix for this after opening the issue
Describe the bug
During my CI a
.venvfolder is created locally to run tests. The presence of this.venvfolder then breaks the docs generation.When I attempt to run
mkdocs buildwhen the.venvfolder is present, I get the following error message:This is unintuitive because the error message makes it look like there is some issue with the legitimate file
<redacted filename>.md, but in reality what is breaking is some code in theGriffeLoaderclass that as far as I can tell is attempting to built out the directory structure of the repo.Here's what the file structure of the Python project looks like with this

.venvfolder:I'm not exactly sure why the
.envfolder specifically causes an issue, but regardless hidden/dot folder should just be ignored. I tried to use the mkdocs-exclude plugin to see if the exclusions would work withmkdocstringsbut that was unsuccessful.Debug logs
Relevant logs with sensitive project information excluded:
To Reproduce
Steps to reproduce the behavior:
.venvfolder in Python project files.mkdocs buildExpected behavior
I would expect all contents of hidden repos to be ignored.
System (please complete the following information):
griffeversion:0.32.33.8.13Additional context
I can implement a fix for this after opening the issue