-
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
Automatically create modules directory #2565
Conversation
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 |
nf_core/modules/modules_json.py
Outdated
@@ -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}'") |
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.
not sure if that should just happen automatically, for people still using DSL1 pipelines. could we instead of only logging, prompt for a confirmation?
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.
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.")
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.
Perfect!
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.
LGTM!
Codecov ReportAttention:
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. |
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
CHANGELOG.md
is updateddocs
is updated