From f122278b0732296d2debcd89af4248888f1a06f9 Mon Sep 17 00:00:00 2001 From: KV Date: Sat, 9 Sep 2023 14:46:34 +0200 Subject: [PATCH] Include "tests" folders in the build tool groups Allow absent "prefix" in group entries to simplify the code --- src/wireviz/tools/build_examples.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wireviz/tools/build_examples.py b/src/wireviz/tools/build_examples.py index 3a32113..7ad295a 100755 --- a/src/wireviz/tools/build_examples.py +++ b/src/wireviz/tools/build_examples.py @@ -31,6 +31,7 @@ groups = { "path": dir / "examples", "prefix": "demo", }, + **{p.stem: {"path": p} for p in (dir / "tests").glob("**")}, } input_extensions = [".yml"] @@ -43,7 +44,7 @@ generated_extensions = ( def collect_filenames(description, groupkey, ext_list): 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]: patterns.append(readme) print(f'{description} {groupkey} in "{path}"')