Skip to main content
Version: devel

dlt._workspace.deployment.requirements

Export, save, load, and migrate TWorkspaceRequirementsManifest — the wire format for workspace dependencies shipped to the runtime. Supports requirements.txt and requirements.in. If uv installed - supports pyproject with dependency groups and uv/PEP lock files. poetry/PDM support can be easily added.

WorkspaceRequirementsError Objects

class WorkspaceRequirementsError(Exception)

View source on GitHub

Raised when a workspace's dependency files cannot be exported.

get_dlt_requirement_spec

def get_dlt_requirement_spec() -> str

View source on GitHub

Build a PEP 508 spec for the currently installed dlt distribution.

Uses PEP 610 direct_url.json when dlt was installed from a URL (branch zip, git) so the spec survives on a remote runner; falls back to a dlt==<version> pin for ordinary index installs.

python_version

def python_version() -> str

View source on GitHub

Current interpreter's major.minor version, e.g. "3.12".

build_launcher_requirements

def build_launcher_requirements() -> Dict[str, List[str]]

View source on GitHub

Per-launcher mandatory specs. dlt is injected separately at build time.

build_dashboard_group

def build_dashboard_group() -> List[str]

View source on GitHub

Specs for the DASHBOARD_JOB_REF group.

default_requirements_manifest

def default_requirements_manifest() -> TWorkspaceRequirementsManifest

View source on GitHub

Minimal manifest: empty main, dashboard group, launcher specs with dlt injected.

export_workspace_requirements

def export_workspace_requirements(
workspace_root: Path,
default_groups: Optional[List[str]] = None
) -> TWorkspaceRequirementsManifest

View source on GitHub

Export a workspace's dependencies as a TWorkspaceRequirementsManifest.

If no default group names dlt, the installed dlt spec is injected into the launcher baseline so every job gets it.

Arguments:

  • workspace_root Path - Workspace directory.
  • default_groups Optional[List[str]] - Manifest-level default_groups. Defaults to ["main"].

Returns:

  • TWorkspaceRequirementsManifest - Always contains a main entry in groups.

Raises:

  • WorkspaceRequirementsError - uv.lock out of sync, uv failure, or parse error.

migrate_requirements

def migrate_requirements(manifest_dict: DictStrAny, from_engine: int,
to_engine: int) -> TWorkspaceRequirementsManifest

View source on GitHub

Migrate a requirements manifest dict between engine versions.

save_requirements

def save_requirements(req: TWorkspaceRequirementsManifest,
f: BinaryIO) -> None

View source on GitHub

Serialize a requirements manifest as typed JSON.

load_requirements

def load_requirements(f: BinaryIO) -> TWorkspaceRequirementsManifest

View source on GitHub

Read, migrate, and validate a requirements manifest.

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub – it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.