about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2022-01-17 02:16:21 +0100
committerMartin Weinelt <hexa@darmstadt.ccc.de>2022-01-23 01:09:33 +0100
commitd1a4527ed67cb245303a9e619da78b4e0e49329b (patch)
treed0d5c6b3bcd8f143506329a1bc90572e7a9fa0ab
parent5aa214e4aa59285e2d9fba3836537fc48353f954 (diff)
python3Packages.readchar: fix build
-rw-r--r--pkgs/development/python-modules/readchar/default.nix32
1 files changed, 27 insertions, 5 deletions
diff --git a/pkgs/development/python-modules/readchar/default.nix b/pkgs/development/python-modules/readchar/default.nix
index 817bebc71b2e3..81c489bd8c09d 100644
--- a/pkgs/development/python-modules/readchar/default.nix
+++ b/pkgs/development/python-modules/readchar/default.nix
@@ -1,19 +1,41 @@
-{ lib, buildPythonPackage, fetchFromGitHub, flake8, pytest, pytest-cov, pexpect }:
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+
+# native
+, flake8
+
+# tests
+, pytestCheckHook
+, pexpect
+}:
 
 buildPythonPackage rec {
   pname = "readchar";
   version = "3.0.5";
+  format = "setuptools";
 
   # Don't use wheels on PyPI
   src = fetchFromGitHub {
     owner = "magmax";
     repo = "python-${pname}";
-    rev = version;
-    sha256 = "01bjw3ipdzxq1ijn9354nlya625i26ri7jac1dnlj1d1gdd8m5lx";
+    rev = "v${version}";
+    sha256 = "sha256:01bjw3ipdzxq1ijn9354nlya625i26ri7jac1dnlj1d1gdd8m5lx";
   };
 
-  nativeBuildInputs = [ flake8 ];
-  checkInputs = [ pytest pytest-cov pexpect ];
+  postPatch = ''
+    substituteInPlace setup.cfg \
+      --replace "--cov readchar" ""
+  '';
+
+  nativeBuildInputs = [
+    flake8
+  ];
+
+  checkInputs = [
+    pytestCheckHook
+    pexpect
+  ];
 
   meta = with lib; {
     homepage = "https://github.com/magmax/python-readchar";