-
Notifications
You must be signed in to change notification settings - Fork 192
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
Modules restructure #1859
Merged
Merged
Modules restructure #1859
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
6cfe78e
change path for testing module structure
mirpedrol ae958d1
change module folder structure from pipeline template
mirpedrol 1c8e634
change path from pipeline template
mirpedrol 11e5d0d
change path from module_utils
mirpedrol ac38a14
change paths added to pytest_modules.yml
mirpedrol 5235405
modify modules create command
mirpedrol 05f1cb4
fix create-test-yml
mirpedrol 7a2d46e
add variables to ModuleCommand
mirpedrol e2ec9a7
fix paths for linting modules
mirpedrol a7d62a3
fix paths for bump-versions
mirpedrol 3cd1336
try to add any custom folder as nf-core inside modules
mirpedrol 139818f
modules_json.py working (hopefully)
mirpedrol 2d40c7e
lint bug fixed but lint not passing :(
mirpedrol cb7e95a
pipeline linting passing
mirpedrol 2433fe8
modify modules structure with two levels modules/nf-core or modules/c…
mirpedrol 4cc55e5
fix some pytests
mirpedrol 8366a77
more tests fixed
mirpedrol f7bdf41
fix sha tests
mirpedrol 58f1491
fix gitlab workflow
mirpedrol 94231c4
fix linting
mirpedrol 3a02093
gitlab force
mirpedrol e96386e
fix yaml sha
mirpedrol dd7fb4f
fix isort
mirpedrol aa0e6c8
Merge branch 'dev' into modules-restructure
mirpedrol 79a48fd
remove branch and url from specific modules command
mirpedrol 9ddc614
update changelog
mirpedrol 683568a
change nf-core/modules branch to master
mirpedrol cb0ab31
change sha for master branch
mirpedrol ee8459a
update custom/dumpsoftwareversions to last commit
mirpedrol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
|
||
import logging | ||
import re | ||
from pathlib import Path | ||
|
||
import questionary | ||
import rich | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,7 +93,8 @@ def init_mod_name(self, module): | |
if self.repo_type == "modules": | ||
modules = self.get_modules_clone_modules() | ||
else: | ||
modules = self.modules_json.get_all_modules().get(self.modules_repo.fullname) | ||
modules = self.modules_json.get_all_modules().get(self.modules_repo.remote_url) | ||
modules = [module if dir == "nf-core" else f"{dir}/{module}" for dir, module in modules] | ||
if modules is None: | ||
raise UserWarning(f"No modules installed from '{self.modules_repo.remote_url}'") | ||
else: | ||
|
@@ -135,15 +136,17 @@ def get_local_yaml(self): | |
|
||
if self.repo_type == "pipeline": | ||
# Try to find and load the meta.yml file | ||
repo_name = self.modules_repo.fullname | ||
module_base_path = os.path.join(self.dir, "modules", repo_name) | ||
repo_name = self.modules_repo.repo_path | ||
module_base_path = os.path.join(self.dir, "modules") | ||
# Check that we have any modules installed from this repo | ||
modules = self.modules_json.get_all_modules().get(repo_name) | ||
modules = self.modules_json.get_all_modules().get(self.modules_repo.remote_url) | ||
module_names = [module for _, module in modules] | ||
if modules is None: | ||
raise LookupError(f"No modules installed from {self.modules_repo.remote_url}") | ||
|
||
if self.module in modules: | ||
mod_dir = os.path.join(module_base_path, self.module) | ||
if self.module in module_names: | ||
install_dir = [dir for dir, module in modules if module == self.module][0] | ||
mod_dir = os.path.join(module_base_path, install_dir, self.module) | ||
meta_fn = os.path.join(mod_dir, "meta.yml") | ||
if os.path.exists(meta_fn): | ||
log.debug(f"Found local file: {meta_fn}") | ||
|
@@ -153,7 +156,7 @@ def get_local_yaml(self): | |
|
||
log.debug(f"Module '{self.module}' meta.yml not found locally") | ||
else: | ||
module_base_path = os.path.join(self.dir, "modules") | ||
module_base_path = os.path.join(self.dir, "modules", "nf-core") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above, hardcoded |
||
if self.module in os.listdir(module_base_path): | ||
mod_dir = os.path.join(module_base_path, self.module) | ||
meta_fn = os.path.join(mod_dir, "meta.yml") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading quickly so can't see the full context, but why do we need special treatment for
nf-core
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to get the module name suggestions, it will usually be nf-core, so we don't need to have
nf-core/TOOL
, but in case you have modules from other repos I thought it would be nice to differentiate and have the other directory listed.