2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, python3
|
|
|
|
}:
|
|
|
|
|
|
|
|
with python3.pkgs;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
runtimeDeps = [
|
|
|
|
certifi
|
|
|
|
setuptools
|
|
|
|
pip
|
|
|
|
virtualenv
|
|
|
|
virtualenv-clone
|
|
|
|
];
|
|
|
|
|
2020-06-02 18:00:15 +00:00
|
|
|
pythonEnv = python3.withPackages(ps: with ps; runtimeDeps);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
in buildPythonApplication rec {
|
|
|
|
pname = "pipenv";
|
2020-06-02 18:00:15 +00:00
|
|
|
version = "2020.5.28";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-06-02 18:00:15 +00:00
|
|
|
sha256 = "072lc4nywcf9q9irvanwcz7w0sd9dcyannz208jm6glyj8a271l1";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
LC_ALL = "en_US.UTF-8";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# pipenv invokes python in a subprocess to create a virtualenv
|
2020-06-02 18:00:15 +00: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.
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace pipenv/core.py \
|
2020-06-02 18:00:15 +00:00
|
|
|
--replace "sys.executable" "'${pythonEnv.interpreter}'"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = runtimeDeps;
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
cp -r --no-preserve=mode ${wheel.src} $HOME/wheel-src
|
|
|
|
$out/bin/pipenv install $HOME/wheel-src
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python Development Workflow for Humans";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ berdario ];
|
|
|
|
};
|
|
|
|
}
|