python312Packages.pint-xarray: init at 0.4 (#377344)
[NixPkgs.git] / pkgs / development / python-modules / flask-limiter / default.nix
blobf59ee0cf92638b0d306f84d5e78f23e1872193bb
2   lib,
3   asgiref,
4   buildPythonPackage,
5   fetchFromGitHub,
6   flask,
7   hiro,
8   limits,
9   ordered-set,
10   pymemcache,
11   pymongo,
12   pytest-cov-stub,
13   pytest-mock,
14   pytestCheckHook,
15   pythonOlder,
16   redis,
17   rich,
18   setuptools,
19   typing-extensions,
22 buildPythonPackage rec {
23   pname = "flask-limiter";
24   version = "3.10.1";
25   pyproject = true;
27   disabled = pythonOlder "3.9";
29   src = fetchFromGitHub {
30     owner = "alisaifee";
31     repo = "flask-limiter";
32     tag = version;
33     hash = "sha256-AfreBLyJDogXnxB5cIoT766VFiHIIoVKAoBIra6Q+xs=";
34   };
36   postPatch = ''
37     # flask-restful is unmaintained and breaks regularly, don't depend on it
38     substituteInPlace tests/test_views.py \
39       --replace-fail "import flask_restful" ""
40   '';
42   build-system = [ setuptools ];
44   dependencies = [
45     flask
46     limits
47     ordered-set
48     rich
49     typing-extensions
50   ];
52   optional-dependencies = {
53     redis = limits.optional-dependencies.redis;
54     memcached = limits.optional-dependencies.memcached;
55     mongodb = limits.optional-dependencies.mongodb;
56   };
58   nativeCheckInputs = [
59     asgiref
60     pytest-cov-stub
61     pytest-mock
62     pytestCheckHook
63     hiro
64     redis
65     pymemcache
66     pymongo
67   ];
69   disabledTests = [
70     # flask-restful is unmaintained and breaks regularly
71     "test_flask_restful_resource"
73     # Requires running a docker instance
74     "test_clear_limits"
75     "test_constructor_arguments_over_config"
76     "test_custom_key_prefix"
77     "test_custom_key_prefix_with_headers"
78     "test_fallback_to_memory_backoff_check"
79     "test_fallback_to_memory_config"
80     "test_fallback_to_memory_with_global_override"
81     "test_redis_request_slower_than_fixed_window"
82     "test_redis_request_slower_than_moving_window"
83     "test_reset_unsupported"
85     # Requires redis
86     "test_fallback_to_memory"
87   ];
89   disabledTestPaths = [
90     # requires running redis/memcached/mongodb
91     "tests/test_storage.py"
92   ];
94   pythonImportsCheck = [ "flask_limiter" ];
96   meta = with lib; {
97     description = "Rate limiting for flask applications";
98     homepage = "https://flask-limiter.readthedocs.org/";
99     changelog = "https://github.com/alisaifee/flask-limiter/blob/${version}/HISTORY.rst";
100     license = licenses.mit;
101     maintainers = [ ];
102   };