uv
No long description provided.
Installation
dagger install github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480Entrypoint
Return Type
Uv !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | Source directory. |
Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
func (m *MyModule) Example() *dagger.Uv {
return dag.
Uv()
}@function
def example() -> dagger.Uv:
return (
dag.uv()
)@func()
example(): Uv {
return dag
.uv()
}Types
Audit 🔗
Runs ``uv audit`` for a single workspace in a given uv image.
uvLock() 🔗
The workspace’s uv.lock file.
Return Type
File ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
audit \
uv-lockfunc (m *MyModule) Example(path string) *dagger.File {
return dag.
Uv().
Workspace(path).
Audit().
UvLock()
}@function
def example(path: str) -> dagger.File:
return (
dag.uv()
.workspace(path)
.audit()
.uv_lock()
)@func()
example(path: string): File {
return dag
.uv()
.workspace(path)
.audit()
.uvLock()
}pyproject() 🔗
The workspace’s pyproject.toml file.
Return Type
File ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
audit \
pyprojectfunc (m *MyModule) Example(path string) *dagger.File {
return dag.
Uv().
Workspace(path).
Audit().
Pyproject()
}@function
def example(path: str) -> dagger.File:
return (
dag.uv()
.workspace(path)
.audit()
.pyproject()
)@func()
example(path: string): File {
return dag
.uv()
.workspace(path)
.audit()
.pyproject()
}image() 🔗
uv image reference to run the audit in (must provide a
uvbinary).
Return Type
String ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
audit \
imagefunc (m *MyModule) Example(ctx context.Context, path string) string {
return dag.
Uv().
Workspace(path).
Audit().
Image(ctx)
}@function
async def example(path: str) -> str:
return await (
dag.uv()
.workspace(path)
.audit()
.image()
)@func()
async example(path: string): Promise<string> {
return dag
.uv()
.workspace(path)
.audit()
.image()
}uvToml() 🔗
The workspace’s uv.toml configuration file, if present.
Return Type
File Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
audit \
uv-tomlfunc (m *MyModule) Example(path string) *dagger.File {
return dag.
Uv().
Workspace(path).
Audit().
UvToml()
}@function
def example(path: str) -> dagger.File:
return (
dag.uv()
.workspace(path)
.audit()
.uv_toml()
)@func()
example(path: string): File {
return dag
.uv()
.workspace(path)
.audit()
.uvToml()
}run() 🔗
Run uv audit --frozen for this workspace.
Audits straight from the committed uv.lock without re-resolving against
package indexes (--frozen); vulnerability data comes from the public
OSV service, so no index credentials are required. A failing audit
(non-zero exit, e.g. vulnerabilities found) raises dagger.ExecError,
whose stdout/stderr carry uv’s report; the runner folds that into
the trace error (see Uv.audit).
Return Type
Void ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
audit \
runfunc (m *MyModule) Example(ctx context.Context, path string) {
return dag.
Uv().
Workspace(path).
Audit().
Run(ctx)
}@function
async def example(path: str) -> None:
return await (
dag.uv()
.workspace(path)
.audit()
.run()
)@func()
async example(path: string): Promise<void> {
return dag
.uv()
.workspace(path)
.audit()
.run()
}LocalPackage 🔗
A local (editable/directory) package in a uv workspace.
name() 🔗
Package name
Return Type
String ! Example
Function UvLocalPackage.name is not accessible from the uv moduleFunction UvLocalPackage.name is not accessible from the uv moduleFunction UvLocalPackage.name is not accessible from the uv moduleFunction UvLocalPackage.name is not accessible from the uv modulepath() 🔗
Workspace-relative path
Return Type
String ! Example
Function UvLocalPackage.path is not accessible from the uv moduleFunction UvLocalPackage.path is not accessible from the uv moduleFunction UvLocalPackage.path is not accessible from the uv moduleFunction UvLocalPackage.path is not accessible from the uv modulemodule() 🔗
Python module name
Return Type
String ! Example
Function UvLocalPackage.module is not accessible from the uv moduleFunction UvLocalPackage.module is not accessible from the uv moduleFunction UvLocalPackage.module is not accessible from the uv moduleFunction UvLocalPackage.module is not accessible from the uv moduleflat() 🔗
Flat layout (module at package root) vs src layout (module under src/)
Return Type
Boolean ! Example
Function UvLocalPackage.flat is not accessible from the uv moduleFunction UvLocalPackage.flat is not accessible from the uv moduleFunction UvLocalPackage.flat is not accessible from the uv moduleFunction UvLocalPackage.flat is not accessible from the uv moduleSyncPlan 🔗
Resolved build configuration for a uv workspace sync.
wsDir() 🔗
Resolved workspace directory (with codegen overlay if applicable)
Return Type
Directory ! Example
Function UvSyncPlan.wsDir is not accessible from the uv moduleFunction UvSyncPlan.wsDir is not accessible from the uv moduleFunction UvSyncPlan.wsDir is not accessible from the uv moduleFunction UvSyncPlan.wsDir is not accessible from the uv moduleallLocal() 🔗
Every local package in the workspace (sorted by name)
Return Type
[LocalPackage ! ] ! Example
Function UvSyncPlan.allLocal is not accessible from the uv moduleFunction UvSyncPlan.allLocal is not accessible from the uv moduleFunction UvSyncPlan.allLocal is not accessible from the uv moduleFunction UvSyncPlan.allLocal is not accessible from the uv moduleneededLocal() 🔗
Local packages the target transitively depends on (sorted by name)
Return Type
[LocalPackage ! ] ! Example
Function UvSyncPlan.neededLocal is not accessible from the uv moduleFunction UvSyncPlan.neededLocal is not accessible from the uv moduleFunction UvSyncPlan.neededLocal is not accessible from the uv moduleFunction UvSyncPlan.neededLocal is not accessible from the uv moduleflatPackages() 🔗
Local packages with no build-system (virtual/deps-only: pyproject scaffolded, source skipped)
Return Type
[String ! ] ! Example
Function UvSyncPlan.flatPackages is not accessible from the uv moduleFunction UvSyncPlan.flatPackages is not accessible from the uv moduleFunction UvSyncPlan.flatPackages is not accessible from the uv moduleFunction UvSyncPlan.flatPackages is not accessible from the uv modulepackages() 🔗
Target package names to install (empty means all packages)
Return Type
[String ! ] ! Example
Function UvSyncPlan.packages is not accessible from the uv moduleFunction UvSyncPlan.packages is not accessible from the uv moduleFunction UvSyncPlan.packages is not accessible from the uv moduleFunction UvSyncPlan.packages is not accessible from the uv moduleuvSyncArgs() 🔗
Precomputed uv sync argv
Return Type
[String ! ] ! Example
Function UvSyncPlan.uvSyncArgs is not accessible from the uv moduleFunction UvSyncPlan.uvSyncArgs is not accessible from the uv moduleFunction UvSyncPlan.uvSyncArgs is not accessible from the uv moduleFunction UvSyncPlan.uvSyncArgs is not accessible from the uv moduleVenv 🔗
A relocatable uv virtual environment bundled with the uv-managed Python it needs. A venv never contains the standard library — ``.venv/bin/python`` resolves to a base interpreter whose ``lib/`` provides it. This pairs the venv with that interpreter so the two can be dropped into a fresh container (one without any Python of its own) and run without uv. Only valid for a venv created with ``with_venv(relocatable=True)`` against a *uv-managed* (standalone) Python: uv's standalone Pythons are themselves relocatable, and a relocatable venv keeps working when its directory is moved. The venv may be mounted at any path, but the Python must be remounted at ``python_path`` (the absolute location its ``pyvenv.cfg`` records). The bundled Python is a glibc build, so the target must be glibc-based (not musl/alpine).
venv() 🔗
The relocatable
.venvdirectory.
Return Type
Directory ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen boolean \
export-venv \
venvfunc (m *MyModule) Example(path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool) *dagger.Directory {
return dag.
Uv().
Workspace(path).
Build(allExtras, allGroups, allPackages, daggerCodegen).
ExportVenv().
Venv()
}@function
def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool) -> dagger.Directory:
return (
dag.uv()
.workspace(path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
.export_venv()
.venv()
)@func()
example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean): Directory {
return dag
.uv()
.workspace(path)
.build(allExtras, allGroups, allPackages, daggerCodegen)
.exportVenv()
.venv()
}python() 🔗
The uv-managed standalone Python the venv links against.
Return Type
Directory ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen boolean \
export-venv \
pythonfunc (m *MyModule) Example(path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool) *dagger.Directory {
return dag.
Uv().
Workspace(path).
Build(allExtras, allGroups, allPackages, daggerCodegen).
ExportVenv().
Python()
}@function
def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool) -> dagger.Directory:
return (
dag.uv()
.workspace(path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
.export_venv()
.python()
)@func()
example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean): Directory {
return dag
.uv()
.workspace(path)
.build(allExtras, allGroups, allPackages, daggerCodegen)
.exportVenv()
.python()
}pythonPath() 🔗
Absolute path the Python must be mounted at for the venv to resolve its interpreter.
Return Type
String ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen boolean \
export-venv \
python-pathfunc (m *MyModule) Example(ctx context.Context, path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool) string {
return dag.
Uv().
Workspace(path).
Build(allExtras, allGroups, allPackages, daggerCodegen).
ExportVenv().
PythonPath(ctx)
}@function
async def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool) -> str:
return await (
dag.uv()
.workspace(path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
.export_venv()
.python_path()
)@func()
async example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean): Promise<string> {
return dag
.uv()
.workspace(path)
.build(allExtras, allGroups, allPackages, daggerCodegen)
.exportVenv()
.pythonPath()
}into() 🔗
Mount the venv (at path) and its Python (at python_path) into container.
With set_env_vars, exports VIRTUAL_ENV and prepends the venv’s bin/
to PATH so python/console scripts resolve without activation;
otherwise the venv is just mounted (run it via <path>/bin/python).
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| container | Container ! | - | Container to add the venv and its Python to. |
| path | String ! | ".venv" | Where to mount the venv; relative paths resolve against the container's workdir. Defaults to `.venv`. |
| setEnvVars | Boolean ! | false | Also set the standard activation env vars (`VIRTUAL_ENV` and a `PATH` with the venv's `bin/` first). |
Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen boolean \
export-venv \
into --container IMAGE:TAG --path string --set-env-vars booleanfunc (m *MyModule) Example(path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool, container *dagger.Container, path1 string, setEnvVars bool) *dagger.Container {
return dag.
Uv().
Workspace(path).
Build(allExtras, allGroups, allPackages, daggerCodegen).
ExportVenv().
Into(container, path1, setEnvVars)
}@function
def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool, container: dagger.Container, path1: str, set_env_vars: bool) -> dagger.Container:
return (
dag.uv()
.workspace(path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
.export_venv()
.into(container, path1, set_env_vars)
)@func()
example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean, container: Container, path1: string, setEnvVars: boolean): Container {
return dag
.uv()
.workspace(path)
.build(allExtras, allGroups, allPackages, daggerCodegen)
.exportVenv()
.into(container, path1, setEnvVars)
}WorkspaceBuild 🔗
An in-progress workspace build: a container plus its resolved sync plan. Drives the install pipeline: `with_remote_dependencies` to install remote deps, `with_workspace_files` to scaffold local packages, then `with_local_dependencies` to install them.
container() 🔗
Container carrying the workspace’s pyproject.toml and uv.lock
Return Type
Container ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen boolean \
containerfunc (m *MyModule) Example(path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool) *dagger.Container {
return dag.
Uv().
Workspace(path).
Build(allExtras, allGroups, allPackages, daggerCodegen).
Container()
}@function
def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool) -> dagger.Container:
return (
dag.uv()
.workspace(path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
.container()
)@func()
example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean): Container {
return dag
.uv()
.workspace(path)
.build(allExtras, allGroups, allPackages, daggerCodegen)
.container()
}plan() 🔗
Build configuration carried through the pipeline
Return Type
SyncPlan ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen boolean \
planfunc (m *MyModule) Example(path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool) *dagger.UvSyncPlan {
return dag.
Uv().
Workspace(path).
Build(allExtras, allGroups, allPackages, daggerCodegen).
Plan()
}@function
def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool) -> dagger.UvSyncPlan:
return (
dag.uv()
.workspace(path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
.plan()
)@func()
example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean): UvSyncPlan {
return dag
.uv()
.workspace(path)
.build(allExtras, allGroups, allPackages, daggerCodegen)
.plan()
}copyVenv() 🔗
Copy this build’s venv (and the uv-managed Python it needs) into container.
Convenience over export_venv().into(...): mounts the relocatable venv at
path and its Python at the absolute path the venv expects, yielding a
container that can run the environment without uv. Same constraints as
export_venv.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| container | Container ! | - | Container to copy the venv and its Python into. |
| path | String ! | ".venv" | Where to mount the venv; relative paths resolve against the container's workdir. Defaults to `.venv`. |
| setEnvVars | Boolean ! | false | Also set the standard activation env vars (`VIRTUAL_ENV` and a `PATH` with the venv's `bin/` first). |
Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen boolean \
copy-venv --container IMAGE:TAG --path string --set-env-vars booleanfunc (m *MyModule) Example(path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool, container *dagger.Container, path1 string, setEnvVars bool) *dagger.Container {
return dag.
Uv().
Workspace(path).
Build(allExtras, allGroups, allPackages, daggerCodegen).
CopyVenv(container, path1, setEnvVars)
}@function
def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool, container: dagger.Container, path1: str, set_env_vars: bool) -> dagger.Container:
return (
dag.uv()
.workspace(path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
.copy_venv(container, path1, set_env_vars)
)@func()
example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean, container: Container, path1: string, setEnvVars: boolean): Container {
return dag
.uv()
.workspace(path)
.build(allExtras, allGroups, allPackages, daggerCodegen)
.copyVenv(container, path1, setEnvVars)
}exportVenv() 🔗
Export this build’s virtual environment together with the Python it needs.
Bundles the venv and the exact interpreter it links against into a
UvVenv (see UvVenv.create). Call after the venv is populated (e.g.
after with_remote_dependencies/with_local_dependencies). Requires a
relocatable venv built against a uv-managed Python; raises otherwise.
Return Type
Venv ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen boolean \
export-venvfunc (m *MyModule) Example(path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool) *dagger.UvVenv {
return dag.
Uv().
Workspace(path).
Build(allExtras, allGroups, allPackages, daggerCodegen).
ExportVenv()
}@function
def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool) -> dagger.UvVenv:
return (
dag.uv()
.workspace(path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
.export_venv()
)@func()
example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean): UvVenv {
return dag
.uv()
.workspace(path)
.build(allExtras, allGroups, allPackages, daggerCodegen)
.exportVenv()
}withAllWorkspaceMembers() 🔗
Like with_workspace_files but scaffolds every local package, not just transitive deps.
Return Type
WorkspaceBuild ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen boolean \
with-all-workspace-membersfunc (m *MyModule) Example(path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool) *dagger.UvWorkspaceBuild {
return dag.
Uv().
Workspace(path).
Build(allExtras, allGroups, allPackages, daggerCodegen).
WithAllWorkspaceMembers()
}@function
def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool) -> dagger.UvWorkspaceBuild:
return (
dag.uv()
.workspace(path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
.with_all_workspace_members()
)@func()
example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean): UvWorkspaceBuild {
return dag
.uv()
.workspace(path)
.build(allExtras, allGroups, allPackages, daggerCodegen)
.withAllWorkspaceMembers()
}withContainer() 🔗
Return a new UvWorkspaceBuild with a different container but the same plan.
Return Type
WorkspaceBuild !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| container | Container ! | - | Replacement container (e.g. after installing non-Python packages) |
Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen boolean \
with-container --container IMAGE:TAGfunc (m *MyModule) Example(path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool, container *dagger.Container) *dagger.UvWorkspaceBuild {
return dag.
Uv().
Workspace(path).
Build(allExtras, allGroups, allPackages, daggerCodegen).
WithContainer(container)
}@function
def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool, container: dagger.Container) -> dagger.UvWorkspaceBuild:
return (
dag.uv()
.workspace(path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
.with_container(container)
)@func()
example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean, container: Container): UvWorkspaceBuild {
return dag
.uv()
.workspace(path)
.build(allExtras, allGroups, allPackages, daggerCodegen)
.withContainer(container)
}withLocalDependencies() 🔗
Copy real source, run final uv sync.
Return Type
Container ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen boolean \
with-local-dependenciesfunc (m *MyModule) Example(path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool) *dagger.Container {
return dag.
Uv().
Workspace(path).
Build(allExtras, allGroups, allPackages, daggerCodegen).
WithLocalDependencies()
}@function
def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool) -> dagger.Container:
return (
dag.uv()
.workspace(path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
.with_local_dependencies()
)@func()
example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean): Container {
return dag
.uv()
.workspace(path)
.build(allExtras, allGroups, allPackages, daggerCodegen)
.withLocalDependencies()
}withPythonInstall() 🔗
Install a managed Python via uv python install.
Useful on a bare base with no system Python; pass the version the
workspace’s requires-python resolves to.
Return Type
WorkspaceBuild !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String ! | - | Python version to install via `uv python install` (e.g. `3.12`, `3.13.7`). |
Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen boolean \
with-python-install --version stringfunc (m *MyModule) Example(path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool, version string) *dagger.UvWorkspaceBuild {
return dag.
Uv().
Workspace(path).
Build(allExtras, allGroups, allPackages, daggerCodegen).
WithPythonInstall(version)
}@function
def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool, version: str) -> dagger.UvWorkspaceBuild:
return (
dag.uv()
.workspace(path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
.with_python_install(version)
)@func()
example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean, version: string): UvWorkspaceBuild {
return dag
.uv()
.workspace(path)
.build(allExtras, allGroups, allPackages, daggerCodegen)
.withPythonInstall(version)
}withPythonPin() 🔗
Pin the project’s Python with uv python pin (writes .python-version).
Makes subsequent uv venv/uv sync select this exact version.
Return Type
WorkspaceBuild !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String ! | - | Python version to pin via `uv python pin` (writes a `.python-version` file). |
Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen boolean \
with-python-pin --version stringfunc (m *MyModule) Example(path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool, version string) *dagger.UvWorkspaceBuild {
return dag.
Uv().
Workspace(path).
Build(allExtras, allGroups, allPackages, daggerCodegen).
WithPythonPin(version)
}@function
def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool, version: str) -> dagger.UvWorkspaceBuild:
return (
dag.uv()
.workspace(path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
.with_python_pin(version)
)@func()
example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean, version: string): UvWorkspaceBuild {
return dag
.uv()
.workspace(path)
.build(allExtras, allGroups, allPackages, daggerCodegen)
.withPythonPin(version)
}withRemoteDependencies() 🔗
Install remote (non-local) dependencies via uv sync --no-install-local.
Skip this step when another tool (e.g. pulumi install) handles
dependency installation.
Return Type
WorkspaceBuild ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen boolean \
with-remote-dependenciesfunc (m *MyModule) Example(path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool) *dagger.UvWorkspaceBuild {
return dag.
Uv().
Workspace(path).
Build(allExtras, allGroups, allPackages, daggerCodegen).
WithRemoteDependencies()
}@function
def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool) -> dagger.UvWorkspaceBuild:
return (
dag.uv()
.workspace(path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
.with_remote_dependencies()
)@func()
example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean): UvWorkspaceBuild {
return dag
.uv()
.workspace(path)
.build(allExtras, allGroups, allPackages, daggerCodegen)
.withRemoteDependencies()
}withVenv() 🔗
Create the project virtual environment with uv venv.
Run before the install steps so the subsequent uv sync populates this
environment rather than creating its own (e.g. a relocatable venv that
can be copied to a different path in a later stage).
Return Type
WorkspaceBuild !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| relocatable | Boolean ! | false | Create a relocatable virtual environment (`uv venv --relocatable`). Useful for multi-stage builds. |
| args | [String ! ] | null | Additional arguments passed through to `uv venv` (e.g. `--python`, `--seed`). |
Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen boolean \
with-venv --relocatable booleanfunc (m *MyModule) Example(path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool, relocatable bool) *dagger.UvWorkspaceBuild {
return dag.
Uv().
Workspace(path).
Build(allExtras, allGroups, allPackages, daggerCodegen).
WithVenv(relocatable)
}@function
def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool, relocatable: bool) -> dagger.UvWorkspaceBuild:
return (
dag.uv()
.workspace(path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
.with_venv(relocatable)
)@func()
example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean, relocatable: boolean): UvWorkspaceBuild {
return dag
.uv()
.workspace(path)
.build(allExtras, allGroups, allPackages, daggerCodegen)
.withVenv(relocatable)
}withWorkspaceFiles() 🔗
Scaffold needed local package stubs (pyproject.toml + empty src/) into the container.
Return Type
WorkspaceBuild ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen boolean \
with-workspace-filesfunc (m *MyModule) Example(path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool) *dagger.UvWorkspaceBuild {
return dag.
Uv().
Workspace(path).
Build(allExtras, allGroups, allPackages, daggerCodegen).
WithWorkspaceFiles()
}@function
def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool) -> dagger.UvWorkspaceBuild:
return (
dag.uv()
.workspace(path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
.with_workspace_files()
)@func()
example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean): UvWorkspaceBuild {
return dag
.uv()
.workspace(path)
.build(allExtras, allGroups, allPackages, daggerCodegen)
.withWorkspaceFiles()
}WorkspaceSource 🔗
A self-contained uv workspace: the source files rooted at a ``uv.lock``. Carries the source tree and the workspace's path within it (``"."`` for a root workspace). From those it derives everything it needs to ``audit`` the locked dependencies or ``build`` a minimal container for a package — keeping the parent ``Uv`` a thin, container-free entrypoint. The full ``source`` (rather than just the sliced workspace directory) is carried so builds can reach sibling path-dependencies that live *outside* the workspace root (e.g. ``../my-dep`` in a nested workspace). Named ``UvWorkspaceSource`` (not ``UvWorkspace``) to avoid colliding with the sibling ``uv-workspace`` module's main ``UvWorkspace`` object when both are composed in a parent module.
source() 🔗
Source tree containing the workspace (and any sibling path-dependencies).
Return Type
Directory ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
sourcefunc (m *MyModule) Example(path string) *dagger.Directory {
return dag.
Uv().
Workspace(path).
Source()
}@function
def example(path: str) -> dagger.Directory:
return (
dag.uv()
.workspace(path)
.source()
)@func()
example(path: string): Directory {
return dag
.uv()
.workspace(path)
.source()
}path() 🔗
Workspace root path (holding uv.lock/pyproject.toml) within
source..for a root workspace.
Return Type
String ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
pathfunc (m *MyModule) Example(ctx context.Context, path string) string {
return dag.
Uv().
Workspace(path).
Path(ctx)
}@function
async def example(path: str) -> str:
return await (
dag.uv()
.workspace(path)
.path()
)@func()
async example(path: string): Promise<string> {
return dag
.uv()
.workspace(path)
.path()
}audit() 🔗
Audit this workspace’s locked dependencies.
The image is resolved here (explicit image > image_ref(uv_version) >
the version detected from the workspace) and handed to a container-bound
Audit; resolving an image tag is pure string work, so this type stays
container-free.
Return Type
Audit !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| uvVersion | String | null | uv version (image tag) to audit with. Defaults to the version detected from the workspace; ignored when `image` is set. |
| image | String | null | Full uv image reference to audit with. Overrides `uv_version`. |
Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
auditfunc (m *MyModule) Example(path string) *dagger.UvAudit {
return dag.
Uv().
Workspace(path).
Audit()
}@function
def example(path: str) -> dagger.UvAudit:
return (
dag.uv()
.workspace(path)
.audit()
)@func()
example(path: string): UvAudit {
return dag
.uv()
.workspace(path)
.audit()
}build() 🔗
Prepare a build for this workspace without installing anything yet.
Resolves the sync plan, mounts the uv cache, and copies the root
pyproject.toml and uv.lock into the container. Nothing is installed —
the returned UvWorkspaceBuild drives the pipeline from here:
with_remote_dependencies() to install remote deps, with_workspace_files()
to scaffold local packages, then with_local_dependencies() to install them.
Skip with_remote_dependencies() when another tool (e.g. pulumi install)
handles dependency installation.
Return Type
WorkspaceBuild !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| baseContainer | Container | null | Container to build on top of (auth, system packages, etc.). Defaults to a Debian-based uv image at the workspace's uv version (uv provisions Python on demand). |
| package | [String ! ] | null | No description provided |
| extra | [String ! ] | null | No description provided |
| group | [String ! ] | null | No description provided |
| allExtras | Boolean ! | false | Install every extra; maps to `uv sync --all-extras` |
| allGroups | Boolean ! | false | Install every dependency group; maps to `uv sync --all-groups` |
| allPackages | Boolean ! | false | Install every workspace member; maps to `uv sync --all-packages` |
| daggerCodegen | Boolean ! | true | If True (default), and the package being built has a `dagger.json`, run Dagger codegen and overlay the generated SDK before `uv sync`. No-op for non-Dagger projects. |
Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen booleanfunc (m *MyModule) Example(path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool) *dagger.UvWorkspaceBuild {
return dag.
Uv().
Workspace(path).
Build(allExtras, allGroups, allPackages, daggerCodegen)
}@function
def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool) -> dagger.UvWorkspaceBuild:
return (
dag.uv()
.workspace(path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
)@func()
example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean): UvWorkspaceBuild {
return dag
.uv()
.workspace(path)
.build(allExtras, allGroups, allPackages, daggerCodegen)
}install() 🔗
Build a minimal container with deps installed for the given package(s).
Convenience method composing build, optionally with_venv,
with_remote_dependencies, with_workspace_files, and
with_local_dependencies. For fine-grained control (e.g. running
pulumi install between remote deps and local source), call them individually.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| baseContainer | Container | null | Container to build on (auth, system packages, etc.). Defaults to a Debian-based uv image at the workspace's uv version (uv provisions Python on demand). |
| package | [String ! ] | null | No description provided |
| extra | [String ! ] | null | No description provided |
| group | [String ! ] | null | No description provided |
| allExtras | Boolean ! | false | Install every extra; maps to `uv sync --all-extras` |
| allGroups | Boolean ! | false | Install every dependency group; maps to `uv sync --all-groups` |
| allPackages | Boolean ! | false | Install every workspace member; maps to `uv sync --all-packages` |
| daggerCodegen | Boolean ! | true | If True (default), and the package being built has a `dagger.json`, run Dagger codegen and overlay the generated SDK before `uv sync`. No-op for non-Dagger projects. |
| venv | Boolean ! | false | Create the virtual environment up front with `uv venv` (before installing). |
| venvRelocatable | Boolean ! | false | When `venv` is set, make it relocatable (`uv venv --relocatable`). |
Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
install --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen boolean --venv boolean --venv-relocatable booleanfunc (m *MyModule) Example(path string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool, venv bool, venvRelocatable bool) *dagger.Container {
return dag.
Uv().
Workspace(path).
Install(allExtras, allGroups, allPackages, daggerCodegen, venv, venvRelocatable)
}@function
def example(path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool, venv: bool, venv_relocatable: bool) -> dagger.Container:
return (
dag.uv()
.workspace(path)
.install(all_extras, all_groups, all_packages, dagger_codegen, venv, venv_relocatable)
)@func()
example(path: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean, venv: boolean, venvRelocatable: boolean): Container {
return dag
.uv()
.workspace(path)
.install(allExtras, allGroups, allPackages, daggerCodegen, venv, venvRelocatable)
}uvVersion() 🔗
The uv version this workspace requires, as a concrete image tag.
Reads required-version (a PEP 440 specifier) from uv.toml or the
[tool.uv] table of pyproject.toml. Exact pins are used as-is; ranges
resolve to their minimal compatible version (no PyPI lookup). Falls back
to the default latest tag when unspecified.
Return Type
String ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path string \
uv-versionfunc (m *MyModule) Example(ctx context.Context, path string) string {
return dag.
Uv().
Workspace(path).
UvVersion(ctx)
}@function
async def example(path: str) -> str:
return await (
dag.uv()
.workspace(path)
.uv_version()
)@func()
async example(path: string): Promise<string> {
return dag
.uv()
.workspace(path)
.uvVersion()
}Uv 🔗
Container-free entrypoint for uv-managed Python projects. Holds only the user-provided source tree and hands out :class:`UvWorkspaceSource` objects — one per workspace — which own the actual work (audit, build). Use `workspace` to grab a single workspace by path, `get_workspaces` to list them all, or `audit` to audit every one.
source() 🔗
Source directory.
Return Type
Directory ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
sourcefunc (m *MyModule) Example() *dagger.Directory {
return dag.
Uv().
Source()
}@function
def example() -> dagger.Directory:
return (
dag.uv()
.source()
)@func()
example(): Directory {
return dag
.uv()
.source()
}audit() 🔗
Run uv audit for every workspace in parallel.
Exits non-zero when any (non-excluded) workspace fails its audit.
Return Type
Void !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| exclude | [String ! ] | null | Glob patterns (source-relative) of workspace paths to skip, e.g. `**/tests/_packages/**`. |
| uvVersion | String | null | uv version (image tag) to run with. Defaults to the version detected per workspace; ignored when `image` is set. |
| image | String | null | Full uv image reference to run with. Overrides `uv_version`. |
Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
auditfunc (m *MyModule) Example(ctx context.Context) {
return dag.
Uv().
Audit(ctx)
}@function
async def example() -> None:
return await (
dag.uv()
.audit()
)@func()
async example(): Promise<void> {
return dag
.uv()
.audit()
}getWorkspaces() 🔗
Every uv workspace in the source tree (one per uv.lock).
Return Type
[WorkspaceSource ! ] ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
get-workspacesfunc (m *MyModule) Example() []*dagger.UvWorkspaceSource {
return dag.
Uv().
GetWorkspaces()
}@function
def example() -> List[dagger.UvWorkspaceSource]:
return (
dag.uv()
.get_workspaces()
)@func()
example(): UvWorkspaceSource[] {
return dag
.uv()
.getWorkspaces()
}workspace() 🔗
A single uv workspace at path within the source tree.
The returned UvWorkspaceSource can audit its locked dependencies or
build a minimal container for a package.
Return Type
WorkspaceSource !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| path | String ! | "." | Path to the workspace root (holding uv.lock and pyproject.toml) within the source directory. |
Example
dagger -m github.com/typesafe-ai/daggerverse/uv@2d4273eaafd5788cd048a245652a27b5942c3480 call \
workspace --path stringfunc (m *MyModule) Example(path string) *dagger.UvWorkspaceSource {
return dag.
Uv().
Workspace(path)
}@function
def example(path: str) -> dagger.UvWorkspaceSource:
return (
dag.uv()
.workspace(path)
)@func()
example(path: string): UvWorkspaceSource {
return dag
.uv()
.workspace(path)
}