mkdocstrings / python

A Python handler for mkdocstrings.
https://mkdocstrings.github.io/python
ISC License
191 stars 36 forks source link

missing modules in documentation #109

Closed cclecle closed 1 year ago

cclecle commented 1 year ago

Describe the bug On at least one of my project (all using same configuration), I have most python modules missing in the generated documentation. See my mkdocs.yml. See the generated documentation, go to reference, there is only tool_ini, while I expect having all my modules.

To Reproduce clone this repo in eclipse (pydev project): pygamecfg dev install deps in your python venv: ["mkdocs>=1.4.0", "mkdocs-material>=8.5","mkdocs-material-extensions","mkdocs-pymdownx-material-extras", "mkdocs-localsearch>=0.9.0", "mkdocstrings[python]>=0.19", "mkdocs-with-pdf>=0.9.3","pyyaml>=6.0","pymdown-extensions>=9","mkdocs-markdownextradata-plugin","mkdocs-mermaid2-plugin","mkdocs-autorefs"] runs: RUN_mkdocs.launch with eclipse (right click-> Run_As), then find the generated doc in the doc/ subdirectory

I also tried (without improvment):

Also: In my other successfully working project(s) (with same mkdocs.yml, just right names), I can see multiple lines: DEBUG - mkdocstrings: Matched '::: src.<package>.<module> On per generated module. But in this one, I see only one single line: DEBUG - mkdocstrings: Matched '::: src.pygamecfg.tool_ini' And tool_ini is the only generated autodoc.

Expected behavior The generated documentation should contain all the python modules except __init__ and __main__ (filter).

System (please complete the following information):

Mkdocs logs

