Skip to content

feat: extract() archives from local paths, URLs and S3 - #102

Merged
maxulysse merged 12 commits into
nf-core:mainfrom
maxulysse:feat/extract
Nov 13, 2026
Merged

maxulysse merged 12 commits into
nf-core:mainfrom
maxulysse:feat/extract

Conversation

@maxulysse

@maxulysse maxulysse commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Rename curlAndExtract() to extract() and let it read local paths and any URL Nextflow can read, so module tests can extract test data from params.modules_testdata_base_path, local or remote, instead of running an UNZIP setup process.

  • extract(source, extractDir: ..., compression: ...): both named arguments optional, unknown ones throw; without extractDir it extracts into a temporary directory deleted when nf-test exits; returns the extraction directory
  • Local paths and file:// URLs are extracted in place; other URLs (http(s), ftp, s3, ...) are downloaded with nextflow fs cp instead of curl, to a temporary file deleted once extracted
  • curlAndExtract(): deprecated alias in Methods that prints a warning (used by nf-core/taxprofiler)
  • ArchiveDownloader renamed ArchiveExtractor; extractCommand() builds the unzip/tar command, and tar reads the archive with -f instead of stdin, so a missing local file fails with "Failed to extract" for both formats
  • downloadFromS3() reports failures through the same runOrThrow() as extract()
  • NfCoreUtils.deleteDirectory() moved to Utils for the temporary directory cleanup
  • Tests: tests/curlAndExtract renamed tests/extract, with local path, S3 and default temporary directory cases; unit tests for local paths, file:// URLs, the default directory, named and unknown options
  • docs/usage.md, README.md, CHANGELOG.md updated

Tested: mise run validate (40 unit tests, 0 Checkstyle violations; tests/extract and tests/getAllFilesFromPath nf-tests).

🤖 Generated with Claude Code

maxulysse and others added 3 commits November 12, 2026 13:47
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
maxulysse and others added 4 commits November 12, 2026 15:21
Without dest, extract() uses a temporary directory deleted at exit;
it returns the directory either way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r a valid type

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@muffato muffato left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Two small comments

maxulysse and others added 2 commits November 12, 2026 16:35
…w fs cp

Drops curl: nextflow fs cp reads http(s), ftp and cloud URLs, and fails
on HTTP errors and truncated transfers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@maxulysse
maxulysse requested a review from muffato November 12, 2026 15:41
maxulysse and others added 3 commits November 12, 2026 16:42
… fs cp

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@prototaxites prototaxites left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving for @muffato

@maxulysse
maxulysse merged commit 507677f into nf-core:main Nov 13, 2026
5 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