Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Jan 6, 2025
1 parent 973ca39 commit a6314af
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/rattler_build_conda_compat/recipe_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
import typing
from collections.abc import MutableMapping
from dataclasses import dataclass
from typing import Any, List, Union
from typing import Any, List, Union, cast

from rattler_build_conda_compat.jinja.jinja import RecipeWithContext, render_recipe_with_context, jinja_env, load_recipe_context
from rattler_build_conda_compat.jinja.jinja import (
RecipeWithContext,
jinja_env,
load_recipe_context,
)
from rattler_build_conda_compat.loader import _eval_selector
from rattler_build_conda_compat.variant_config import variant_combinations
from rattler_build_conda_compat.yaml import convert_to_plain_types
Expand Down Expand Up @@ -122,12 +126,11 @@ def render_all_sources(
This function should render _all_ URL sources with the
"""

def render(template: str | list[str], context: dict[str, str]) -> str:
def render(template: str | list[str], context: dict[str, str]) -> str | list[str]:
if isinstance(template, list):
return [render(t, context) for t in template]
return [cast(str, render(t, context)) for t in template]
template = env.from_string(template)
rendered_content = template.render(context_variables)
return rendered_content
return template.render(context_variables)

if override_version is not None:
recipe["context"]["version"] = override_version
Expand Down

0 comments on commit a6314af

Please sign in to comment.