DEBUG   -  Loading configuration file: C:\Users\chacha\git\pygamecfg\mkdocs.yml
DEBUG   -  Loaded theme configuration for 'material' from 'C:\Users\chacha\AppData\Roaming\Python\Python39\site-packages\material\templates\mkdocs_theme.yml': {'language': 'en', 'direction': None, 'features': [], 'font': {'text': 'Roboto', 'code': 'Roboto Mono'}, 'icon': None, 'favicon': 'assets/images/favicon.png', 'static_templates': ['404.html']}
DEBUG   -  Config value 'config_file_path' = 'C:\\Users\\chacha\\git\\pygamecfg\\mkdocs.yml'
DEBUG   -  Config value 'site_name' = 'pygamecfg'
DEBUG   -  Config value 'nav' = None
DEBUG   -  Config value 'pages' = None
DEBUG   -  Config value 'exclude_docs' = None
DEBUG   -  Config value 'not_in_nav' = None
DEBUG   -  Config value 'site_url' = 'https://chacha.ddns.net/mkdocs-web/chacha/pygamecfg/latest/'
DEBUG   -  Config value 'site_description' = 'A simple ini parser / factory'
DEBUG   -  Config value 'site_author' = 'chacha'
DEBUG   -  Config value 'theme' = Theme(name='material', dirs=['C:\\Users\\chacha\\AppData\\Roaming\\Python\\Python39\\site-packages\\material\\templates', 'C:\\Users\\chacha\\AppData\\Roaming\\Python\\Python39\\site-packages\\mkdocs\\templates'], static_templates={'404.html', 'sitemap.xml'}, name='material', locale=Locale('en'), language='en', direction=None, features=['navigation.instant', 'navigation.tracking', 'navigation.tabs', 'navigation.tabs.sticky', 'navigation.footer', 'toc.integrate', 'navigation.top', 'navigation.section', 'content.code.annotate', 'navigation.prune', 'toc.follow'], font={'text': 'Roboto', 'code': 'Roboto Mono'}, icon=None, favicon='assets/images/favicon.png', palette=[{'media': '(prefers-color-scheme: dark)', 'scheme': 'slate', 'toggle': {'icon': 'material/brightness-4', 'name': 'Switch to system preference'}}, {'media': '(prefers-color-scheme)', 'toggle': {'icon': 'material/brightness-auto', 'name': 'Switch to light mode'}}, {'media': '(prefers-color-scheme: light)', 'scheme': 'default', 'toggle': {'icon': 'material/brightness-7', 'name': 'Switch to dark mode'}}])
DEBUG   -  Config value 'docs_dir' = 'C:\\Users\\chacha\\git\\pygamecfg\\docs'
DEBUG   -  Config value 'site_dir' = 'C:\\Users\\chacha\\git\\pygamecfg\\helpers-results\\doc_gen\\site'
DEBUG   -  Config value 'copyright' = 'CC BY-NC-SA 4.0'
DEBUG   -  Config value 'google_analytics' = None
DEBUG   -  Config value 'dev_addr' = _IpAddressValue(host='127.0.0.1', port=8000)
DEBUG   -  Config value 'use_directory_urls' = False
DEBUG   -  Config value 'repo_url' = 'https://chacha.ddns.net/gitea/chacha/pygamecfg'
DEBUG   -  Config value 'repo_name' = 'Chacha'
DEBUG   -  Config value 'edit_uri_template' = None
DEBUG   -  Config value 'edit_uri' = None
DEBUG   -  Config value 'extra_css' = []
DEBUG   -  Config value 'extra_javascript' = []
DEBUG   -  Config value 'extra_templates' = []
DEBUG   -  Config value 'markdown_extensions' = ['toc', 'tables', 'fenced_code', 'def_list', 'attr_list', 'abbr', 'pymdownx.blocks.admonition', 'pymdownx.blocks.definition', 'pymdownx.blocks.details', 'pymdownx.blocks.tab', 'pymdownx.blocks.html', 'pymdownx.betterem', 'pymdownx.caret', 'pymdownx.critic', 'pymdownx.details', 'pymdownx.inlinehilite', 'pymdownx.snippets', 'pymdownx.highlight', 'pymdownx.keys', 'pymdownx.mark', 'pymdownx.progressbar', 'pymdownx.smartsymbols', 'pymdownx.tasklist', 'pymdownx.tilde', 'footnotes', 'pymdownx.superfences', 'pymdownx.emoji']
DEBUG   -  Config value 'mdx_configs' = {'pymdownx.blocks.admonition': {'types': ['new', 'settings', 'note', 'abstract', 'info', 'tip', 'success', 'question', 'warning', 'failure', 'danger', 'bug', 'example', 'quote']}, 'pymdownx.betterem': {'smart_enable': 'all'}, 'pymdownx.highlight': {'anchor_linenums': True, 'line_spans': '__span', 'pygments_lang_class': True}, 'pymdownx.tasklist': {'custom_checkbox': True}, 'pymdownx.emoji': {'emoji_index': <function twemoji at 0x0000024F637B3A60>, 'emoji_generator': <function to_svg at 0x0000024F637B3C10>}}
DEBUG   -  Config value 'strict' = False
DEBUG   -  Config value 'remote_branch' = 'gh-pages'
DEBUG   -  Config value 'remote_name' = 'origin'
DEBUG   -  Config value 'extra' = {'branch': 'master', 'repository': 'pygamecfg'}
DEBUG   -  Config value 'plugins' = {'material/search': <material.plugins.search.plugin.SearchPlugin object at 0x0000024F638FADC0>, 'markdownextradata': <markdownextradata.plugin.MarkdownExtraDataPlugin object at 0x0000024F63906A60>, 'mermaid2': <mermaid2.plugin.MarkdownMermaidPlugin object at 0x0000024F63906A30>, 'localsearch': <mkdocs_localsearch_plugin.plugin.LocalSearchPlugin object at 0x0000024F653C4790>, 'mkdocstrings': <mkdocstrings.plugin.MkdocstringsPlugin object at 0x0000024F655C4FD0>, 'with-pdf': <mkdocs_with_pdf.plugin.WithPdfPlugin object at 0x0000024F65605FD0>}
DEBUG   -  Config value 'hooks' = {}
DEBUG   -  Config value 'watch' = []
DEBUG   -  Config value 'validation' = {'nav': {'omitted_files': 20, 'not_found': 30, 'absolute_links': 20}, 'links': {'not_found': 30, 'absolute_links': 20, 'unrecognized_links': 20}}
DEBUG   -  Running 1 `startup` events
DEBUG   -  Running 5 `config` events
DEBUG   -  Looking for translations for locale 'en'
DEBUG   -  No translations found here: 'C:\Users\chacha\AppData\Roaming\Python\Python39\site-packages\mkdocs\templates\locales'
DEBUG   -  No translations found here: 'C:\Users\chacha\AppData\Roaming\Python\Python39\site-packages\material\templates\locales'
DEBUG   -  Looking for translations for locale 'en'
DEBUG   -  No translations found here: 'C:\Users\chacha\AppData\Roaming\Python\Python39\site-packages\mkdocs\templates\locales'
DEBUG   -  No translations found here: 'C:\Users\chacha\AppData\Roaming\Python\Python39\site-packages\material\templates\locales'
DEBUG   -  Looking for translations for locale 'en'
DEBUG   -  No translations found here: 'C:\Users\chacha\AppData\Roaming\Python\Python39\site-packages\mkdocs\templates\locales'
DEBUG   -  No translations found here: 'C:\Users\chacha\AppData\Roaming\Python\Python39\site-packages\material\templates\locales'
INFO    -  MERMAID2  - Initialization arguments: {}
INFO    -  MERMAID2  - Using javascript library (10.4.0):
   https://unpkg.com/mermaid@10.4.0/dist/mermaid.esm.min.mjs
