about summary refs log tree commit diff
path: root/pkgs/development/python-modules/deprecation
diff options
context:
space:
mode:
authorJonathan Ringer <jonringer117@gmail.com>2022-01-11 14:31:28 -0800
committerJonathan Ringer <jonringer@users.noreply.github.com>2022-01-12 11:37:58 -0800
commitf5d5398b0e4dffa058939363bb78a126e65dba10 (patch)
tree36b9e5058ecddbef4646f581b857af95e00c31e2 /pkgs/development/python-modules/deprecation
parent1fe644a83fde8a9712fc30a7ee07aadc1db68de9 (diff)
python310Packages.deprecations: fix tests
Diffstat (limited to 'pkgs/development/python-modules/deprecation')
-rw-r--r--pkgs/development/python-modules/deprecation/default.nix24
1 files changed, 22 insertions, 2 deletions
diff --git a/pkgs/development/python-modules/deprecation/default.nix b/pkgs/development/python-modules/deprecation/default.nix
index fb5698062f77b..d77554c79ab80 100644
--- a/pkgs/development/python-modules/deprecation/default.nix
+++ b/pkgs/development/python-modules/deprecation/default.nix
@@ -1,4 +1,11 @@
-{ lib, buildPythonPackage, fetchPypi, python, packaging, unittest2 }:
+{ lib, buildPythonPackage, fetchPypi
+, fetchpatch
+, packaging
+, python
+, pythonAtLeast
+, pythonOlder
+, unittest2
+}:
 
 buildPythonPackage rec {
   pname = "deprecation";
@@ -9,9 +16,22 @@ buildPythonPackage rec {
     sha256 = "1zqqjlgmhgkpzg9ss5ki8wamxl83xn51fs6gn2a8cxsx9vkbvcvj";
   };
 
+  patches = lib.optionals (pythonAtLeast "3.10") [
+    # fixes for python 3.10 test suite
+    (fetchpatch {
+      url = "https://github.com/briancurtin/deprecation/pull/57/commits/e13e23068cb8d653a02a434a159e8b0b7226ffd6.patch";
+      sha256 = "sha256-/5zr2V1s5ULUZnbLXsgyHxZH4m7/a27QYuqQt2Savc8=";
+      includes = [ "tests/test_deprecation.py" ];
+    })
+  ];
+
   propagatedBuildInputs = [ packaging ];
 
-  checkInputs = [ unittest2 ];
+  # avoiding mass rebuilds for python3.9, but no longer
+  # needed with patch
+  checkInputs = lib.optional (pythonOlder "3.10") [
+    unittest2
+  ];
 
   checkPhase = ''
     ${python.interpreter} -m unittest discover