refactor: Update runner specifications from 'python_uv_tool' to 'python' across components and documentation
This commit is contained in:
@@ -88,20 +88,13 @@ def manifest_to_exec_start(manifest: ComponentManifest, root: Path) -> str:
|
||||
raise ValueError(f"Component '{manifest.id}' has no run spec")
|
||||
|
||||
match run.runner:
|
||||
case "python_uv_tool":
|
||||
case "python":
|
||||
uv_path = shutil.which("uv") or "uv"
|
||||
args_str = " ".join(run.args) if run.args else ""
|
||||
cmd = f"{uv_path} run {run.tool}"
|
||||
if args_str:
|
||||
cmd += f" {args_str}"
|
||||
return cmd
|
||||
case "python_module":
|
||||
python = run.python or shutil.which("python3") or "python3"
|
||||
args_str = " ".join(run.args) if run.args else ""
|
||||
cmd = f"{python} -m {run.module}"
|
||||
if args_str:
|
||||
cmd += f" {args_str}"
|
||||
return cmd
|
||||
case "command":
|
||||
argv = list(run.argv)
|
||||
resolved = shutil.which(argv[0])
|
||||
|
||||
@@ -46,15 +46,8 @@ class RunCommand(RunBase):
|
||||
argv: list[str] = Field(min_length=1)
|
||||
|
||||
|
||||
class RunPythonModule(RunBase):
|
||||
runner: Literal["python_module"]
|
||||
module: str
|
||||
args: list[str] = Field(default_factory=list)
|
||||
python: str | None = None
|
||||
|
||||
|
||||
class RunPythonUvTool(RunBase):
|
||||
runner: Literal["python_uv_tool"]
|
||||
class RunPython(RunBase):
|
||||
runner: Literal["python"]
|
||||
tool: str
|
||||
args: list[str] = Field(default_factory=list)
|
||||
|
||||
@@ -84,9 +77,7 @@ class RunRemote(RunBase):
|
||||
|
||||
|
||||
RunSpec = Annotated[
|
||||
Union[
|
||||
RunCommand, RunPythonModule, RunPythonUvTool, RunContainer, RunNode, RunRemote
|
||||
],
|
||||
Union[RunCommand, RunPython, RunContainer, RunNode, RunRemote],
|
||||
Field(discriminator="runner"),
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user