about summary refs log tree commit diff
path: root/pkgs/development/python-modules/flask-limiter
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2021-02-27 17:00:42 +0100
committerFabian Affolter <mail@fabian-affolter.ch>2021-04-02 12:29:53 +0200
commit622743709a74424043a19b0f0fe49289146a538d (patch)
tree57e556d99cbc81d3ae0d61c6dbd04e0c3f8978da /pkgs/development/python-modules/flask-limiter
parent7bb0f30b7f92ec2271bfa5dc763ba663c9137188 (diff)
python3Packages.python-awair: 0.2.1 -> 0.2.2
Diffstat (limited to 'pkgs/development/python-modules/flask-limiter')
-rw-r--r--pkgs/development/python-modules/flask-limiter/default.nix52
1 files changed, 48 insertions, 4 deletions
diff --git a/pkgs/development/python-modules/flask-limiter/default.nix b/pkgs/development/python-modules/flask-limiter/default.nix
index d22096f914943..418225550167d 100644
--- a/pkgs/development/python-modules/flask-limiter/default.nix
+++ b/pkgs/development/python-modules/flask-limiter/default.nix
@@ -1,16 +1,60 @@
-{ lib, fetchPypi, buildPythonPackage, flask, limits }:
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, flask
+, flask-restful
+, hiro
+, limits
+, mock
+, ordereddict
+, pymemcache
+, pytestCheckHook
+, redis
+}:
 
 buildPythonPackage rec {
   pname = "Flask-Limiter";
   version = "1.4";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "021279c905a1e24f181377ab3be711be7541734b494f4e6db2b8edeba7601e48";
+  src = fetchFromGitHub {
+    owner = "alisaifee";
+    repo = "flask-limiter";
+    rev = version;
+    sha256 = "1k1b4b3s1acphqnar0y5g747bh1y7w35gcl5g819idq2a5vqnass";
   };
 
   propagatedBuildInputs = [ flask limits ];
 
+  checkInputs = [
+    pytestCheckHook
+    hiro
+    mock
+    redis
+    flask-restful
+    pymemcache
+    ordereddict
+  ];
+
+  postPatch = ''
+    sed -i "/--cov/d" pytest.ini
+  '';
+
+  # Some tests requires a local Redis instance
+  disabledTests = [
+    "test_fallback_to_memory"
+    "test_reset_unsupported"
+    "test_constructor_arguments_over_config"
+    "test_fallback_to_memory_config"
+    "test_fallback_to_memory_backoff_check"
+    "test_fallback_to_memory_with_global_override"
+    "test_custom_key_prefix"
+    "test_redis_request_slower_than_fixed_window"
+    "test_redis_request_slower_than_moving_window"
+    "test_custom_key_prefix_with_headers"
+  ];
+
+  pythonImportsCheck = [ "flask_limiter" ];
+
   meta = with lib; {
     description = "Rate limiting for flask applications";
     homepage = "https://flask-limiter.readthedocs.org/";