about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/slowapi/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/slowapi/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/slowapi/default.nix16
1 files changed, 14 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/slowapi/default.nix b/nixpkgs/pkgs/development/python-modules/slowapi/default.nix
index 9ae293e455c7..430c17dfb61e 100644
--- a/nixpkgs/pkgs/development/python-modules/slowapi/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/slowapi/default.nix
@@ -7,6 +7,7 @@
 , hiro
 , poetry-core
 , pytestCheckHook
+, pythonAtLeast
 , pythonOlder
 , redis
 , starlette
@@ -16,6 +17,7 @@ buildPythonPackage rec {
   pname = "slowapi";
   version = "0.1.5";
   format = "pyproject";
+
   disabled = pythonOlder "3.6";
 
   src = fetchFromGitHub {
@@ -42,13 +44,23 @@ buildPythonPackage rec {
     starlette
   ];
 
+  postPatch = ''
+    substituteInPlace pyproject.toml \
+      --replace 'limits = "^1.5"' 'limits = "*"' \
+      --replace 'redis = "^3.4.1"' 'redis = "*"'
+  '';
+
   disabledTests = [
-    # E       AssertionError: Regex pattern 'parameter `request` must be an instance of starlette.requests.Request' does not match 'This portal is not running'.
+    # AssertionError: Regex pattern 'parameter `request` must be an instance of starlette.requests.Request' does not match 'This portal is not running'.
     "test_endpoint_request_param_invalid"
     "test_endpoint_response_param_invalid"
+  ] ++ lib.optionals (pythonAtLeast "3.10") [
+    "test_multiple_decorators"
   ];
 
-  pythonImportsCheck = [ "slowapi" ];
+  pythonImportsCheck = [
+    "slowapi"
+  ];
 
   meta = with lib; {
     description = "Python library for API rate limiting";