Skip to content

Commit

Permalink
misc: use render_recipe_with_context
Browse files Browse the repository at this point in the history
  • Loading branch information
nichmor committed Jul 30, 2024
1 parent 6718cba commit 47d1ebd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/rattler_build_conda_compat/jinja.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_jinja.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
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:
recipe = Path("tests/data/context.yaml")
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

0 comments on commit 47d1ebd

Please sign in to comment.