summary refs log tree commit diff
path: root/pkgs/development/python-modules/pytest-benchmark/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pytest-benchmark/default.nix')
-rw-r--r--pkgs/development/python-modules/pytest-benchmark/default.nix58
1 files changed, 49 insertions, 9 deletions
diff --git a/pkgs/development/python-modules/pytest-benchmark/default.nix b/pkgs/development/python-modules/pytest-benchmark/default.nix
index 6fd0cefb51c..135b0c2295e 100644
--- a/pkgs/development/python-modules/pytest-benchmark/default.nix
+++ b/pkgs/development/python-modules/pytest-benchmark/default.nix
@@ -1,16 +1,26 @@
 { lib
+, aspectlib
 , buildPythonPackage
+, elasticsearch
 , fetchFromGitHub
-, pathlib
+, fetchpatch
+, freezegun
+, git
+, mercurial
 , py-cpuinfo
+, pygal
 , pytest
+, pytestCheckHook
 , pythonOlder
-, statistics
+, isPy311
 }:
 
 buildPythonPackage rec {
   pname = "pytest-benchmark";
   version = "4.0.0";
+
+  disabled = pythonOlder "3.7";
+
   format = "setuptools";
 
   src = fetchFromGitHub {
@@ -20,28 +30,58 @@ buildPythonPackage rec {
     hash = "sha256-f9Ty4+5PycraxoLUSa9JFusV5Cot6bBWKfOGHZIRR3o=";
   };
 
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/ionelmc/pytest-benchmark/commit/728752d2976ef53fde7e40beb3e55f09cf4d4736.patch";
+      hash = "sha256-WIQADCLey5Y79UJUj9J5E02HQ0O86xBh/3IeGLpVrWI=";
+    })
+  ];
+
   buildInputs = [
     pytest
   ];
 
   propagatedBuildInputs = [
     py-cpuinfo
-  ] ++ lib.optionals (pythonOlder "3.4") [
-    pathlib
-    statistics
   ];
 
-  # Circular dependency
-  doCheck = false;
-
   pythonImportsCheck = [
     "pytest_benchmark"
   ];
 
+  nativeCheckInputs = [
+    aspectlib
+    elasticsearch
+    freezegun
+    git
+    mercurial
+    pygal
+    pytestCheckHook
+  ];
+
+  preCheck = ''
+    export PATH="$out/bin:$PATH"
+  '';
+
+  disabledTests = [
+    # AttributeError: 'PluginImportFixer' object has no attribute 'find_spec'
+    "test_compare_1"
+    "test_compare_2"
+    "test_regression_checks"
+    "test_rendering"
+  ]
+  # tests are broken in 3.11
+  # https://github.com/ionelmc/pytest-benchmark/issues/231
+  ++ lib.optionals isPy311 [
+    "test_abort_broken"
+    "test_clonefunc"
+  ];
+
   meta = with lib; {
+    changelog = "https://github.com/ionelmc/pytest-benchmark/blob/${src.rev}/CHANGELOG.rst";
     description = "Pytest fixture for benchmarking code";
     homepage = "https://github.com/ionelmc/pytest-benchmark";
     license = licenses.bsd2;
-    maintainers = with maintainers; [ costrouc ];
+    maintainers = with maintainers; [ dotlambda ];
   };
 }