From 4650a3cbc5d244eed1740be8aa0f834df0ffb023 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Thu, 23 Apr 2026 00:34:32 -0400 Subject: [PATCH] bin/pipekit auto-detects venv; stop rewriting it in deploy.sh. The tracked launcher now checks for .venv/bin/python3 under the repo and uses it if present, else falls back to system python3. Works pre-deploy (no venv) and post-deploy (venv exists) without being modified. Deploy no longer regenerates the file, so `git pull` on a deployed box won't conflict with the launcher. Co-Authored-By: Claude Opus 4.7 --- bin/pipekit | 7 ++++++- deploy.sh | 6 +----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/pipekit b/bin/pipekit index a7f397c..24a3cfe 100755 --- a/bin/pipekit +++ b/bin/pipekit @@ -1,4 +1,9 @@ #!/usr/bin/env bash -# Thin launcher: run `pipekit` from anywhere. +# Thin launcher: prefer the repo venv if deploy.sh created one, +# else fall back to system python3. set -euo pipefail +REPO="$(cd "$(dirname "$(readlink -f "$0")")/.." && pwd)" +if [ -x "$REPO/.venv/bin/python3" ]; then + exec "$REPO/.venv/bin/python3" -m pipekit "$@" +fi exec python3 -m pipekit "$@" diff --git a/deploy.sh b/deploy.sh index 2790150..3f80b80 100755 --- a/deploy.sh +++ b/deploy.sh @@ -42,11 +42,7 @@ fi "$VENV_DIR/bin/pip" install --quiet -r "$REPO_DIR/requirements.txt" echo "Python deps installed." -cat > "$REPO_DIR/bin/pipekit" < $REPO_DIR/bin/pipekit"