update python to use virtualenv

This commit is contained in:
Denis Lehmann 2020-04-10 09:31:56 +02:00
parent 91ce528f61
commit e21e5cbee9

View file

@ -3,16 +3,16 @@ with import <nixpkgs> {};
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