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

Refactor nf-core modules commands #1124

Merged
merged 12 commits into from
Jun 28, 2021
Prev Previous commit
Next Next commit
bug fix
ErikDanielsson committed Jun 23, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit f980f8781b5bccdee177852cadc72aeef887d9ff
6 changes: 3 additions & 3 deletions nf_core/__main__.py
Original file line number Diff line number Diff line change
@@ -370,9 +370,9 @@ def list(ctx, pipeline_dir, json):
If no pipeline directory is given, lists all currently available
software wrappers in the nf-core/modules repository.
"""
module_list = nf_core.modules.ModuleList(pipeline_dir)
module_list = nf_core.modules.ModuleList(pipeline_dir, json)
module_list.modules_repo = ctx.obj["modules_repo_obj"]
print(module_list.list_modules(json))
print(module_list.list_modules())


@modules.command(help_priority=2)
@@ -394,7 +394,7 @@ def install(ctx, pipeline_dir, tool, latest, force, sha):
try:
module_install = nf_core.modules.ModuleInstall(pipeline_dir, tool, force=force, latest=latest, sha=sha)
module_install.modules_repo = ctx.obj["modules_repo_obj"]
module_install.install(tool)
module_install.install()
except UserWarning as e:
log.critical(e)
sys.exit(1)
2 changes: 1 addition & 1 deletion nf_core/modules/lint.py
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
import sys

import nf_core.utils
from .pipeline_modules import ModulesRepo
from .modules_repo import ModulesRepo

log = logging.getLogger(__name__)

2 changes: 1 addition & 1 deletion nf_core/modules/modules_command.py
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ def __init__(self, pipeline_dir):
Initialise the ModulesCommand object
"""
self.modules_repo = ModulesRepo()
self.pipeline_dir = None
self.pipeline_dir = pipeline_dir
self.pipeline_module_names = []

def get_pipeline_modules(self):
5 changes: 3 additions & 2 deletions nf_core/modules/test_yml_builder.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,8 @@
import operator

import nf_core.utils
import nf_core.modules.pipeline_modules

from .modules_repo import ModulesRepo


log = logging.getLogger(__name__)
@@ -62,7 +63,7 @@ def check_inputs(self):

# Get the tool name if not specified
if self.module_name is None:
modules_repo = nf_core.modules.pipeline_modules.ModulesRepo()
modules_repo = ModulesRepo()
modules_repo.get_modules_file_tree()
self.module_name = questionary.autocomplete(
"Tool name:",