Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs fail to build with default CCP install #126

Closed
szvsw opened this issue Sep 25, 2024 · 1 comment · Fixed by #127
Closed

Docs fail to build with default CCP install #126

szvsw opened this issue Sep 25, 2024 · 1 comment · Fixed by #127
Assignees
Labels
bug Something isn't working

Comments

@szvsw
Copy link
Contributor

szvsw commented Sep 25, 2024

Docs are failing to build with the default install, I think to do with some recent changes in various mkdocs dependencies.

current:

[tool.poetry.group.docs.dependencies]
mkdocs = "^1.4.2"
mkdocs-material = "^9.2.7"
mkdocstrings = {extras = ["python"], version = "^0.23.0"}

What I had to do to fix:

[tool.poetry.group.docs.dependencies]
mkdocs = "^1.4.2"
mkdocs-material = "^9.2.7"
mkdocstrings = {extras = ["python"], version = "^0.26.0"}
mkdocstrings-python = "^1.11.1"

To Reproduce

Steps to reproduce the behavior:

  1. create a default ccp project with docs enabled
  2. make the docs or push to github so the test runs
  3. build fails with the following error
ERROR   -  Error reading page 'modules.md': No module named 'griffe.collections'
Traceback (most recent call last):
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/click/core.py", line [14](https://github.com/szvsw/test-pyright-ccp/actions/runs/11029095289/job/30630744307#step:4:15)34, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/mkdocs/__main__.py", line 288, in build_command
    build.build(cfg, dirty=not clean)
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/mkdocs/commands/build.py", line 310, in build
    _populate_page(file.page, config, files, dirty)
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/mkdocs/commands/build.py", line 167, in _populate_page
    page.render(config, files)
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/mkdocs/structure/pages.py", line 285, in render
    self.content = md.convert(self.markdown)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/markdown/core.py", line 357, in convert
    root = self.parser.parseDocument(self.lines).getroot()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/markdown/blockparser.py", line 117, in parseDocument
    self.parseChunk(self.root, '\n'.join(lines))
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/markdown/blockparser.py", line 136, in parseChunk
    self.parseBlocks(parent, text.split('\n\n'))
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/markdown/blockparser.py", line [15](https://github.com/szvsw/test-pyright-ccp/actions/runs/11029095289/job/30630744307#step:4:16)8, in parseBlocks
    if processor.run(parent, blocks) is not False:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/mkdocstrings/extension.py", line 125, in run
    html, handler, data = self._process_block(identifier, block, heading_level)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/mkdocstrings/extension.py", line 196, in _process_block
    handler = self._handlers.get_handler(handler_name, handler_config)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/mkdocstrings/handlers/base.py", line 458, in get_handler
    module = importlib.import_module(f"mkdocstrings_handlers.{name}")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1[17](https://github.com/szvsw/test-pyright-ccp/actions/runs/11029095289/job/30630744307#step:4:18)6, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/mkdocstrings_handlers/python/__init__.py", line 3, in <module>
    from mkdocstrings_handlers.python.handler import get_handler
  File "/home/runner/work/test-pyright-ccp/test-pyright-ccp/.venv/lib/python3.11/site-packages/mkdocstrings_handlers/python/handler.py", line 14, in <module>
    from griffe.collections import LinesCollection, ModulesCollection
ModuleNotFoundError: No module named 'griffe.collections'

Expected behavior

Build succeeds

Additional context

https://github.com/szvsw/test-pyright-ccp/actions/runs/11029095289/job/30630743737

@szvsw szvsw added the bug Something isn't working label Sep 25, 2024
@fpgmaas fpgmaas linked a pull request Sep 25, 2024 that will close this issue
4 tasks
@fpgmaas
Copy link
Owner

fpgmaas commented Sep 25, 2024

Thanks for raising this! I changed it to

mkdocstrings = {extras = ["python"], version = "^0.26.0"}

In the template, which should solve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants