Skip to content
Permalink
Browse files
fix: fix assertion error in conda env file spec when applying wildcar…
…ds (thanks @ddesvillechabrol) (#1377)

* fix: fix assertion error in conda env file spec when applying wildcards

* fix arg passing

* fix arg number
  • Loading branch information
johanneskoester committed Feb 5, 2022
1 parent c45d47a commit 6200652b9aff2362a63581cee58eb9f9cae189da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
@@ -704,12 +704,12 @@ def __init__(self, filepath: str, rule=None):
else:
self.file = IOFile(filepath, rule=rule)

def apply_wildcards(self, wildcards):
def apply_wildcards(self, wildcards, rule):
filepath = self.file.apply_wildcards(wildcards)
if is_local_file(filepath):
# Normalize 'file:///my/path.yml' to '/my/path.yml'
filepath = parse_uri(filepath).uri_path
return CondaEnvFileSpec(filepath)
return CondaEnvFileSpec(filepath, rule)

def check(self):
self.file.check()
@@ -736,7 +736,7 @@ class CondaEnvNameSpec(CondaEnvSpec):
def __init__(self, name: str):
self.name = name

def apply_wildcards(self, wildcards):
def apply_wildcards(self, wildcards, _):
return CondaEnvNameSpec(apply_wildcards(self.name, wildcards))

def get_conda_env(self, workflow, env_dir=None, container_img=None, cleanup=None):
@@ -1050,7 +1050,9 @@ def expand_group(self, wildcards):
def expand_conda_env(self, wildcards):
try:
conda_env = (
self.conda_env.apply_wildcards(wildcards) if self.conda_env else None
self.conda_env.apply_wildcards(wildcards, self)
if self.conda_env
else None
)
except WildcardError as e:
raise WildcardError(

0 comments on commit 6200652

Please sign in to comment.