Skip to content

Add uv process directive for Python package management#7023

Open
evanroyrees wants to merge 2 commits intonextflow-io:masterfrom
evanroyrees:feature/uv-directive
Open

Add uv process directive for Python package management#7023
evanroyrees wants to merge 2 commits intonextflow-io:masterfrom
evanroyrees:feature/uv-directive

Conversation

@evanroyrees
Copy link
Copy Markdown

@evanroyrees evanroyrees commented Apr 10, 2026

Summary

Add a new uv process directive for managing Python dependencies via the uv package manager, following the existing conda and spack directive patterns.

Supports inline packages and requirements files:

process FOO {
    uv 'numpy pandas'
}

process BAR {
    uv "${moduleDir}/requirements.txt"
}

Changes

  • UvConfig / UvCache — config scope and environment creation/caching
  • Process directive registration, task execution integration (TaskBean, TaskRun, BashWrapperBuilder)
  • Task hashing, lineage tracking, job array support
  • CLI options (-with-uv / -without-uv), config builder, launcher arg normalization
  • Environment variables (NXF_UV_ENABLED, NXF_UV_CACHEDIR)
  • Documentation (process directive, config scope, env vars, docs/uv.md)
  • Tests for all new and modified components

Signed-off-by: Evan Rees evanroyrees@gmail.com

evanroyrees and others added 2 commits April 10, 2026 11:23
Add a new `uv` process directive that allows Nextflow processes to
declare Python dependencies managed by the uv package manager, following
the same pattern as the existing `conda` and `spack` directives.

The directive accepts package names, requirements.txt files,
pyproject.toml files, or paths to existing virtual environments.
Nextflow automatically creates, caches, and activates uv virtual
environments for each unique set of dependencies.

Includes CLI options (-with-uv / -without-uv), configuration scope
(uv.enabled, uv.cacheDir, uv.pythonVersion, etc.), environment
variables (NXF_UV_ENABLED, NXF_UV_CACHEDIR), lineage tracking,
task hash integration, tests, and documentation.

Signed-off-by: Evan Rees <evanroyrees@gmail.com>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add the missing `uv` positional argument to all lineage
model TaskRun constructor calls in tests that were missed
in the initial commit (LinObserverTest, CmdLineageTest).

Signed-off-by: Evan Rees <evanroyrees@gmail.com>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@evanroyrees evanroyrees requested a review from a team as a code owner April 10, 2026 17:04
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 10, 2026

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit bfd069f
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/69d92ea5b385540008321755

@evanroyrees evanroyrees force-pushed the feature/uv-directive branch from b6edfb1 to bfd069f Compare April 10, 2026 17:08
@bentsherman
Copy link
Copy Markdown
Member

Thanks for the contribution, but I think we're going to hold off on adding new directives for each Python package manager. Instead we're looking into a generic package directive with multiple providers: #6342

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.

2 participants