Skip to content

Commit

Permalink
fix: Force extension import path to be a string (coming from MkDocs' …
Browse files Browse the repository at this point in the history
…`!relative` tag)
  • Loading branch information
pawamoy committed Oct 9, 2023
1 parent e57f08e commit 34e21a9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/griffe/extensions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,12 @@ def _load_extension(
# and the value to be a dictionary of options.
if isinstance(extension, dict):
import_path, options = next(iter(extension.items()))
# Force path to be a string, as it could have been passed from `mkdocs.yml`,
# using the custom YAML tag `!relative`, which gives an instance of MkDocs
# path placeholder classes, which are not iterable.
# See https://github.com/mkdocs/mkdocs/issues/3414.
# TODO: Update when this issue is resolved.
import_path = str(import_path)

# Otherwise we consider it's an import path, without options.
else:
Expand Down

0 comments on commit 34e21a9

Please sign in to comment.