Skip to content

Commit

Permalink
pipenv: patch pipenv to point to python that has virtualenv
Browse files Browse the repository at this point in the history
  • Loading branch information
FRidh committed Oct 25, 2019
1 parent 6db4ae1 commit 1d7e219
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
43 changes: 25 additions & 18 deletions pkgs/development/tools/pipenv/default.nix
@@ -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";

Expand All @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Expand Up @@ -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 {};

Expand Down

0 comments on commit 1d7e219

Please sign in to comment.