-
Notifications
You must be signed in to change notification settings - Fork 214
Fix Issues/3729: Cleanup nextflow files / directories after pipeline download #3750
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
Fix Issues/3729: Cleanup nextflow files / directories after pipeline download #3750
Conversation
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
nf_core/pipelines/download/utils.py
Outdated
tmp.cleanup() | ||
except: # noqa: E722 | ||
os.chdir(original_dir) | ||
tmp.cleanup() |
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.
I don't think the cleanup is needed, because tempfile should take care of that already
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.
Yes :) The use of Tempdir is what was added in this PR. This solves the cleaning up in a nice way.
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.
but then you don't need tmp.cleanup(), it will be removed anyway.
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.
Ah right, sorry 🤦 I also was looking in the wrong function for a second, thinking we reference tmp
outside the with
context ...
Changed!
Co-authored-by: Matthias Hörtenhuber <mashehu@users.noreply.github.com>
Closes #3729
Adds a new context manager for creating and stepping into a temporary directory handles cleanup and stepping back upon errors. Wraps this around the call to
nextflow inspect
.PR checklist
CHANGELOG.md
is updateddocs
is updated