nixpkgs/pkgs/development/tools/pipenv/default.nix

55 lines
1.2 KiB
Nix
Raw Normal View History

{ lib
, python3
}:
with python3.pkgs;
let
runtimeDeps = ps: with ps; [
certifi
setuptools
pip
virtualenv
virtualenv-clone
];
pythonEnv = python3.withPackages runtimeDeps;
in buildPythonApplication rec {
pname = "pipenv";
2021-09-13 00:14:55 +01:00
version = "2021.5.29";
2017-10-15 17:16:51 +01:00
src = fetchPypi {
inherit pname version;
2021-09-13 00:14:55 +01:00
sha256 = "05958fadcd70b2de6a27542fcd2bd72dd5c59c6d35307fdac3e06361fb06e30e";
};
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
2020-05-29 12:47:03 +01: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.
substituteInPlace pipenv/core.py \
2020-05-29 12:47:03 +01:00
--replace "sys.executable" "'${pythonEnv.interpreter}'"
'';
propagatedBuildInputs = runtimeDeps python3.pkgs;
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 ];
};
}