backstage / mkdocs-techdocs-core

The core MkDocs plugin used by Backstage's TechDocs as a wrapper around multiple MkDocs plugins and Python Markdown extensions
Apache License 2.0
83 stars 61 forks source link

techdocs plugin is conflicting with mkdocstrings #144

Closed pkruk closed 7 months ago

pkruk commented 9 months ago

Hi,

I'm trying to use techdocs-core plugin with mkdocstrings, but they're conflicting. I can't use them together.

verbose: handler = self._handlers.get_handler(handler_name, handler_config)
  File "/opt/github-actions/.local/lib/python3.10/site-packages/mkdocstrings/handlers/base.py", line 458, in get_handler
    module = importlib.import_module(f"mkdocstrings_handlers.{name}")
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
verbose: File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
verbose: File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'mkdocstrings_handlers'

But when I build the doc with using pure mkdocs build it is rendered properly and builder properly. It's looks like some internal conflict in techdocs-core plugin, because this cmd is failing:

techdocs-cli generate --no-docker --verbose  
dyu-bot commented 8 months ago

Hey @pkruk try installing mkdocstrings extras:

pip install 'mkdocstrings[crystal,python]'

I had the same error but was able to overcome with this. Hope that resolves.

agentbellnorm commented 7 months ago

@pkruk, did the above suggestion resolve the issue?

pkruk commented 7 months ago

sorry for late response :)! Yes that's solve the issue :) We could close ,thanks for a help!