pipenv: patch pipenv to point to python that has virtualenv

This commit is contained in:
Frederik Rietdijk 2019-10-23 12:33:23 +02:00 committed by Frederik Rietdijk
parent 6db4ae1f27
commit 1d7e21905c
2 changed files with 26 additions and 19 deletions

View file

@ -1,17 +1,22 @@
{ lib
, buildPythonApplication
, certifi
, setuptools
, invoke
, parver
, pip
, requests
, virtualenv
, fetchPypi
, virtualenv-clone
, python3
}:
buildPythonApplication rec {
with python3.pkgs;
let
runtimeDeps = [
certifi
setuptools
pip
virtualenv
virtualenv-clone
];
pythonEnv = python3.withPackages(ps: with ps; [ virtualenv ]);
in buildPythonApplication rec {
pname = "pipenv";
version = "2018.11.26";
@ -22,15 +27,17 @@ buildPythonApplication rec {
LC_ALL = "en_US.UTF-8";
postPatch = ''
# pipenv invokes python in a subprocess to create a virtualenv
# it uses sys.executable which will point in our case to a python that
# does not have virtualenv.
substituteInPlace pipenv/core.py \
--replace "vistir.compat.Path(sys.executable).absolute().as_posix()" "vistir.compat.Path('${pythonEnv.interpreter}').absolute().as_posix()"
'';
nativeBuildInputs = [ invoke parver ];
propagatedBuildInputs = [
certifi
setuptools
pip
virtualenv
virtualenv-clone
];
propagatedBuildInputs = runtimeDeps;
doCheck = false;

View file

@ -9003,7 +9003,7 @@ in
pew = callPackage ../development/tools/pew {};
poetry = with python3Packages; toPythonApplication poetry;
pipenv = python3Packages.callPackage ../development/tools/pipenv {};
pipenv = callPackage ../development/tools/pipenv {};
pipewire = callPackage ../development/libraries/pipewire {};