From 4f051082a3d380d7b6937069da654f67533eb184 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 30 Nov 2026 21:48:11 +0100 Subject: [PATCH] easier python env --- scripts/pyvenv | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 scripts/pyvenv diff --git a/scripts/pyvenv b/scripts/pyvenv new file mode 100755 index 0000000..9ef0a09 --- /dev/null +++ b/scripts/pyvenv @@ -0,0 +1,14 @@ +# Run with `source pyvenv` + +if [ -n "${VIRTUAL_ENV:-}" ]; then + return 0 +fi + +if [ ! -f .venv/bin/activate ]; then + python3 -m venv .venv || return $? + if [ -f requirements.txt ]; then + .venv/bin/python -m pip install -r requirements.txt || return $? + fi +fi + +. .venv/bin/activate