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:
|
| tmp.cleanup() | ||
| except: # noqa: E722 | ||
| os.chdir(original_dir) | ||
| tmp.cleanup() |
There was a problem hiding this comment.
I don't think the cleanup is needed, because tempfile should take care of that already
There was a problem hiding this comment.
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.
but then you don't need tmp.cleanup(), it will be removed anyway.
There was a problem hiding this comment.
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.mdis updateddocsis updated