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 { stdenv.mkDerivation {
name = "myPythonEnv"; name = "myPythonEnv";
buildInputs = with pkgs; [ buildInputs = with pkgs; [
python36Full python37Full
python36Packages.virtualenv python37Packages.virtualenv
python36Packages.pip
]; ];
src = null; src = null;
shellHook = '' shellHook = ''
# set SOURCE_DATE_EPOCH so that we can use python wheels if [ ! -d .venv ]; then
SOURCE_DATE_EPOCH=$(date +%s) python -m venv .venv
virtualenv --no-setuptools venv fi
export PATH=$PWD/venv/bin:$PATH source .venv/bin/activate
pip install --upgrade pip
if [ -s requirements.txt ]; then if [ -s requirements.txt ]; then
pip install -r requirements.txt pip install -r requirements.txt
fi fi