uv-workspace
This module has been generated via dagger init and serves as a reference tobasic module structure as you get started with Dagger.
Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.
The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.
Installation
dagger install github.com/typesafe-ai/daggerverse/uv-workspace@8b1c09e6d7b94806cd583446bd688c68ac6029cfEntrypoint
Return Type
UvWorkspace !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| sourceDir | Directory ! | - | Source directory containing the workspace |
| baseContainer | Container ! | - | Pre-configured container (with auth, system packages, etc.) |
| workspacePath | String ! | "." | Path to workspace root (holding uv.lock and pyproject.toml) within source_dir |
Example
dagger -m github.com/typesafe-ai/daggerverse/uv-workspace@8b1c09e6d7b94806cd583446bd688c68ac6029cf call \
--source-dir DIR_PATH --base-container IMAGE:TAG --workspace-path stringfunc (m *MyModule) Example(sourceDir *dagger.Directory, baseContainer *dagger.Container, workspacePath string) *dagger.UvWorkspace {
return dag.
UvWorkspace(sourceDir, baseContainer, workspacePath)
}@function
def example(source_dir: dagger.Directory, base_container: dagger.Container, workspace_path: str) -> dagger.UvWorkspace:
return (
dag.uv_workspace(source_dir, base_container, workspace_path)
)@func()
example(sourceDir: Directory, baseContainer: Container, workspacePath: string): UvWorkspace {
return dag
.uvWorkspace(sourceDir, baseContainer, workspacePath)
}Types
UvWorkspace 🔗
Builds minimal project containers by parsing uv.lock to resolve local dependencies.
sourceDir() 🔗
Source directory containing the workspace
Return Type
Directory ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv-workspace@8b1c09e6d7b94806cd583446bd688c68ac6029cf call \
--source-dir DIR_PATH --base-container IMAGE:TAG --workspace-path string source-dirfunc (m *MyModule) Example(sourceDir *dagger.Directory, baseContainer *dagger.Container, workspacePath string) *dagger.Directory {
return dag.
UvWorkspace(sourceDir, baseContainer, workspacePath).
SourceDir()
}@function
def example(source_dir: dagger.Directory, base_container: dagger.Container, workspace_path: str) -> dagger.Directory:
return (
dag.uv_workspace(source_dir, base_container, workspace_path)
.source_dir()
)@func()
example(sourceDir: Directory, baseContainer: Container, workspacePath: string): Directory {
return dag
.uvWorkspace(sourceDir, baseContainer, workspacePath)
.sourceDir()
}baseContainer() 🔗
Pre-configured container (with auth, system packages, etc.)
Return Type
Container ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv-workspace@8b1c09e6d7b94806cd583446bd688c68ac6029cf call \
--source-dir DIR_PATH --base-container IMAGE:TAG --workspace-path string base-containerfunc (m *MyModule) Example(sourceDir *dagger.Directory, baseContainer *dagger.Container, workspacePath string) *dagger.Container {
return dag.
UvWorkspace(sourceDir, baseContainer, workspacePath).
BaseContainer()
}@function
def example(source_dir: dagger.Directory, base_container: dagger.Container, workspace_path: str) -> dagger.Container:
return (
dag.uv_workspace(source_dir, base_container, workspace_path)
.base_container()
)@func()
example(sourceDir: Directory, baseContainer: Container, workspacePath: string): Container {
return dag
.uvWorkspace(sourceDir, baseContainer, workspacePath)
.baseContainer()
}workspacePath() 🔗
Path to workspace root (holding uv.lock and pyproject.toml) within source_dir
Return Type
String ! Example
dagger -m github.com/typesafe-ai/daggerverse/uv-workspace@8b1c09e6d7b94806cd583446bd688c68ac6029cf call \
--source-dir DIR_PATH --base-container IMAGE:TAG --workspace-path string workspace-pathfunc (m *MyModule) Example(ctx context.Context, sourceDir *dagger.Directory, baseContainer *dagger.Container, workspacePath string) string {
return dag.
UvWorkspace(sourceDir, baseContainer, workspacePath).
WorkspacePath(ctx)
}@function
async def example(source_dir: dagger.Directory, base_container: dagger.Container, workspace_path: str) -> str:
return await (
dag.uv_workspace(source_dir, base_container, workspace_path)
.workspace_path()
)@func()
async example(sourceDir: Directory, baseContainer: Container, workspacePath: string): Promise<string> {
return dag
.uvWorkspace(sourceDir, baseContainer, workspacePath)
.workspacePath()
}build() 🔗
Build a minimal container with deps installed for the given package.
Parses uv.lock to find local workspace dependencies, then builds in two layers: remote deps first (cacheable), then local source. If package is specified, only that package’s deps are installed (for workspaces).
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| package | String | null | Package name; if set, only that package's transitive local deps are installed. Maps to `uv sync --package` |
| extra | [String ! ] | null | Extras to install; passed to `uv sync` as repeated `--extra` |
| group | [String ! ] | null | Dependency groups to install; passed to `uv sync` as repeated `--group` |
| 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`. Only meaningful in workspaces |
| daggerCodegen | Boolean ! | true | If True (default), run Dagger codegen for the package being built when its directory contains a `dagger.json`, and overlay the generated context directory before `uv sync`. This is what makes `[tool.uv.sources]` entries that reference the generated SDK (e.g. `dagger-io = { path = "sdk" }`) install correctly even though those paths are gitignored in Dagger module repos. No-op for non-Dagger projects. |
Example
dagger -m github.com/typesafe-ai/daggerverse/uv-workspace@8b1c09e6d7b94806cd583446bd688c68ac6029cf call \
--source-dir DIR_PATH --base-container IMAGE:TAG --workspace-path string build --all-extras boolean --all-groups boolean --all-packages boolean --dagger-codegen booleanfunc (m *MyModule) Example(sourceDir *dagger.Directory, baseContainer *dagger.Container, workspacePath string, allExtras bool, allGroups bool, allPackages bool, daggerCodegen bool) *dagger.Container {
return dag.
UvWorkspace(sourceDir, baseContainer, workspacePath).
Build(allExtras, allGroups, allPackages, daggerCodegen)
}@function
def example(source_dir: dagger.Directory, base_container: dagger.Container, workspace_path: str, all_extras: bool, all_groups: bool, all_packages: bool, dagger_codegen: bool) -> dagger.Container:
return (
dag.uv_workspace(source_dir, base_container, workspace_path)
.build(all_extras, all_groups, all_packages, dagger_codegen)
)@func()
example(sourceDir: Directory, baseContainer: Container, workspacePath: string, allExtras: boolean, allGroups: boolean, allPackages: boolean, daggerCodegen: boolean): Container {
return dag
.uvWorkspace(sourceDir, baseContainer, workspacePath)
.build(allExtras, allGroups, allPackages, daggerCodegen)
}