DEBUG   -  mkdocstrings: Adding extension to the list
DEBUG   -  mkdocstrings: Added a subdued autorefs instance <mkdocs_autorefs.plugin.AutorefsPlugin object at 0x0000024F676222B0>
DEBUG   -  mkdocs_autorefs: Adding AutorefsExtension to the list
DEBUG   -  Running 1 `pre_build` events
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory: C:\Users\chacha\git\pygamecfg\helpers-results\doc_gen\site
DEBUG   -  Looking for translations for locale 'en'
DEBUG   -  No translations found here: 'C:\Users\chacha\AppData\Roaming\Python\Python39\site-packages\mkdocs\templates\locales'
DEBUG   -  No translations found here: 'C:\Users\chacha\AppData\Roaming\Python\Python39\site-packages\material\templates\locales'
DEBUG   -  Running 1 `nav` events
DEBUG   -  Reading markdown pages.
DEBUG   -  Reading: README.md
DEBUG   -  Running 2 `page_markdown` events
WARNING -  Doc file 'README.md' contains a relative link 'docs-static/Library.jpg', but the target is not found among documentation files.
DEBUG   -  Running 1 `page_content` events
DEBUG   -  Reading: LICENSE.md
DEBUG   -  Running 2 `page_markdown` events
DEBUG   -  Running 1 `page_content` events
DEBUG   -  Reading: usage.md
DEBUG   -  Running 2 `page_markdown` events
DEBUG   -  Running 1 `page_content` events
DEBUG   -  Reading: reference/pygamecfg/tool_ini.md
DEBUG   -  Running 2 `page_markdown` events
DEBUG   -  mkdocstrings: Matched '::: src.pygamecfg.tool_ini'
DEBUG   -  mkdocstrings: Using handler 'python'
DEBUG   -  mkdocstrings: Collecting data
DEBUG   -  griffe: Found src: loading
DEBUG   -  griffe: Loading path [WindowsPath('src'), WindowsPath('C:/Users/chacha/git/pygamecfg/src'), WindowsPath('C:/Users/chacha/git/pygamecfg/src')]
DEBUG   -  griffe: Skip C:\Users\chacha\git\pygamecfg\src\pygamecfg\common_ut.py, another module took precedence
DEBUG   -  griffe: Skip C:\Users\chacha\git\pygamecfg\src\pygamecfg\core_gamecfg.py, another module took precedence
DEBUG   -  griffe: Skip C:\Users\chacha\git\pygamecfg\src\pygamecfg\game_cod4.py, another module took precedence
DEBUG   -  griffe: Skip C:\Users\chacha\git\pygamecfg\src\pygamecfg\game_ut2k4.py, another module took precedence
DEBUG   -  griffe: Skip C:\Users\chacha\git\pygamecfg\src\pygamecfg\game_ut99.py, another module took precedence
DEBUG   -  griffe: Skip C:\Users\chacha\git\pygamecfg\src\pygamecfg\tool_ini.py, another module took precedence
DEBUG   -  griffe: Skip C:\Users\chacha\git\pygamecfg\src\pygamecfg\__init__.py, another module took precedence
DEBUG   -  griffe: Skip C:\Users\chacha\git\pygamecfg\src\pygamecfg\__main__.py, another module took precedence
DEBUG   -  griffe: Skip C:\Users\chacha\git\pygamecfg\src\pygamecfg\common_ut.py, another module took precedence
DEBUG   -  griffe: Skip C:\Users\chacha\git\pygamecfg\src\pygamecfg\core_gamecfg.py, another module took precedence
DEBUG   -  griffe: Skip C:\Users\chacha\git\pygamecfg\src\pygamecfg\game_cod4.py, another module took precedence
DEBUG   -  griffe: Skip C:\Users\chacha\git\pygamecfg\src\pygamecfg\game_ut2k4.py, another module took precedence
DEBUG   -  griffe: Skip C:\Users\chacha\git\pygamecfg\src\pygamecfg\game_ut99.py, another module took precedence
DEBUG   -  griffe: Skip C:\Users\chacha\git\pygamecfg\src\pygamecfg\tool_ini.py, another module took precedence
DEBUG   -  griffe: Skip C:\Users\chacha\git\pygamecfg\src\pygamecfg\__init__.py, another module took precedence
DEBUG   -  griffe: Skip C:\Users\chacha\git\pygamecfg\src\pygamecfg\__main__.py, another module took precedence
DEBUG   -  griffe: Loading path src\pygamecfg\__init__.py
DEBUG   -  griffe: Loading path src\pygamecfg\common_ut.py
DEBUG   -  griffe: Loading path src\pygamecfg\core_gamecfg.py
DEBUG   -  griffe: Loading path src\pygamecfg\game_cod4.py
DEBUG   -  griffe: Loading path src\pygamecfg\game_ut2k4.py
DEBUG   -  griffe: Loading path src\pygamecfg\game_ut99.py
DEBUG   -  griffe: Loading path src\pygamecfg\tool_ini.py
DEBUG   -  griffe: Loading path src\pygamecfg\__main__.py
DEBUG   -  griffe: Iteration 1 finished, 0 aliases resolved, still 0 to go
DEBUG   -  mkdocstrings: Updating handler's rendering env
DEBUG   -  mkdocstrings: Rendering templates
DEBUG   -  mkdocstrings: python\templates\material\module.html: Rendering src.pygamecfg.tool_ini
DEBUG   -  mkdocstrings: python\templates\material\docstring.html: Rendering docstring
DEBUG   -  mkdocstrings: python\templates\material\children.html: Rendering children of src.pygamecfg.tool_ini
DEBUG   -  mkdocstrings: python\templates\material\class.html: Rendering src.pygamecfg.tool_ini.PySimpleINI_GroupKeysInSection
DEBUG   -  mkdocstrings: python\templates\material\docstring.html: Rendering docstring
DEBUG   -  mkdocstrings: python\templates\material\children.html: Rendering children of src.pygamecfg.tool_ini.PySimpleINI_GroupKeysInSection
DEBUG   -  griffe: Base class pysimpleini.PySimpleINI is not loaded, or not static, it cannot be resolved
DEBUG   -  mkdocstrings: python\templates\material\attribute.html: Rendering src.pygamecfg.tool_ini.PySimpleINI_GroupKeysInSection.GroupRules
DEBUG   -  mkdocstrings: python\templates\material\labels.html: Rendering labels
DEBUG   -  mkdocstrings: python\templates\material\function.html: Rendering src.pygamecfg.tool_ini.PySimpleINI_GroupKeysInSection.groupkeysinsection
DEBUG   -  mkdocstrings: python\templates\material\signature.html: Rendering signature
DEBUG   -  mkdocstrings: python\templates\material\docstring.html: Rendering docstring
DEBUG   -  mkdocstrings: python\templates\material\function.html: Rendering src.pygamecfg.tool_ini.PySimpleINI_GroupKeysInSection.writefile
DEBUG   -  mkdocstrings: python\templates\material\signature.html: Rendering signature
DEBUG   -  mkdocstrings: python\templates\material\docstring.html: Rendering docstring
DEBUG   -  Running 1 `page_content` events
DEBUG   -  Running 1 `env` events
DEBUG   -  mkdocstrings: Creating inventory file objects.inv
DEBUG   -  Copying static assets.
DEBUG   -  Copying media file: 'Library.jpg'
DEBUG   -  Copying media file: 'assets/images/favicon.png'
DEBUG   -  Copying media file: 'assets/javascripts/bundle.4e0fa4ba.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/bundle.4e0fa4ba.min.js.map'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.ar.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.da.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.de.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.du.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.es.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.fi.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.fr.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.he.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.hi.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.hu.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.hy.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.it.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.ja.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.jp.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.kn.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.ko.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.multi.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.nl.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.no.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.pt.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.ro.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.ru.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.sa.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.stemmer.support.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.sv.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.ta.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.te.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.th.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.tr.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.vi.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/min/lunr.zh.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/tinyseg.js'
DEBUG   -  Copying media file: 'assets/javascripts/lunr/wordcut.js'
DEBUG   -  Copying media file: 'assets/javascripts/workers/search.a264c092.min.js'
DEBUG   -  Copying media file: 'assets/javascripts/workers/search.a264c092.min.js.map'
DEBUG   -  Copying media file: 'assets/stylesheets/main.72749a73.min.css'
DEBUG   -  Copying media file: 'assets/stylesheets/main.72749a73.min.css.map'
DEBUG   -  Copying media file: 'assets/stylesheets/palette.a5377069.min.css'
DEBUG   -  Copying media file: 'assets/stylesheets/palette.a5377069.min.css.map'
DEBUG   -  Building theme template: 404.html
DEBUG   -  Building theme template: sitemap.xml
DEBUG   -  Gzipping template: sitemap.xml
DEBUG   -  Building markdown pages.
DEBUG   -  Building page README.md
DEBUG   -  Running 1 `page_context` events
DEBUG   -  Running 3 `post_page` events
DEBUG   -  mkdocs_autorefs: Fixing references in page README.md
DEBUG   -  Building page LICENSE.md
DEBUG   -  Running 1 `page_context` events
DEBUG   -  Running 3 `post_page` events
INFO    -  Page skipped: [License](LICENSE.html)
DEBUG   -  mkdocs_autorefs: Fixing references in page LICENSE.md
DEBUG   -  Building page usage.md
DEBUG   -  Running 1 `page_context` events
DEBUG   -  Running 3 `post_page` events
DEBUG   -  mkdocs_autorefs: Fixing references in page usage.md
DEBUG   -  Building page reference/pygamecfg/tool_ini.md
DEBUG   -  Running 1 `page_context` events
DEBUG   -  Running 3 `post_page` events
DEBUG   -  mkdocs_autorefs: Fixing references in page reference\pygamecfg\tool_ini.md
DEBUG   -  Running 4 `post_build` events
WARNING -  localsearch: Missing search plugin. You must add both search and localsearch to the list of plugins in mkdocs.yml.
DEBUG   -  mkdocstrings: Tearing handlers down
INFO    -  Number headings up to level 3.
INFO    -  Generate a table of contents up to heading level 2.
INFO    -  Generate a cover page with "default_cover.html.j2".
INFO    -  Converting <img> alignment(workaround).
INFO    -  Rendering for PDF.
INFO    -  Output a PDF to "C:\Users\chacha\git\pygamecfg\helpers-results\doc_gen\site\pdf\manual.pdf".
INFO    -  Converting 4 articles to PDF took 2.3s
INFO    -  Documentation built in 3.00 seconds
pawamoy commented 1 year ago

