From e21e5cbee9d3f321f53d6f8fddf3539433a9b09c Mon Sep 17 00:00:00 2001 From: Denis Lehmann Date: Fri, 10 Apr 2020 09:31:56 +0200 Subject: [PATCH] update python to use virtualenv --- python_environment/default.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/python_environment/default.nix b/python_environment/default.nix index bd27798..f1f781e 100644 --- a/python_environment/default.nix +++ b/python_environment/default.nix @@ -3,16 +3,16 @@ with import {}; stdenv.mkDerivation { name = "myPythonEnv"; buildInputs = with pkgs; [ - python36Full - python36Packages.virtualenv - python36Packages.pip + python37Full + python37Packages.virtualenv ]; src = null; shellHook = '' - # set SOURCE_DATE_EPOCH so that we can use python wheels - SOURCE_DATE_EPOCH=$(date +%s) - virtualenv --no-setuptools venv - export PATH=$PWD/venv/bin:$PATH + if [ ! -d .venv ]; then + python -m venv .venv + fi + source .venv/bin/activate + pip install --upgrade pip if [ -s requirements.txt ]; then pip install -r requirements.txt fi