Skip to content

Commit

Permalink
feat: Add support for globs in paths configuration
Browse files Browse the repository at this point in the history
This change allows for values in the paths configuration option to be
globs by resolving them before passing them off to Griffe.

Issue #33: #33
PR #34: #34
  • Loading branch information
AndrewGuenther committed Sep 23, 2022
1 parent 639d11e commit 29edd02
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mkdocstrings_handlers/python/handler.py
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import glob
import os
import posixpath
import re
Expand Down Expand Up @@ -128,6 +129,8 @@ def __init__(
super().__init__(*args, **kwargs)
self._config_file_path = config_file_path
paths = paths or []
resolved_globs = [glob.glob(path) for path in paths]
paths = [path for glob_list in resolved_globs for path in glob_list]
if not paths and config_file_path:
paths.append(os.path.dirname(config_file_path))
search_paths = [path for path in sys.path if path] # eliminate empty path
Expand Down

0 comments on commit 29edd02

Please sign in to comment.