about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2022-01-17 02:29:51 +0100
committerMartin Weinelt <hexa@darmstadt.ccc.de>2022-01-23 01:09:33 +0100
commit0e2b063114b57001a2423ccaa86cb417f6085a13 (patch)
tree3052b00cda2d40caf1a9d15a3e5f382b68bf8432
parentd1a4527ed67cb245303a9e619da78b4e0e49329b (diff)
python3Packages.inquirer: fix build and src
-rw-r--r--pkgs/development/python-modules/inquirer/default.nix48
1 files changed, 33 insertions, 15 deletions
diff --git a/pkgs/development/python-modules/inquirer/default.nix b/pkgs/development/python-modules/inquirer/default.nix
index f8c13dc138045..dd2db106aceab 100644
--- a/pkgs/development/python-modules/inquirer/default.nix
+++ b/pkgs/development/python-modules/inquirer/default.nix
@@ -1,30 +1,48 @@
-{ lib, buildPythonPackage, fetchFromGitHub, python-editor, readchar, blessed, pytest, pytest-cov, pexpect, pytest-mock }:
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+
+# native
+, poetry-core
+
+# propagated
+, blessed
+, python-editor
+, readchar
+
+# tests
+, pytest-mock
+, pytestCheckHook
+, pexpect
+}:
 
 buildPythonPackage rec {
   pname = "inquirer";
   version = "2.9.1";
+  format = "pyproject";
 
-  # PyPi archive currently broken: https://github.com/magmax/python-inquirer/issues/106
   src = fetchFromGitHub rec {
     owner = "magmax";
     repo = "python-inquirer";
-    rev = version;
-    sha256 = "0vdly2k4i7bfcqc8zh2miv9dbpmqvayxk72qn9d4hr7z15wph233";
+    rev = "v${version}";
+    sha256 = "sha256:0vdly2k4i7bfcqc8zh2miv9dbpmqvayxk72qn9d4hr7z15wph233";
   };
 
-  propagatedBuildInputs = [ blessed python-editor readchar ];
-
-  postPatch = ''
-   substituteInPlace requirements.txt \
-     --replace "blessed==1.17.6" "blessed~=1.17" \
-     --replace "readchar==2.0.1" "readchar>=2.0.0"
-  '';
+  nativeBuildInputs = [
+    poetry-core
+  ];
 
-  checkInputs = [ pytest pytest-cov pexpect pytest-mock ];
+  propagatedBuildInputs = [
+    blessed
+    python-editor
+    readchar
+  ];
 
-  checkPhase = ''
-    pytest --cov-report=term-missing  --cov inquirer --no-cov-on-fail tests/unit tests/integration
-  '';
+  checkInputs = [
+    pexpect
+    pytest-mock
+    pytestCheckHook
+  ];
 
   meta = with lib; {
     homepage = "https://github.com/magmax/python-inquirer";