diff --git a/CHANGELOG.md b/CHANGELOG.md index 2864e3cc5..091eb15b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,7 +56,7 @@ - Add prompt for module name to `nf-core modules info` ([#1644](https://github.com/nf-core/tools/issues/1644)) - Update docs with example of custom git remote ([#1645](https://github.com/nf-core/tools/issues/1645)) - Command `nf-core modules test` obtains module name suggestions from installed modules ([#1624](https://github.com/nf-core/tools/pull/1624)) -- Add `--base-path` flag to `nf-core modules` to specify the base path for the modules in a remote. Also refactored `modules.json` code. ([#1643](https://github.com/nf-core/tools/issues/1643)) +- Add `--base-path` flag to `nf-core modules` to specify the base path for the modules in a remote. Also refactored `modules.json` code. ([#1643](https://github.com/nf-core/tools/issues/1643)) Removed after ([#1754](https://github.com/nf-core/tools/pull/1754)) - Rename methods in `ModulesJson` to remove explicit reference to `modules.json` - Fix inconsistencies in the `--save-diff` flag `nf-core modules update`. Refactor `nf-core modules update` ([#1536](https://github.com/nf-core/tools/pull/1536)) - Fix bug in `ModulesJson.check_up_to_date` causing it to ask for the remote of local modules diff --git a/README.md b/README.md index 278bbbaf3..8fc64978b 100644 --- a/README.md +++ b/README.md @@ -945,8 +945,6 @@ For example, if you want to install the `fastqc` module from the repository `nf- nf-core modules --git-remote git@gitlab.com:nf-core/modules-test.git install fastqc ``` -If the modules in your custom remote are stored in another directory than `modules`, you can specify the path by using the `--base-path ` flag. This will default to `modules`. Note that all branches in a remote must use the same base path, otherwise the commands will fail. - Note that a custom remote must follow a similar directory structure to that of `nf-core/moduleÅ›` for the `nf-core modules` commands to work properly. The modules commands will during initalisation try to pull changes from the remote repositories. If you want to disable this, for example diff --git a/nf_core/__main__.py b/nf_core/__main__.py index 2762b2688..34e2e95dc 100755 --- a/nf_core/__main__.py +++ b/nf_core/__main__.py @@ -354,14 +354,8 @@ def lint(dir, release, fix, key, show_passed, fail_ignored, fail_warned, markdow default=False, help="Do not pull in latest changes to local clone of modules repository.", ) -@click.option( - "--base-path", - type=str, - default=None, - help="Specify where the modules are stored in the remote", -) @click.pass_context -def modules(ctx, git_remote, branch, no_pull, base_path): +def modules(ctx, git_remote, branch, no_pull): """ Commands to manage Nextflow DSL2 modules (tool wrappers). """ @@ -373,7 +367,6 @@ def modules(ctx, git_remote, branch, no_pull, base_path): ctx.obj["modules_repo_url"] = git_remote ctx.obj["modules_repo_branch"] = branch ctx.obj["modules_repo_no_pull"] = no_pull - ctx.obj["modules_repo_base_path"] = base_path # nf-core modules list subcommands @@ -402,7 +395,6 @@ def remote(ctx, keywords, json): ctx.obj["modules_repo_url"], ctx.obj["modules_repo_branch"], ctx.obj["modules_repo_no_pull"], - ctx.obj["modules_repo_base_path"], ) print(module_list.list_modules(keywords, json)) except (UserWarning, LookupError) as e: @@ -433,7 +425,6 @@ def local(ctx, keywords, json, dir): ctx.obj["modules_repo_url"], ctx.obj["modules_repo_branch"], ctx.obj["modules_repo_no_pull"], - ctx.obj["modules_repo_base_path"], ) print(module_list.list_modules(keywords, json)) except (UserWarning, LookupError) as e: @@ -470,7 +461,6 @@ def install(ctx, tool, dir, prompt, force, sha): ctx.obj["modules_repo_url"], ctx.obj["modules_repo_branch"], ctx.obj["modules_repo_no_pull"], - ctx.obj["modules_repo_base_path"], ) exit_status = module_install.install(tool) if not exit_status and all: @@ -528,7 +518,6 @@ def update(ctx, tool, dir, force, prompt, sha, all, preview, save_diff): ctx.obj["modules_repo_url"], ctx.obj["modules_repo_branch"], ctx.obj["modules_repo_no_pull"], - ctx.obj["modules_repo_base_path"], ) exit_status = module_install.update(tool) if not exit_status and all: @@ -562,7 +551,6 @@ def patch(ctx, tool, dir): ctx.obj["modules_repo_url"], ctx.obj["modules_repo_branch"], ctx.obj["modules_repo_no_pull"], - ctx.obj["modules_repo_base_path"], ) module_patch.patch(tool) except (UserWarning, LookupError) as e: @@ -591,7 +579,6 @@ def remove(ctx, dir, tool): ctx.obj["modules_repo_url"], ctx.obj["modules_repo_branch"], ctx.obj["modules_repo_no_pull"], - ctx.obj["modules_repo_base_path"], ) module_remove.remove(tool) except (UserWarning, LookupError) as e: @@ -695,7 +682,6 @@ def lint(ctx, tool, dir, key, all, fail_warned, local, passed, fix_version): ctx.obj["modules_repo_url"], ctx.obj["modules_repo_branch"], ctx.obj["modules_repo_no_pull"], - ctx.obj["modules_repo_base_path"], ) module_lint.lint( module=tool, @@ -746,7 +732,6 @@ def info(ctx, tool, dir): ctx.obj["modules_repo_url"], ctx.obj["modules_repo_branch"], ctx.obj["modules_repo_no_pull"], - ctx.obj["modules_repo_base_path"], ) print(module_info.get_module_info()) except (UserWarning, LookupError) as e: @@ -772,7 +757,6 @@ def bump_versions(ctx, tool, dir, all, show_all): ctx.obj["modules_repo_url"], ctx.obj["modules_repo_branch"], ctx.obj["modules_repo_no_pull"], - ctx.obj["modules_repo_base_path"], ) version_bumper.bump_versions(module=tool, all_modules=all, show_uptodate=show_all) except nf_core.modules.module_utils.ModuleException as e: diff --git a/nf_core/modules/bump_versions.py b/nf_core/modules/bump_versions.py index b6be65857..a30f93eda 100644 --- a/nf_core/modules/bump_versions.py +++ b/nf_core/modules/bump_versions.py @@ -26,8 +26,8 @@ class ModuleVersionBumper(ModuleCommand): - def __init__(self, pipeline_dir, remote_url=None, branch=None, no_pull=False, base_path=None): - super().__init__(pipeline_dir, remote_url, branch, no_pull, base_path) + def __init__(self, pipeline_dir, remote_url=None, branch=None, no_pull=False): + super().__init__(pipeline_dir, remote_url, branch, no_pull) self.up_to_date = None self.updated = None diff --git a/nf_core/modules/info.py b/nf_core/modules/info.py index 94dddbf51..37e0b4db4 100644 --- a/nf_core/modules/info.py +++ b/nf_core/modules/info.py @@ -55,8 +55,8 @@ class ModuleInfo(ModuleCommand): Take the parsed meta.yml and generate rich help """ - def __init__(self, pipeline_dir, tool, remote_url, branch, no_pull, base_path): - super().__init__(pipeline_dir, remote_url, branch, no_pull, base_path) + def __init__(self, pipeline_dir, tool, remote_url, branch, no_pull): + super().__init__(pipeline_dir, remote_url, branch, no_pull) self.meta = None self.local_path = None self.remote_location = None diff --git a/nf_core/modules/install.py b/nf_core/modules/install.py index 6f013ce3b..926d8e93a 100644 --- a/nf_core/modules/install.py +++ b/nf_core/modules/install.py @@ -23,19 +23,8 @@ def __init__( remote_url=None, branch=None, no_pull=False, - base_path=None, ): - # Check if we are given a base path, otherwise look in the modules.json - if base_path is None: - try: - modules_json = ModulesJson(pipeline_dir) - repo_name = nf_core.modules.module_utils.path_from_remote(remote_url) - base_path = modules_json.get_base_path(repo_name) - except: - # We don't want to fail yet if the modules.json is not found - pass - - super().__init__(pipeline_dir, remote_url, branch, no_pull, base_path) + super().__init__(pipeline_dir, remote_url, branch, no_pull) self.force = force self.prompt = prompt self.sha = sha diff --git a/nf_core/modules/lint/__init__.py b/nf_core/modules/lint/__init__.py index 8fb6fecc2..3910ef829 100644 --- a/nf_core/modules/lint/__init__.py +++ b/nf_core/modules/lint/__init__.py @@ -64,7 +64,7 @@ class ModuleLint(ModuleCommand): from .module_todos import module_todos from .module_version import module_version - def __init__(self, dir, fail_warned=False, remote_url=None, branch=None, no_pull=False, base_path=None): + def __init__(self, dir, fail_warned=False, remote_url=None, branch=None, no_pull=False): self.dir = dir try: self.dir, self.repo_type = nf_core.modules.module_utils.get_repo_type(self.dir) @@ -75,7 +75,7 @@ def __init__(self, dir, fail_warned=False, remote_url=None, branch=None, no_pull self.passed = [] self.warned = [] self.failed = [] - self.modules_repo = ModulesRepo(remote_url, branch, no_pull, base_path) + self.modules_repo = ModulesRepo(remote_url, branch, no_pull) self.lint_tests = self.get_all_lint_tests(self.repo_type == "pipeline") if self.repo_type == "pipeline": diff --git a/nf_core/modules/list.py b/nf_core/modules/list.py index cc99c406d..1c6a15112 100644 --- a/nf_core/modules/list.py +++ b/nf_core/modules/list.py @@ -11,8 +11,8 @@ class ModuleList(ModuleCommand): - def __init__(self, pipeline_dir, remote=True, remote_url=None, branch=None, no_pull=False, base_path=None): - super().__init__(pipeline_dir, remote_url, branch, no_pull, base_path) + def __init__(self, pipeline_dir, remote=True, remote_url=None, branch=None, no_pull=False): + super().__init__(pipeline_dir, remote_url, branch, no_pull) self.remote = remote def list_modules(self, keywords=None, print_json=False): @@ -103,7 +103,6 @@ def pattern_msg(keywords): # pass repo_name to get info on modules even outside nf-core/modules message, date = ModulesRepo( remote_url=repo_entry["git_url"], - base_path=repo_entry["base_path"], branch=module_entry["branch"], ).get_commit_info(version_sha) except LookupError as e: diff --git a/nf_core/modules/modules_command.py b/nf_core/modules/modules_command.py index 9f82c5bfa..9d2798e4b 100644 --- a/nf_core/modules/modules_command.py +++ b/nf_core/modules/modules_command.py @@ -19,11 +19,11 @@ class ModuleCommand: Base class for the 'nf-core modules' commands """ - def __init__(self, dir, remote_url=None, branch=None, no_pull=False, base_path=None): + def __init__(self, dir, remote_url=None, branch=None, no_pull=False): """ Initialise the ModulesCommand object """ - self.modules_repo = ModulesRepo(remote_url, branch, no_pull, base_path) + self.modules_repo = ModulesRepo(remote_url, branch, no_pull) self.dir = dir try: if self.dir: diff --git a/nf_core/modules/modules_json.py b/nf_core/modules/modules_json.py index 72e1da450..edf1ca2a3 100644 --- a/nf_core/modules/modules_json.py +++ b/nf_core/modules/modules_json.py @@ -65,18 +65,16 @@ def create(self): if "main.nf" in file_names ], repo_remote, - base_path, ) - for repo_name, (repo_remote, base_path) in repos.items() + for repo_name, repo_remote in repos.items() ] - for repo_name, module_names, remote_url, base_path in sorted(repo_module_names): + for repo_name, module_names, remote_url in sorted(repo_module_names): modules_json["repos"][repo_name] = {} modules_json["repos"][repo_name]["git_url"] = remote_url modules_json["repos"][repo_name]["modules"] = {} - modules_json["repos"][repo_name]["base_path"] = base_path modules_json["repos"][repo_name]["modules"] = self.determine_module_branches_and_shas( - repo_name, remote_url, base_path, module_names + repo_name, remote_url, module_names ) modules_json_path = Path(self.dir, "modules.json") @@ -102,10 +100,9 @@ def get_pipeline_module_repositories(self, modules_dir, repos=None): # Check if there are any nf-core modules installed if (modules_dir / nf_core.modules.modules_repo.NF_CORE_MODULES_NAME).exists(): - repos[nf_core.modules.modules_repo.NF_CORE_MODULES_NAME] = ( - nf_core.modules.modules_repo.NF_CORE_MODULES_REMOTE, - nf_core.modules.modules_repo.NF_CORE_MODULES_BASE_PATH, - ) + repos[ + nf_core.modules.modules_repo.NF_CORE_MODULES_NAME + ] = nf_core.modules.modules_repo.NF_CORE_MODULES_REMOTE # The function might rename some directories, keep track of them renamed_dirs = {} # Check if there are any untracked repositories @@ -153,16 +150,7 @@ def get_pipeline_module_repositories(self, modules_dir, repos=None): else: continue - # Prompt the user for the modules base path in the remote - nrepo_base_path = questionary.text( - f"Please provide the path of the modules directory in the remote. " - f"Will default to '{nf_core.modules.modules_repo.NF_CORE_MODULES_BASE_PATH}' if left empty.", - style=nf_core.utils.nfcore_question_style, - ).unsafe_ask() - if not nrepo_base_path: - nrepo_base_path = nf_core.modules.modules_repo.NF_CORE_MODULES_BASE_PATH - - repos[nrepo_name] = (nrepo_remote, nrepo_base_path) + repos[nrepo_name] = (nrepo_remote, "modules") dirs_not_covered = self.dir_tree_uncovered(modules_dir, [Path(name) for name in repos]) return repos, renamed_dirs @@ -201,7 +189,7 @@ def dir_tree_uncovered(self, modules_dir, repos): depth += 1 return dirs_not_covered - def determine_module_branches_and_shas(self, repo_name, remote_url, base_path, modules): + def determine_module_branches_and_shas(self, repo_name, remote_url, modules): """ Determines what branch and commit sha each module in the pipeline belong to @@ -211,7 +199,6 @@ def determine_module_branches_and_shas(self, repo_name, remote_url, base_path, m Args: repo_name (str): The name of the module repository remote_url (str): The url to the remote repository - base_path (Path): The base path in the remote modules_base_path (Path): The path to the modules directory in the pipeline modules ([str]): List of names of installed modules from the repository @@ -219,7 +206,7 @@ def determine_module_branches_and_shas(self, repo_name, remote_url, base_path, m (dict[str, dict[str, str]]): The module.json entries for the modules from the repository """ - default_modules_repo = nf_core.modules.modules_repo.ModulesRepo(remote_url=remote_url, base_path=base_path) + default_modules_repo = nf_core.modules.modules_repo.ModulesRepo(remote_url=remote_url) repo_path = self.modules_dir / repo_name # Get the branches present in the repository, as well as the default branch available_branches = nf_core.modules.modules_repo.ModulesRepo.get_remote_branches(remote_url) @@ -266,7 +253,7 @@ def determine_module_branches_and_shas(self, repo_name, remote_url, base_path, m break # Create a new modules repo with the selected branch, and retry find the sha modules_repo = nf_core.modules.modules_repo.ModulesRepo( - remote_url=remote_url, base_path=base_path, branch=branch, no_pull=True, no_progress=True + remote_url=remote_url, branch=branch, no_pull=True, no_progress=True ) else: found_sha = True @@ -375,27 +362,26 @@ def unsynced_modules(self): return untracked_dirs, missing_installation - def has_git_url_and_base_path(self): + def has_git_url(self): """ Check that that all repo entries in the modules.json - has a git url and a base_path + has a git url Returns: (bool): True if they are found for all repos, False otherwise """ for repo_entry in self.modules_json.get("repos", {}).values(): - if "git_url" not in repo_entry or "base_path" not in repo_entry: + if "git_url" not in repo_entry: return False return True - def reinstall_repo(self, repo_name, remote_url, base_path, module_entries): + def reinstall_repo(self, repo_name, remote_url, module_entries): """ Reinstall modules from a repository Args: repo_name (str): The name of the repository remote_url (str): The git url of the remote repository - base_path (Path): The base path in the repository modules ([ dict[str, dict[str, str]] ]): Module entries with branch and git sha info @@ -416,9 +402,7 @@ def reinstall_repo(self, repo_name, remote_url, base_path, module_entries): for branch, modules in branches_and_mods.items(): try: - modules_repo = nf_core.modules.modules_repo.ModulesRepo( - remote_url=remote_url, branch=branch, base_path=base_path - ) + modules_repo = nf_core.modules.modules_repo.ModulesRepo(remote_url=remote_url, branch=branch) except LookupError as e: log.error(e) failed_to_install.extend(modules) @@ -441,7 +425,7 @@ def check_up_to_date(self): the commit log in the remote to try to determine the SHA. """ self.load() - if not self.has_git_url_and_base_path(): + if not self.has_git_url(): raise UserWarning( "The 'modules.json' file is not up to date. " "Please reinstall it by removing it and rerunning the command." @@ -465,8 +449,7 @@ def check_up_to_date(self): for repo, contents in missing_installation.items(): module_entries = contents["modules"] remote_url = contents["git_url"] - base_path = contents["base_path"] - remove_from_mod_json[repo] = self.reinstall_repo(repo, remote_url, base_path, module_entries) + remove_from_mod_json[repo] = self.reinstall_repo(repo, remote_url, module_entries) # If the reinstall fails, we remove those entries in 'modules.json' if sum(map(len, remove_from_mod_json.values())) > 0: @@ -499,8 +482,7 @@ def check_up_to_date(self): # Get the remotes we are missing tracked_repos = { - repo_name: (repo_entry["git_url"], repo_entry["base_path"]) - for repo_name, repo_entry in self.modules_json["repos"].items() + repo_name: (repo_entry["git_url"]) for repo_name, repo_entry in self.modules_json["repos"].items() } repos, _ = self.get_pipeline_module_repositories(self.modules_dir, tracked_repos) @@ -518,14 +500,13 @@ def check_up_to_date(self): repos_with_modules[repo_name].append(module) for repo_name, modules in repos_with_modules.items(): - remote_url, base_path = repos[repo_name] - repo_entry = self.determine_module_branches_and_shas(repo_name, remote_url, base_path, modules) + remote_url = repos[repo_name] + repo_entry = self.determine_module_branches_and_shas(repo_name, remote_url, modules) if repo_name in self.modules_json["repos"]: self.modules_json["repos"][repo_name]["modules"].update(repo_entry) else: self.modules_json["repos"][repo_name] = { "git_url": remote_url, - "base_path": base_path, "modules": repo_entry, } @@ -561,10 +542,9 @@ def update(self, modules_repo, module_name, module_version, write_file=True): self.load() repo_name = modules_repo.fullname remote_url = modules_repo.remote_url - base_path = modules_repo.base_path branch = modules_repo.branch if repo_name not in self.modules_json["repos"]: - self.modules_json["repos"][repo_name] = {"modules": {}, "git_url": remote_url, "base_path": base_path} + self.modules_json["repos"][repo_name] = {"modules": {}, "git_url": remote_url} repo_modules_entry = self.modules_json["repos"][repo_name]["modules"] if module_name not in repo_modules_entry: repo_modules_entry[module_name] = {} @@ -741,19 +721,6 @@ def get_git_url(self, repo_name): self.load() return self.modules_json.get("repos", {}).get(repo_name, {}).get("git_url", None) - def get_base_path(self, repo_name): - """ - Returns the modules base path of a repo - Args: - repo_name (str): Name of the repository - - Returns: - (str): The base path of the repository if it exists, None otherwise - """ - if self.modules_json is None: - self.load() - return self.modules_json.get("repos", {}).get(repo_name, {}).get("base_path", None) - def get_all_modules(self): """ Retrieves all pipeline modules that are reported in the modules.json diff --git a/nf_core/modules/modules_repo.py b/nf_core/modules/modules_repo.py index 8b00d1cb3..2a559b111 100644 --- a/nf_core/modules/modules_repo.py +++ b/nf_core/modules/modules_repo.py @@ -17,7 +17,6 @@ # Constants for the nf-core/modules repo used throughout the module files NF_CORE_MODULES_NAME = "nf-core/modules" NF_CORE_MODULES_REMOTE = "https://github.com/nf-core/modules.git" -NF_CORE_MODULES_BASE_PATH = "modules" NF_CORE_MODULES_DEFAULT_BRANCH = "master" @@ -112,7 +111,7 @@ def get_remote_branches(remote_url): branches[sha] = branch_name return set(branches.values()) - def __init__(self, remote_url=None, branch=None, no_pull=False, base_path=None, no_progress=False): + def __init__(self, remote_url=None, branch=None, no_pull=False, no_progress=False): """ Initializes the object and clones the git repository if it is not already present """ @@ -128,11 +127,6 @@ def __init__(self, remote_url=None, branch=None, no_pull=False, base_path=None, self.fullname = nf_core.modules.module_utils.path_from_remote(self.remote_url) - if base_path is None: - base_path = NF_CORE_MODULES_BASE_PATH - - self.base_path = base_path - self.setup_local_repo(remote_url, branch, no_progress) # Verify that the repo seems to be correctly configured @@ -140,7 +134,7 @@ def __init__(self, remote_url=None, branch=None, no_pull=False, base_path=None, self.verify_branch() # Convenience variable - self.modules_dir = os.path.join(self.local_repo_dir, self.base_path) + self.modules_dir = os.path.join(self.local_repo_dir, "modules") self.avail_module_names = None @@ -252,8 +246,12 @@ def verify_branch(self): Verifies the active branch conforms do the correct directory structure """ dir_names = os.listdir(self.local_repo_dir) - if self.base_path not in dir_names: - err_str = f"Repository '{self.fullname}' ({self.branch}) does not contain the '{self.base_path}' directory" + if "modules" not in dir_names: + err_str = f"Repository '{self.fullname}' ({self.branch}) does not contain the 'modules/' directory" + if "software" in dir_names: + err_str += ( + ".\nAs of nf-core/tools version 2.0, the 'software/' directory should be renamed to 'modules/'" + ) raise LookupError(err_str) def checkout_branch(self): @@ -368,7 +366,7 @@ def get_module_git_log(self, module_name, depth=None, since="2021-07-07T00:00:00 ( dict ): Iterator of commit SHAs and associated (truncated) message """ self.checkout_branch() - module_path = os.path.join(self.base_path, module_name) + module_path = os.path.join("modules", module_name) commits = self.repo.iter_commits(max_count=depth, paths=module_path) commits = ({"git_sha": commit.hexsha, "trunc_message": commit.message.partition("\n")[0]} for commit in commits) return commits diff --git a/nf_core/modules/patch.py b/nf_core/modules/patch.py index 8827ed711..b907256bc 100644 --- a/nf_core/modules/patch.py +++ b/nf_core/modules/patch.py @@ -16,8 +16,8 @@ class ModulePatch(ModuleCommand): - def __init__(self, dir, remote_url=None, branch=None, no_pull=False, base_path=None): - super().__init__(dir, remote_url, branch, no_pull, base_path) + def __init__(self, dir, remote_url=None, branch=None, no_pull=False): + super().__init__(dir, remote_url, branch, no_pull) self.modules_json = ModulesJson(dir) diff --git a/nf_core/modules/update.py b/nf_core/modules/update.py index a1841d24b..4644c2398 100644 --- a/nf_core/modules/update.py +++ b/nf_core/modules/update.py @@ -31,9 +31,8 @@ def __init__( remote_url=None, branch=None, no_pull=False, - base_path=None, ): - super().__init__(pipeline_dir, remote_url, branch, no_pull, base_path) + super().__init__(pipeline_dir, remote_url, branch, no_pull) self.force = force self.prompt = prompt self.sha = sha @@ -421,7 +420,6 @@ def get_all_modules_info(self, branch=None): repo_name, self.modules_json.get_git_url(repo_name), branch, - self.modules_json.get_base_path(repo_name), mods_shas, ) for (repo_name, branch), mods_shas in repos_and_branches.items() @@ -429,9 +427,9 @@ def get_all_modules_info(self, branch=None): # Create ModulesRepo objects repo_objs_mods = [] - for repo_name, repo_url, branch, base_path, mods_shas in modules_info: + for repo_name, repo_url, branch, mods_shas in modules_info: try: - modules_repo = ModulesRepo(remote_url=repo_url, branch=branch, base_path=base_path) + modules_repo = ModulesRepo(remote_url=repo_url, branch=branch) except LookupError as e: log.warning(e) log.info(f"Skipping modules in '{repo_name}'") diff --git a/nf_core/pipeline-template/modules.json b/nf_core/pipeline-template/modules.json index a14671c6e..9c8d724ae 100644 --- a/nf_core/pipeline-template/modules.json +++ b/nf_core/pipeline-template/modules.json @@ -3,7 +3,6 @@ "homePage": "https://github.com/{{ name }}", "repos": { "nf-core/modules": { - "base_path": "modules", "git_url": "https://github.com/nf-core/modules.git", "modules": { "custom/dumpsoftwareversions": { diff --git a/requirements.txt b/requirements.txt index 67ee9f79a..0a4a5fb7e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,6 +10,7 @@ pytest>=7.0.0 pytest-workflow>=1.6.0 pyyaml questionary>=1.8.0 +refgenie requests requests_cache rich-click>=1.0.0 diff --git a/tests/modules/modules_json.py b/tests/modules/modules_json.py index 616ca205a..7e9d211f3 100644 --- a/tests/modules/modules_json.py +++ b/tests/modules/modules_json.py @@ -5,7 +5,6 @@ from nf_core.modules.modules_json import ModulesJson from nf_core.modules.modules_repo import ( - NF_CORE_MODULES_BASE_PATH, NF_CORE_MODULES_DEFAULT_BRANCH, NF_CORE_MODULES_NAME, NF_CORE_MODULES_REMOTE, @@ -201,13 +200,6 @@ def test_mod_json_get_git_url(self): assert mod_json_obj.get_git_url("INVALID_REPO") is None -def test_mod_json_get_base_path(self): - """Tests the get_base_path function""" - mod_json_obj = ModulesJson(self.pipeline_dir) - assert mod_json_obj.get_base_path(NF_CORE_MODULES_NAME) == NF_CORE_MODULES_BASE_PATH - assert mod_json_obj.get_base_path("INVALID_REPO") is None - - def test_mod_json_dump(self): """Tests the dump function""" mod_json_obj = ModulesJson(self.pipeline_dir) diff --git a/tests/test_modules.py b/tests/test_modules.py index b4ec2ab3e..c8dbf948f 100644 --- a/tests/test_modules.py +++ b/tests/test_modules.py @@ -134,7 +134,6 @@ def test_modulesrepo_class(self): test_mod_json_create, test_mod_json_create_with_patch, test_mod_json_dump, - test_mod_json_get_base_path, test_mod_json_get_git_url, test_mod_json_get_module_version, test_mod_json_module_present,