mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 03:38:23 +00:00
Reload env layer in install scripts after venv creation so `PYTHON` points to the virtualenv instead of the system interpreter. * Reload env in `python.sh` before installing dependencies * Reload env in `pre-commit.sh` before installing hooks * Reset env cache flags to force re-evaluation * Keep centralized environment resolution (no hardcoding) Fixes PEP 668 `externally-managed-environment` errors and missing `pre_commit` module during hook installation.
16 lines
445 B
Bash
Executable File
16 lines
445 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# 🔁 Reload env to pick up newly created venv
|
|
if [[ -n "${VENV:-}" && -x "${VENV}/bin/python" && "${PYTHON:-}" != "${VENV}/bin/python" ]]; then
|
|
unset INFINITO_ENV_LOADED
|
|
unset INFINITO_ENV_PYTHON_LOADED
|
|
# shellcheck source=scripts/meta/env/all.sh
|
|
source "${ENV_SH:-scripts/meta/env/all.sh}"
|
|
fi
|
|
|
|
: "${PYTHON:?PYTHON not set}"
|
|
|
|
echo "🔗 Installing pre-commit hooks"
|
|
"${PYTHON}" -m pre_commit install
|