From d4af74913ea76c5f97c36d07a79dd484a7cce29b Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Wed, 5 Feb 2025 14:40:42 +0000 Subject: [PATCH] Adjust pyshell to upgrade existing env in case python is upgraded --- system/home/programming/pyshell.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system/home/programming/pyshell.nix b/system/home/programming/pyshell.nix index 6a42f646..830b8568 100644 --- a/system/home/programming/pyshell.nix +++ b/system/home/programming/pyshell.nix @@ -31,7 +31,11 @@ pkgs.mkShellNoCC { pkgs.uv ] ++ extraPackages; shellHook = '' - [ ! -d .venv ] && ${pythonWrapped}/bin/python3 -m venv .venv + if [ ! -d .venv ]; then + ${pythonWrapped}/bin/python3 -m venv .venv + else + ${pythonWrapped}/bin/python3 -m venv --upgrade .venv + fi [ -f .venv/bin/activate ] && source .venv/bin/activate ''; }