@@ -53,22 +53,21 @@ class Component:
53
53
def build (cls , find_path : list [str ], component_opt : ComponentOption ):
54
54
body = dict (component_opt )
55
55
repository_name = component_opt .path .split ("/" )[0 ]
56
- expanded_path = []
57
- for dir in find_path :
58
- expanded_path .extend (glob .glob (dir ))
59
- for dir in expanded_path :
60
- dir = Path (dir )
61
- component_dir = dir .parent / component_opt .path
62
- found_dir = repository_name == dir .name and component_dir .exists ()
63
- if found_dir :
56
+ for dir_spec in find_path :
57
+ repo_filter , _ , basedir = dir_spec .rpartition ("@" )
58
+ if repo_filter and repo_filter != repository_name :
59
+ continue
60
+ basedir = Path (basedir )
61
+ component_dir = basedir / component_opt .path
62
+ if component_dir .exists ():
64
63
version = "unknown"
65
64
try :
66
65
pyproject = component_dir / "pyproject.toml"
67
66
version = tomllib .loads (pyproject .read_text ())["project" ]["version" ]
68
67
except Exception :
69
68
pass
70
69
body ["version" ] = version
71
- body ["repository_dir" ] = dir
70
+ body ["repository_dir" ] = basedir / repository_name
72
71
body ["component_dir" ] = component_dir
73
72
return cls (** body )
74
73
return None
@@ -284,15 +283,13 @@ def on_config(self, config: MkDocsConfig) -> MkDocsConfig | None:
284
283
self .draft = ctx_draft .get ()
285
284
286
285
self .pulp_docs_dir = Path (config .docs_dir ).parent
287
- # Two directories up from docs is where we expect all the other repositories by default.
288
- self .find_path = ctx_path .get () or [f"{ self .pulp_docs_dir .parent } /*" ]
286
+ self .find_path = ctx_path .get () or [str (self .pulp_docs_dir .parent )]
289
287
290
288
loaded_components = load_components (self .find_path , self .config , self .draft )
291
289
self .config .components = loaded_components
290
+ loaded_component_dirnames = [str (c .component_dir ) for c in loaded_components ]
291
+ log .info (f"Using components={ loaded_component_dirnames } " )
292
292
293
- log .info (
294
- f"Using components={ [str (c .component_dir ) for c in loaded_components ]} "
295
- )
296
293
mkdocstrings_config = config .plugins ["mkdocstrings" ].config
297
294
components_var = []
298
295
for component in self .config .components :
0 commit comments