2021-02-27 16:00:42 +00:00
|
|
|
{ lib
|
2023-06-11 16:58:16 +00:00
|
|
|
, asgiref
|
2021-02-27 16:00:42 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, flask
|
2023-06-11 16:58:16 +00:00
|
|
|
, hiro
|
2021-02-27 16:00:42 +00:00
|
|
|
, limits
|
2022-12-31 03:13:19 +00:00
|
|
|
, ordered-set
|
2021-02-27 16:00:42 +00:00
|
|
|
, pymemcache
|
2023-06-11 16:58:16 +00:00
|
|
|
, pymongo
|
2022-08-26 07:10:18 +00:00
|
|
|
, pytest-mock
|
2021-02-27 16:00:42 +00:00
|
|
|
, pytestCheckHook
|
2023-06-11 16:58:16 +00:00
|
|
|
, pythonOlder
|
2021-02-27 16:00:42 +00:00
|
|
|
, redis
|
2023-06-11 16:58:16 +00:00
|
|
|
, rich
|
2024-03-05 08:20:44 +00:00
|
|
|
, setuptools
|
2023-06-11 16:58:16 +00:00
|
|
|
, typing-extensions
|
2021-02-27 16:00:42 +00:00
|
|
|
}:
|
2018-01-20 10:49:15 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2023-03-01 00:06:29 +00:00
|
|
|
pname = "flask-limiter";
|
2024-02-13 00:53:19 +00:00
|
|
|
version = "3.5.1";
|
2024-03-05 08:20:44 +00:00
|
|
|
pyproject = true;
|
2018-01-20 10:49:15 +00:00
|
|
|
|
2023-06-11 16:58:16 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2021-02-27 16:00:42 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "alisaifee";
|
|
|
|
repo = "flask-limiter";
|
2022-12-31 03:13:19 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-02-13 00:53:19 +00:00
|
|
|
hash = "sha256-U7qgl8yg0ddKDPXqYE2Vqyc2ofxSP+6liWs5j4qD6fM=";
|
2018-01-20 10:49:15 +00:00
|
|
|
};
|
|
|
|
|
2022-12-31 03:13:19 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i "/--cov/d" pytest.ini
|
|
|
|
|
|
|
|
# flask-restful is unmaintained and breaks regularly, don't depend on it
|
|
|
|
sed -i "/import flask_restful/d" tests/test_views.py
|
|
|
|
'';
|
|
|
|
|
2024-03-05 08:20:44 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2022-08-26 07:10:18 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
flask
|
|
|
|
limits
|
2022-12-31 03:13:19 +00:00
|
|
|
ordered-set
|
2022-08-26 07:10:18 +00:00
|
|
|
rich
|
|
|
|
typing-extensions
|
|
|
|
];
|
2018-01-20 10:49:15 +00:00
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-26 07:10:18 +00:00
|
|
|
asgiref
|
|
|
|
pytest-mock
|
2021-02-27 16:00:42 +00:00
|
|
|
pytestCheckHook
|
|
|
|
hiro
|
|
|
|
redis
|
|
|
|
pymemcache
|
2022-08-26 07:10:18 +00:00
|
|
|
pymongo
|
2021-02-27 16:00:42 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
2022-08-26 07:10:18 +00:00
|
|
|
# flask-restful is unmaintained and breaks regularly
|
|
|
|
"test_flask_restful_resource"
|
|
|
|
|
|
|
|
# Requires running a docker instance
|
|
|
|
"test_clear_limits"
|
2021-02-27 16:00:42 +00:00
|
|
|
"test_constructor_arguments_over_config"
|
2022-08-26 07:10:18 +00:00
|
|
|
"test_custom_key_prefix"
|
|
|
|
"test_custom_key_prefix_with_headers"
|
2021-02-27 16:00:42 +00:00
|
|
|
"test_fallback_to_memory_backoff_check"
|
2022-08-26 07:10:18 +00:00
|
|
|
"test_fallback_to_memory_config"
|
2021-02-27 16:00:42 +00:00
|
|
|
"test_fallback_to_memory_with_global_override"
|
|
|
|
"test_redis_request_slower_than_fixed_window"
|
|
|
|
"test_redis_request_slower_than_moving_window"
|
2022-08-26 07:10:18 +00:00
|
|
|
"test_reset_unsupported"
|
|
|
|
|
|
|
|
# Requires redis
|
|
|
|
"test_fallback_to_memory"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# requires running redis/memcached/mongodb
|
|
|
|
"tests/test_storage.py"
|
2021-02-27 16:00:42 +00:00
|
|
|
];
|
|
|
|
|
2023-06-11 16:58:16 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"flask_limiter"
|
|
|
|
];
|
2021-02-27 16:00:42 +00:00
|
|
|
|
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 01:11:51 +00:00
|
|
|
homepage = "https://flask-limiter.readthedocs.org/";
|
2023-06-11 16:58:16 +00:00
|
|
|
changelog = "https://github.com/alisaifee/flask-limiter/blob/${version}/HISTORY.rst";
|
2018-01-20 10:49:15 +00:00
|
|
|
license = licenses.mit;
|
2023-03-01 00:06:29 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2018-01-20 10:49:15 +00:00
|
|
|
};
|
|
|
|
}
|