refactor: Update runner specifications from 'python_uv_tool' to 'python' across components and documentation
This commit is contained in:
@@ -15,7 +15,7 @@ from castle_cli.manifest import (
|
||||
ManageSpec,
|
||||
PathInstallSpec,
|
||||
ProxySpec,
|
||||
RunPythonUvTool,
|
||||
RunPython,
|
||||
SystemdSpec,
|
||||
ToolSpec,
|
||||
)
|
||||
@@ -78,8 +78,8 @@ def run_create(args: argparse.Namespace) -> int:
|
||||
id=name,
|
||||
description=args.description or f"A castle {proj_type}",
|
||||
source=f"components/{name}",
|
||||
run=RunPythonUvTool(
|
||||
runner="python_uv_tool",
|
||||
run=RunPython(
|
||||
runner="python",
|
||||
tool=name,
|
||||
),
|
||||
expose=ExposeSpec(
|
||||
|
||||
@@ -174,7 +174,7 @@ def _build_deployed(
|
||||
def _build_run_cmd(run: object, env: dict[str, str]) -> list[str]:
|
||||
"""Build a run command list from a RunSpec."""
|
||||
match run.runner:
|
||||
case "python_uv_tool":
|
||||
case "python":
|
||||
resolved = shutil.which(run.tool)
|
||||
if not resolved:
|
||||
print(
|
||||
@@ -185,12 +185,6 @@ def _build_run_cmd(run: object, env: dict[str, str]) -> list[str]:
|
||||
if run.args:
|
||||
cmd.extend(run.args)
|
||||
return cmd
|
||||
case "python_module":
|
||||
python = run.python or shutil.which("python3") or "python3"
|
||||
cmd = [python, "-m", run.module]
|
||||
if run.args:
|
||||
cmd.extend(run.args)
|
||||
return cmd
|
||||
case "command":
|
||||
cmd = list(run.argv)
|
||||
resolved = shutil.which(cmd[0])
|
||||
|
||||
@@ -22,7 +22,7 @@ def _sync_cmd(manifest: ComponentManifest) -> list[str] | None:
|
||||
return None
|
||||
|
||||
match run.runner:
|
||||
case "python_uv_tool" | "python_module":
|
||||
case "python":
|
||||
return ["uv", "sync"]
|
||||
case "node":
|
||||
return [run.package_manager, "install"]
|
||||
@@ -80,13 +80,14 @@ def run_sync(args: argparse.Namespace) -> int:
|
||||
installed_dirs: set[Path] = set()
|
||||
|
||||
for name, manifest in config.components.items():
|
||||
# Determine source directory — from tool.source or manifest.source
|
||||
source = None
|
||||
if manifest.tool and manifest.tool.source:
|
||||
source = manifest.tool.source
|
||||
elif manifest.run and manifest.run.runner == "python_uv_tool" and manifest.source_dir:
|
||||
source = manifest.source_dir
|
||||
# Install if: has install.path, or is a python runner service
|
||||
if not (
|
||||
(manifest.install and manifest.install.path)
|
||||
or (manifest.run and manifest.run.runner == "python")
|
||||
):
|
||||
continue
|
||||
|
||||
source = manifest.source_dir
|
||||
if not source:
|
||||
continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user