Include "tests" folders in the build tool groups

Allow absent "prefix" in group entries to simplify the code
This commit is contained in:
KV 2023-09-09 14:46:34 +02:00
parent 8e2debb1fa
commit f122278b07

View File

@ -31,6 +31,7 @@ groups = {
"path": dir / "examples", "path": dir / "examples",
"prefix": "demo", "prefix": "demo",
}, },
**{p.stem: {"path": p} for p in (dir / "tests").glob("**")},
} }
input_extensions = [".yml"] input_extensions = [".yml"]
@ -43,7 +44,7 @@ generated_extensions = (
def collect_filenames(description, groupkey, ext_list): def collect_filenames(description, groupkey, ext_list):
path = groups[groupkey]["path"] path = groups[groupkey]["path"]
patterns = [f"{groups[groupkey]['prefix']}*{ext}" for ext in ext_list] patterns = [f"{groups[groupkey].get('prefix', '')}*{ext}" for ext in ext_list]
if ext_list != input_extensions and readme in groups[groupkey]: if ext_list != input_extensions and readme in groups[groupkey]:
patterns.append(readme) patterns.append(readme)
print(f'{description} {groupkey} in "{path}"') print(f'{description} {groupkey} in "{path}"')