Skip to content

Commit

Permalink
run the actual pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Aug 7, 2024
1 parent eed8c2e commit b818676
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 deletions.
4 changes: 2 additions & 2 deletions conda_forge_tick/update_recipe/v2/conditional_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class IfStatement(Generic[T]):
def visit_conditional_list( # noqa: C901
value: T | IfStatement[T] | list[T | IfStatement[T]],
evaluator: Callable[[Any], bool] | None = None,
) -> Generator[T, None, None]:
) -> Generator[T]:
"""
A function that yields individual branches of a conditional list.
Expand All @@ -35,7 +35,7 @@ def visit_conditional_list( # noqa: C901
A generator that yields the individual branches.
"""

def yield_from_list(value: list[K] | K) -> Generator[K, None, None]:
def yield_from_list(value: list[K] | K) -> Generator[K]:
if isinstance(value, list):
yield from value

Check warning on line 40 in conda_forge_tick/update_recipe/v2/conditional_list.py

View check run for this annotation

Codecov / codecov/patch

conda_forge_tick/update_recipe/v2/conditional_list.py#L40

Added line #L40 was not covered by tests
else:
Expand Down
29 changes: 0 additions & 29 deletions conda_forge_tick/update_recipe/v2/jinja/jinja.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,32 +92,3 @@ def load_recipe_context(
context[key] = rendered_value

Check warning on line 92 in conda_forge_tick/update_recipe/v2/jinja/jinja.py

View check run for this annotation

Codecov / codecov/patch

conda_forge_tick/update_recipe/v2/jinja/jinja.py#L89-L92

Added lines #L89 - L92 were not covered by tests

return context

Check warning on line 94 in conda_forge_tick/update_recipe/v2/jinja/jinja.py

View check run for this annotation

Codecov / codecov/patch

conda_forge_tick/update_recipe/v2/jinja/jinja.py#L94

Added line #L94 was not covered by tests


# def render_recipe_with_context(recipe_content: RecipeWithContext) -> dict[str, Any]:
# """
# Render the recipe using known values from context section.
# Unknown values are not evaluated and are kept as it is.
# Target platform, build platform, and mpi are set to linux-64 by default.

# Examples:
# ---
# ```python
# >>> from pathlib import Path
# >>> from conda_forge_tick.loader import load_yaml
# >>> recipe_content = load_yaml((Path().resolve() / "tests" / "data" / "eval_recipe_using_context.yaml").read_text())
# >>> evaluated_context = render_recipe_with_context(recipe_content)
# >>> assert "my_value-${{ not_present_value }}" == evaluated_context["build"]["string"]
# >>>
# ```
# """
# env = jinja_env()
# context = recipe_content.get("context", {})
# # render out the context section and retrieve dictionary
# context_variables = load_recipe_context(context, env)

# # render the rest of the document with the values from the context
# # and keep undefined expressions _as is_.
# template = env.from_string(yaml.dump(recipe_content))
# rendered_content = template.render(context_variables)
# return load_yaml(rendered_content)

0 comments on commit b818676

Please sign in to comment.