From a667e56491443132685aae2b1f7e9bfbd1618588 Mon Sep 17 00:00:00 2001 From: Mohit Singh Date: Tue, 30 Jun 2026 15:57:02 +0200 Subject: [PATCH] test: add post_process example recipe The build.post_process schema was already merged in #79. This keeps the remaining valuable part of the original PR: a validated example recipe demonstrating regex-based post-processing, wired into the test suite. Co-Authored-By: Wolf Vollprecht Co-Authored-By: Claude Opus 4.8 (1M context) --- examples/valid/post-process/recipe.yaml | 23 +++++++++++++++++++++++ tests/test_recipe.py | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 examples/valid/post-process/recipe.yaml diff --git a/examples/valid/post-process/recipe.yaml b/examples/valid/post-process/recipe.yaml new file mode 100644 index 0000000..8c40d9f --- /dev/null +++ b/examples/valid/post-process/recipe.yaml @@ -0,0 +1,23 @@ +# yaml-language-server: $schema=../../../schema.json + +# Example recipe demonstrating the build.post_process feature. +# post_process applies regex replacements on files in the package +# after the build step. Files must be valid UTF-8 text. +# Regex uses Rust `regex` crate semantics with `replace_all` behavior. + +package: + name: post-process-example + version: "1.0.0" + +build: + number: 0 + post_process: + - files: + - "bin/*" + regex: "/old/path" + replacement: "/new/path" + - files: + - "**/*.cmake" + - "**/*.pc" + regex: "/home/builder" + replacement: "$PREFIX" diff --git a/tests/test_recipe.py b/tests/test_recipe.py index bda3896..51c0c54 100644 --- a/tests/test_recipe.py +++ b/tests/test_recipe.py @@ -11,7 +11,7 @@ @pytest.fixture( scope="module", - params=["mamba", "xtensor", "single-output", "zlib", "staging"], + params=["mamba", "xtensor", "single-output", "zlib", "staging", "post-process"], ) def valid_recipe(request) -> str: recipe_name = request.param