Compare commits

...
Author SHA1 Message Date
ksmithandClaude Sonnet 5 62702e13e3 Detect and recreate a half-created venv, not just a missing one
The idempotency check only looked for the venv directory's existence, so
a venv left behind by an earlier failed run (e.g. missing ensurepip, as
just hit) — present but with no bin/pip — made every later re-run skip
venv creation entirely and then fail on a pip that was never created.
Check for bin/pip specifically and wipe+recreate if it's missing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-31 08:52:36 -06:00
ksmithandClaude Sonnet 5 78611c0eae Check for a working venv module before install.sh does anything else
On Debian/Ubuntu, python3-venv (ensurepip support) is a separate package
from python3 itself, and apt installing just python3 leaves venv creation
failing partway through install.sh — after the system user, chown, and
git checkout have all already happened. Check for it up front alongside
the Python version check, and document the apt package in install.md's
prerequisites.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-31 08:51:28 -06:00
2 changed files with 14 additions and 3 deletions

No files matched your search

+5 -3
View File
@@ -55,7 +55,8 @@ and 4 below first — prerequisites and what `.env` controls.
## 1. Prerequisites
- Python 3.11 or 3.12
- Python 3.11 or 3.12, with its `venv` module (Debian/Ubuntu split this into a
separate `python3.X-venv` package — see below)
- Redis (Celery's broker)
- **Postgres only**: a PostgreSQL server (12+) and its client headers if you're not
using the bundled `psycopg[binary]` wheel (most platforms are covered by the wheel,
@@ -63,10 +64,11 @@ and 4 below first — prerequisites and what `.env` controls.
- nginx (or another reverse proxy)
- A domain name pointed at the host, if you want this reachable outside your LAN
Debian/Ubuntu example for the non-Python pieces:
Debian/Ubuntu example for the non-Python pieces (swap `python3.13-venv` for
whatever `python3 --version` reports on your system):
```bash
sudo apt install redis-server nginx
sudo apt install redis-server nginx python3.13-venv
# Postgres only:
sudo apt install postgresql
```
+9
View File
@@ -52,6 +52,11 @@ if [ "$PY_MAJOR" -lt 3 ] || { [ "$PY_MAJOR" -eq 3 ] && [ "$PY_MINOR" -lt 11 ]; }
echo "Python $PY_VERSION found, but Evection needs 3.11 or newer." >&2
exit 1
fi
if ! "$PYTHON_BIN" -c 'import ensurepip' >/dev/null 2>&1; then
echo "'$PYTHON_BIN' can't create virtualenvs (no ensurepip) — on" \
"Debian/Ubuntu, install it with: apt install python${PY_VERSION}-venv" >&2
exit 1
fi
for bin in redis-cli nginx; do
if ! command -v "$bin" >/dev/null 2>&1; then
@@ -99,6 +104,10 @@ chown -R "$EVECTION_USER:$EVECTION_USER" "$APP_DIR"
# --- 3. Virtualenv + install ---------------------------------------------
if [ -d "$VENV_DIR" ] && [ ! -x "$VENV_DIR/bin/pip" ]; then
echo "==> $VENV_DIR exists but looks incomplete (no bin/pip) — recreating it"
rm -rf "$VENV_DIR"
fi
if [ ! -d "$VENV_DIR" ]; then
echo "==> Creating virtualenv at $VENV_DIR"
sudo -u "$EVECTION_USER" -H "$PYTHON_BIN" -m venv "$VENV_DIR"