2019-05-04 15:23:59 +02:00
|
|
|
{ lib
|
2019-10-23 12:33:23 +02:00
|
|
|
, python3
|
2019-05-04 15:23:59 +02:00
|
|
|
}:
|
|
|
|
|
2019-10-23 12:33:23 +02:00
|
|
|
with python3.pkgs;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
2020-05-31 20:35:15 +02:00
|
|
|
runtimeDeps = ps: with ps; [
|
2019-10-23 12:33:23 +02:00
|
|
|
certifi
|
|
|
|
setuptools
|
|
|
|
pip
|
|
|
|
virtualenv
|
|
|
|
virtualenv-clone
|
|
|
|
];
|
|
|
|
|
2020-05-31 20:35:15 +02:00
|
|
|
pythonEnv = python3.withPackages runtimeDeps;
|
2019-10-23 12:33:23 +02:00
|
|
|
|
|
|
|
in buildPythonApplication rec {
|
2019-03-06 18:56:44 +01:00
|
|
|
pname = "pipenv";
|
2021-09-13 01:14:55 +02:00
|
|
|
version = "2021.5.29";
|
2017-10-15 18:16:51 +02:00
|
|
|
|
2019-03-06 18:56:44 +01:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-09-13 01:14:55 +02:00
|
|
|
sha256 = "05958fadcd70b2de6a27542fcd2bd72dd5c59c6d35307fdac3e06361fb06e30e";
|
2019-03-06 18:56:44 +01:00
|
|
|
};
|
2017-10-15 18:16:51 +02:00
|
|
|
|
2019-03-06 18:56:44 +01:00
|
|
|
LC_ALL = "en_US.UTF-8";
|
2017-10-15 18:16:51 +02:00
|
|
|
|
2019-10-23 12:33:23 +02:00
|
|
|
postPatch = ''
|
|
|
|
# pipenv invokes python in a subprocess to create a virtualenv
|
2020-05-29 13:47:03 +02:00
|
|
|
# and to call setup.py.
|
|
|
|
# It would use sys.executable, which in our case points to a python that
|
|
|
|
# does not have the required dependencies.
|
2019-10-23 12:33:23 +02:00
|
|
|
substituteInPlace pipenv/core.py \
|
2020-05-29 13:47:03 +02:00
|
|
|
--replace "sys.executable" "'${pythonEnv.interpreter}'"
|
2019-10-23 12:33:23 +02:00
|
|
|
'';
|
|
|
|
|
2020-05-31 20:35:15 +02:00
|
|
|
propagatedBuildInputs = runtimeDeps python3.pkgs;
|
2017-10-15 18:16:51 +02:00
|
|
|
|
2019-11-13 16:28:27 +01:00
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
2019-11-13 19:10:16 +01:00
|
|
|
export HOME=$(mktemp -d)
|
2019-11-13 21:01:30 +01:00
|
|
|
cp -r --no-preserve=mode ${wheel.src} $HOME/wheel-src
|
|
|
|
$out/bin/pipenv install $HOME/wheel-src
|
2019-11-13 16:28:27 +01:00
|
|
|
'';
|
2017-10-15 18:16:51 +02:00
|
|
|
|
2019-05-04 15:23:59 +02:00
|
|
|
meta = with lib; {
|
2019-03-06 18:56:44 +01:00
|
|
|
description = "Python Development Workflow for Humans";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ berdario ];
|
|
|
|
};
|
|
|
|
}
|