From 760b5dc90e09e189dd5ad90c136657b65dc5748f Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Mar 2026 23:03:23 -0700 Subject: [PATCH] Fix build script: remove duplicate 'install' arg, fix Windows shell - build_sidecar.py: pip_install() now includes 'install' in the command, callers pass only package names (was doubling up as 'uv pip install install torch') - CI: set shell: bash on uv steps so Windows doesn't try to use cmd.exe Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitea/workflows/build.yml | 2 ++ python/build_sidecar.py | 15 ++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index f3b95e6..5b7e004 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -55,9 +55,11 @@ jobs: } - name: Set up Python + shell: bash run: uv python install ${{ env.PYTHON_VERSION }} - name: Build sidecar + shell: bash working-directory: python run: uv run --python ${{ env.PYTHON_VERSION }} python build_sidecar.py --cpu-only diff --git a/python/build_sidecar.py b/python/build_sidecar.py index d38699a..6445de5 100644 --- a/python/build_sidecar.py +++ b/python/build_sidecar.py @@ -96,30 +96,31 @@ def create_venv_and_install(cpu_only: bool) -> Path: else: python = str(venv_dir / "bin" / "python") - def pkg_install(*args: str) -> None: + def pip_install(*args: str) -> None: + """Install packages. Pass package names and flags only, not 'install'.""" if use_uv: subprocess.run(["uv", "pip", "install", "--python", python, *args], check=True) else: - subprocess.run([python, "-m", "pip", *args], check=True) + subprocess.run([python, "-m", "pip", "install", *args], check=True) if not use_uv: # Upgrade pip (uv doesn't need this) - pkg_install("install", "--upgrade", "pip", "setuptools", "wheel") + pip_install("--upgrade", "pip", "setuptools", "wheel") # Install torch (CPU-only to avoid bundling ~2GB of CUDA libs) if cpu_only: print("[build] Installing PyTorch (CPU-only)") - pkg_install( - "install", "torch", "torchaudio", + pip_install( + "torch", "torchaudio", "--index-url", "https://download.pytorch.org/whl/cpu", ) else: print("[build] Installing PyTorch (default, may include CUDA)") - pkg_install("install", "torch", "torchaudio") + pip_install("torch", "torchaudio") # Install project and dev deps (includes pyinstaller) print("[build] Installing project dependencies") - pkg_install("install", "-e", f"{SCRIPT_DIR}[dev]") + pip_install("-e", f"{SCRIPT_DIR}[dev]") return Path(python)