+
Skip to content

linting: fix type error when linting modules.json #3611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions nf_core/modules/modules_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ def components_with_repos():
}
)

def recreate_dependencies(self, repo, org, subworkflow):
def recreate_dependencies(self, repo: str, org: str, subworkflow: Dict[str, str]) -> None:
"""
Try to recreate the installed_by entries for subworkflows.
Remove self installation entry from dependencies, assuming that the modules.json has been freshly created,
Expand All @@ -1268,19 +1268,21 @@ def recreate_dependencies(self, repo, org, subworkflow):
name = dep_mod["name"]
current_repo = dep_mod.get("git_remote", repo)
current_org = dep_mod.get("org_path", org)
assert current_repo is not None and current_org is not None
installed_by = self.modules_json["repos"][current_repo]["modules"][current_org][name]["installed_by"]
if installed_by == ["modules"]:
self.modules_json["repos"][repo]["modules"][org][dep_mod]["installed_by"] = []
self.modules_json["repos"][repo]["modules"][org][name]["installed_by"] = []
if sw_name not in installed_by:
self.modules_json["repos"][repo]["modules"][org][dep_mod]["installed_by"].append(sw_name)
self.modules_json["repos"][repo]["modules"][org][name]["installed_by"].append(sw_name)

for dep_subwf in dep_subwfs:
name = dep_subwf["name"]
current_repo = dep_subwf.get("git_remote", repo)
current_org = dep_subwf.get("org_path", org)
assert current_repo is not None and current_org is not None
installed_by = self.modules_json["repos"][current_repo]["subworkflows"][current_org][name]["installed_by"]
if installed_by == ["subworkflows"]:
self.modules_json["repos"][repo]["subworkflows"][org][dep_subwf]["installed_by"] = []
self.modules_json["repos"][repo]["subworkflows"][org][name]["installed_by"] = []
if sw_name not in installed_by:
self.modules_json["repos"][repo]["subworkflows"][org][dep_subwf]["installed_by"].append(sw_name)
self.modules_json["repos"][repo]["subworkflows"][org][name]["installed_by"].append(sw_name)
self.recreate_dependencies(repo, org, dep_subwf)
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载