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

Automatically create modules directory #2565

Merged
merged 8 commits into from
Dec 15, 2023

Conversation

krokicki
Copy link
Contributor

@krokicki krokicki commented Dec 8, 2023

Addresses #2563 to automatically create a ./modules dir when necessary for installing modules.

Combined with #2562, this allows easy installation of nf-core modules and subworkflows into non-nf-core pipelines, and reduces friction for reuse.

PR checklist

  • This comment contains a description of changes (with reason)
  • CHANGELOG.md is updated
  • If you've fixed a bug or added code that should be tested, add tests!
  • Documentation in docs is updated

@mashehu
Copy link
Contributor

mashehu commented Dec 8, 2023

sorry, somehow your checks have been picked up by the aws runners, which produce weird errors at the moment. I am working on a fix, so don't mind some checks failing at the moment

@@ -67,7 +67,8 @@ def create(self):
new_modules_json = {"name": pipeline_name.strip("'"), "homePage": pipeline_url.strip("'"), "repos": {}}

if not self.modules_dir.exists():
raise UserWarning("Can't find a ./modules directory. Is this a DSL2 pipeline?")
log.info(f"Creating ./modules directory in '{self.dir}'")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if that should just happen automatically, for people still using DSL1 pipelines. could we instead of only logging, prompt for a confirmation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's no problem to add a prompt, but I don't know what DSL1 users are expecting, since I never used nf-core with DSL1.

How about this?

Can't find a ./modules directory. Would you like me to create one? [y/n] (y)
if y -> Creating ./modules directory in '{self.dir}'
if n -> UserWarning("Cannot proceed without ./modules directory.")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!

Copy link
Member

@mirpedrol mirpedrol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link

codecov bot commented Dec 14, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (4e647d6) 75.04% compared to head (2673ce9) 75.05%.
Report is 6 commits behind head on dev.

Files Patch % Lines
nf_core/modules/modules_json.py 20.00% 4 Missing ⚠️
nf_core/utils.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2565      +/-   ##
==========================================
+ Coverage   75.04%   75.05%   +0.01%     
==========================================
  Files          85       85              
  Lines        9367     9371       +4     
==========================================
+ Hits         7029     7033       +4     
  Misses       2338     2338              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mirpedrol mirpedrol merged commit 9414faf into nf-core:dev Dec 15, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants