From 47d1ebdd56ec6df90feb8be6debd2834afa2a3cc Mon Sep 17 00:00:00 2001 From: nichmor Date: Tue, 30 Jul 2024 16:42:01 +0300 Subject: [PATCH] misc: use render_recipe_with_context --- src/rattler_build_conda_compat/jinja.py | 4 ++-- tests/test_jinja.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rattler_build_conda_compat/jinja.py b/src/rattler_build_conda_compat/jinja.py index 9cd1038..0289a41 100644 --- a/src/rattler_build_conda_compat/jinja.py +++ b/src/rattler_build_conda_compat/jinja.py @@ -52,9 +52,9 @@ def load_recipe_context(context: dict[str, str], jinja_env: jinja2.Environment) return context -def eval_recipe_using_context(recipe_content: RecipeWithContext) -> dict[str, Any]: +def render_recipe_with_context(recipe_content: RecipeWithContext) -> dict[str, Any]: """ - Evaluate the recipe using known values from context section. + Render the recipe using known values from context section. Unknown values are not evaluated and are kept as it is. Examples: diff --git a/tests/test_jinja.py b/tests/test_jinja.py index c435526..eb69b69 100644 --- a/tests/test_jinja.py +++ b/tests/test_jinja.py @@ -1,7 +1,7 @@ from pathlib import Path import yaml -from rattler_build_conda_compat.jinja import eval_recipe_using_context, load_yaml +from rattler_build_conda_compat.jinja import load_yaml, render_recipe_with_context def test_render_context(snapshot) -> None: @@ -9,7 +9,7 @@ def test_render_context(snapshot) -> None: with recipe.open() as f: recipe_yaml = load_yaml(f) - rendered = eval_recipe_using_context(recipe_yaml) + rendered = render_recipe_with_context(recipe_yaml) into_yaml = yaml.dump(rendered) assert into_yaml == snapshot