Hello, thanks for the report.

The reproduction instructions are not super maintainer friendly. They shouldn't depend on a particular IDE. Ideally, you'd provide a few command lines. Here's what I ended up doing to have a working environment:

git clone https://chacha.ddns.net/gitea/chacha/pygamecfg
cd pygamecfg
python -m venv .venv
. .venv/bin/activate
pip install mkdocs
pip install $(mkdocs get-deps)

But the docs folder does not exist, it has to be generated. Looking at your project it seems to be done thanks to the helpers, though these helpers require additional dependencies. After a lot of back and forth, I ended up installing your project and its optional dependencies:

pip install -e .[test,coverage-check,complexity-check,quality-check,type-check,doc-gen]

Then I was able to run python -m helpers --help to learn that I could run python -m helpers --doc-gen to finally try and build the docs.

In the end, this is what I would have wanted to see:

git clone https://chacha.ddns.net/gitea/chacha/pygamecfg
cd pygamecfg
python -m venv .venv
. .venv/bin/activate
pip install -e .[test,coverage-check,complexity-check,quality-check,type-check,doc-gen]
python -m helpers --doc-gen
mkdocs serve

I hope this will help you creating better reports in the future :slightly_smiling_face:


Now about your issue. You are referencing your modules with ::: src.pygamecfg. This is wrong: your Python package is not src, it's pygamecfg, so the references should look like ::: pygamecfg.data, etc. In your helpers, you are voluntarily adding src to the paths: identifier = "src." + ".".join(parts). I suppose you did this because without it, mkdocstrings wouldn't find your modules? The proper way to tell mkdocstrings how to find your modules under src is to use the paths option.

plugins:
- mkdocstrings:
    handlers:
      python:
        paths: [src]

Then remove the src. prefix from your autodoc instructions (::: pygamecfg.data, etc.), and it should work better.

I tested it locally and it fixes the issue, so I'll close this, but feel free to comment further!

cclecle commented 1 year ago

Thank you very much, you targeted the issue in my own code ! Impressive, you falled into very fast, so my explaination wasn't that bad, and I am very happy that argparse help was usefull :).

=> Next time I will provide a better installer explaination.


So yes, there were an issue with the path, fixed ! But also (and that is the root problem) : cls._reset_dir(os.path.dirname(full_doc_path)) in the same part of doc_gen.py was erasing the doc reference directory at every loop (new module file found) ... So I checked with my previous project and finally found the original code was cls._create_dir(full_doc_path.parent.resolve()) . I have probably introduced this error a few month ago in my own template :).

Thank you again, mkdocs / mkdocstrings is working as expected.