pipenv: remove wheel install test, enable unit tests

This commit is contained in:
Theodore Ni 2023-08-19 02:26:37 -07:00
parent ce3d6fe59b
commit 0ceee83540
No known key found for this signature in database
GPG Key ID: 48B67583BDDD4474

View File

@ -1,7 +1,7 @@
{ lib
, stdenv
, python3
, fetchPypi
, fetchFromGitHub
, installShellFiles
}:
@ -25,15 +25,22 @@ let
in buildPythonApplication rec {
pname = "pipenv";
version = "2023.2.4";
format = "pyproject";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-GKPrpRnjbVnw1af5xCvSaFIeS5t7PRvWrc8TFWkyMnU=";
src = fetchFromGitHub {
owner = "pypa";
repo = "pipenv";
rev = "refs/tags/v${version}";
hash = "sha256-jZOBu4mWyu8U6CGqtYgfcCCDSa0pGqoZEFnXl5IO+JY=";
};
LC_ALL = "en_US.UTF-8";
env.LC_ALL = "en_US.UTF-8";
nativeBuildInputs = [ installShellFiles ];
nativeBuildInputs = [
installShellFiles
setuptools
wheel
];
postPatch = ''
# pipenv invokes python in a subprocess to create a virtualenv
@ -46,6 +53,27 @@ in buildPythonApplication rec {
propagatedBuildInputs = runtimeDeps python3.pkgs;
preCheck = ''
export HOME="$TMPDIR"
'';
nativeCheckInputs = [
mock
pytestCheckHook
pytest-xdist
pytz
requests
];
disabledTests = [
"test_convert_deps_to_pip"
"test_download_file"
];
disabledTestPaths = [
"tests/integration"
];
postInstall = ''
installShellCompletion --cmd pipenv \
--bash <(_PIPENV_COMPLETE=bash_source $out/bin/pipenv) \
@ -53,13 +81,6 @@ in buildPythonApplication rec {
--fish <(_PIPENV_COMPLETE=fish_source $out/bin/pipenv)
'';
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;