Skip to content
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

Track from where modules and subworkflows are installed #1999

Merged
merged 16 commits into from
Nov 8, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add source even if the module/subworkflow is already installed
mirpedrol committed Nov 4, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 82c5f5cf2906f011dc8707b61990852afee0815c
2 changes: 1 addition & 1 deletion nf_core/components/components_install.py
Original file line number Diff line number Diff line change
@@ -100,4 +100,4 @@ def clean_modules_json(component, component_type, modules_repo, modules_json):
f"Removing {component_type[:-1]} '{modules_repo.repo_path}/{component}' from repo '{repo_to_remove}' from modules.json"
)
modules_json.remove_entry(component, repo_to_remove, modules_repo.repo_path)
break
return
5 changes: 5 additions & 0 deletions nf_core/modules/install.py
Original file line number Diff line number Diff line change
@@ -73,6 +73,11 @@ def install(self, module, silent=False):
if not nf_core.components.components_install.check_component_installed(
self.component_type, module, current_version, module_dir, self.modules_repo, self.force, self.prompt
):
log.debug(
f"Module is already installed and force is not set.\nAdding the new installation source {self.installed_by} for module {module} to 'modules.json' without installing the module."
)
modules_json.load()
modules_json.update(self.modules_repo, module, current_version, self.installed_by)
return False

version = nf_core.components.components_install.get_version(
13 changes: 12 additions & 1 deletion nf_core/subworkflows/install.py
Original file line number Diff line number Diff line change
@@ -79,6 +79,11 @@ def install(self, subworkflow, silent=False):
self.force,
self.prompt,
):
log.debug(
f"Subworkflow is already installed and force is not set.\nAdding the new installation source {self.installed_by} for subworkflow {subworkflow} to 'modules.json' without installing the subworkflow."
)
modules_json.load()
modules_json.update(self.modules_repo, subworkflow, current_version, self.installed_by)
return False

version = nf_core.components.components_install.get_version(
@@ -89,7 +94,13 @@ def install(self, subworkflow, silent=False):

# Remove subworkflow if force is set and component is installed
if self.force and nf_core.components.components_install.check_component_installed(
self.component_type, subworkflow, current_version, subworkflow_dir, self.modules_repo, self.force
self.component_type,
subworkflow,
current_version,
subworkflow_dir,
self.modules_repo,
self.force,
self.prompt,
):
log.info(f"Removing installed version of '{self.modules_repo.repo_path}/{subworkflow}'")
self.clear_component_dir(subworkflow, subworkflow_dir)