Adjust pyshell to upgrade existing env in case python is upgraded

This commit is contained in:
Evie Litherland-Smith 2025-02-05 14:40:42 +00:00
parent 0f9654b200
commit d4af74913e

View file

@ -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
'';
}