Skip to content

Commit

Permalink
Apply cleanup/simplifications from code review
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Bargull <[email protected]>
Co-authored-by: Ken Odegard <[email protected]>
Signed-off-by: Marcel Bargull <[email protected]>
  • Loading branch information
mbargull and kenodegard committed Mar 25, 2024
1 parent 52ce090 commit 989cb90
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
13 changes: 5 additions & 8 deletions conda_build/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2641,14 +2641,11 @@ def get_loop_vars(self):
return variants.get_vars(_variants, loop_only=True)

def get_used_loop_vars(self, force_top_level=False, force_global=False):
loop_vars = set(self.get_loop_vars())
return {
var
for var in self.get_used_vars(
force_top_level=force_top_level, force_global=force_global
)
if var in loop_vars
}
loop_vars = self.get_loop_vars()
used_vars = self.get_used_vars(
force_top_level=force_top_level, force_global=force_global
)
return set(loop_vars).intersection(used_vars)

def get_rendered_recipe_text(
self, permit_undefined_jinja=False, extract_pattern=None
Expand Down
8 changes: 6 additions & 2 deletions conda_build/variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,12 @@ def get_vars(variants, loop_only=False):
"""For purposes of naming/identifying, provide a way of identifying which variables contribute
to the matrix dimensionality"""
first_variant, *other_variants = variants
special_keys = {"pin_run_as_build", "zip_keys", "ignore_version"}
special_keys.update(set(ensure_list(first_variant.get("extend_keys"))))
special_keys = {
"pin_run_as_build",
"zip_keys",
"ignore_version",
*ensure_list(first_variant.get("extend_keys")),
}
loop_vars = [
k
for k, v in first_variant.items()
Expand Down

0 comments on commit 989cb90

Please sign in to comment.