Skip to content

Commit

Permalink
Don't use is_relative_to for backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikDanielsson committed Aug 2, 2022
1 parent cd8a599 commit f2bd50b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nf_core/modules/modules_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_pipeline_modules(self, local=False):
module_relpaths = (
Path(dir).relative_to(module_base_path)
for dir, _, files in os.walk(module_base_path)
if "main.nf" in files and not Path(dir).relative_to(module_base_path).is_relative_to("local")
if "main.nf" in files and not str(Path(dir).relative_to(module_base_path)).startswith("local")
)
# The two highest directories are the repo owner and repo name. The rest is the module name
repos_and_modules = (("/".join(dir.parts[:2]), "/".join(dir.parts[2:])) for dir in module_relpaths)
Expand Down
5 changes: 3 additions & 2 deletions nf_core/modules/nfcore_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ def __init__(self, module_name, repo_name, module_dir, repo_type, base_dir, nf_c
self.is_patched = True
self.patch_path = patch_path
else:
# The main file is just the local module
self.main_nf = self.module_dir
self.module_name = self.module_dir.stem
# These attributes are only used by nf-core modules
# so just initialize them to None
self.module_name = None
self.main_nf = None
self.meta_yml = None
self.test_dir = None
self.test_yml = None
Expand Down

0 comments on commit f2bd50b

Please sign in to comment.