Skip to content

Commit 29edd02

Browse files
feat: Add support for globs in paths configuration
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
1 parent 639d11e commit 29edd02

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/mkdocstrings_handlers/python/handler.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
import glob
56
import os
67
import posixpath
78
import re
@@ -128,6 +129,8 @@ def __init__(
128129
super().__init__(*args, **kwargs)
129130
self._config_file_path = config_file_path
130131
paths = paths or []
132+
resolved_globs = [glob.glob(path) for path in paths]
133+
paths = [path for glob_list in resolved_globs for path in glob_list]
131134
if not paths and config_file_path:
132135
paths.append(os.path.dirname(config_file_path))
133136
search_paths = [path for path in sys.path if path] # eliminate empty path

0 commit comments

Comments
 (0)