2021-02-27 16:00:42 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, flask
|
|
|
|
, flask-restful
|
|
|
|
, hiro
|
|
|
|
, limits
|
|
|
|
, mock
|
|
|
|
, ordereddict
|
|
|
|
, pymemcache
|
|
|
|
, pytestCheckHook
|
|
|
|
, redis
|
|
|
|
}:
|
2018-01-20 10:49:15 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "Flask-Limiter";
|
2020-11-29 14:04:28 +00:00
|
|
|
version = "1.4";
|
2018-01-20 10:49:15 +00:00
|
|
|
|
2021-02-27 16:00:42 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "alisaifee";
|
|
|
|
repo = "flask-limiter";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "1k1b4b3s1acphqnar0y5g747bh1y7w35gcl5g819idq2a5vqnass";
|
2018-01-20 10:49:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ flask limits ];
|
|
|
|
|
2021-02-27 16:00:42 +00:00
|
|
|
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" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-01-20 10:49:15 +00:00
|
|
|
description = "Rate limiting for flask applications";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://flask-limiter.readthedocs.org/";
|
2018-01-20 10:49:15 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|