about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/pipenv/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/pipenv/default.nix')
-rw-r--r--nixpkgs/pkgs/development/tools/pipenv/default.nix47
1 files changed, 34 insertions, 13 deletions
diff --git a/nixpkgs/pkgs/development/tools/pipenv/default.nix b/nixpkgs/pkgs/development/tools/pipenv/default.nix
index 0e73b5ee3b60..c8e4d0e20069 100644
--- a/nixpkgs/pkgs/development/tools/pipenv/default.nix
+++ b/nixpkgs/pkgs/development/tools/pipenv/default.nix
@@ -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;