about summary refs log tree commit diff
path: root/pkgs/development/python-modules/ansi
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2022-03-03 23:45:59 +0100
committerMartin Weinelt <hexa@darmstadt.ccc.de>2022-03-14 00:29:05 +0100
commitda5aba49bc48daacd7c6c414ab5574902e8a60cd (patch)
tree4460c3c62345866bdab4476c0538a523990009fe /pkgs/development/python-modules/ansi
parent389beb05dc70172f9d67319190eeb56c3c07762f (diff)
python3Packages.ansi: fix build, enable tests
Diffstat (limited to 'pkgs/development/python-modules/ansi')
-rw-r--r--pkgs/development/python-modules/ansi/default.nix26
1 files changed, 19 insertions, 7 deletions
diff --git a/pkgs/development/python-modules/ansi/default.nix b/pkgs/development/python-modules/ansi/default.nix
index 73873f8c4cb2c..5847e3ad0f9e8 100644
--- a/pkgs/development/python-modules/ansi/default.nix
+++ b/pkgs/development/python-modules/ansi/default.nix
@@ -1,17 +1,29 @@
-{ lib, buildPythonPackage, fetchPypi }:
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pytestCheckHook
+}:
 
 buildPythonPackage rec {
   pname = "ansi";
   version = "0.3.6";
+  format = "pyproject";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "sha256-EFRc4lCORw6SCNDMIAYWAy/cgbhJZ4gm+3yByCP9SLE=";
+  src = fetchFromGitHub {
+    owner = "tehmaze";
+    repo = pname;
+    rev = "${pname}-${version}";
+    hash = "sha256-2gu2Dba3LOjMhbCCZrBqzlOor5KqDYThhe8OP8J3O2M=";
   };
 
-  checkPhase = ''
-    python -c "import ansi.color"
-  '';
+  checkInputs = [
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "ansi.colour"
+    "ansi.color"
+  ];
 
   meta = with lib; {
     description = "ANSI cursor movement and graphics";