jw-python/test/unit/python/jw
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jan Lindemann 911c78ff99
load_yaml: Expand variables in top-level include specs
Test wrappers that mimic production invocations redirect the includes of
production documents to tree-local copies; the target location depends on
where the tree is checked out, so it would be nice if the wrapper could
take TOPDIR from the environment instead of hardcoding it.

Allow the file part of a top-level include spec to reference environment
variables as $(VAR) or ${VAR}. _load_yaml() receives a depth counter,
zero at the top level and one per include level, and threads it to
_normalize_include_specs() and _parse_include_spec(); the file part passes
through _expand_include_vars() only at depth zero, after the optional
marker and the target path have been split off. Specs in included documents
keep their literal behaviour. An undefined variable raises ValueError,
naming the reference and the file it came from.

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.6.0
2026-11-20 22:39:55 +01:00
..
util load_yaml: Expand variables in top-level include specs 2026-11-20 22:39:55 +01:00
Makefile stree.StringTree: Add unit tests 2026-08-12 23:10:12 +00:00