1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-04 19:45:54 +00:00
nixpkgs/pkgs/development/tools/pipenv/default.nix

56 lines
1.2 KiB
Nix
Raw Normal View History

{ lib
, python3
}:
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";
2017-10-15 17:16:51 +01:00
src = fetchPypi {
inherit pname version;
sha256 = "0ip8zsrwmhrankrix0shig9g8q2knmr7b63sh7lqa8a5x03fcwx6";
};
2017-10-15 17:16:51 +01:00
LC_ALL = "en_US.UTF-8";
2017-10-15 17:16:51 +01:00
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 = runtimeDeps;
2017-10-15 17:16:51 +01:00
doCheck = true;
checkPhase = ''
export HOME=$(mktemp -d)
cp -r --no-preserve=mode ${wheel.src} $HOME/wheel-src
$out/bin/pipenv install $HOME/wheel-src
'';
2017-10-15 17:16:51 +01:00
meta = with lib; {
description = "Python Development Workflow for Humans";
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ berdario ];
};
}