limits 3.4.0__py3-none-any.whl → 3.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
limits/_version.py CHANGED
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2023-04-17T05:34:51-0700",
11
+ "date": "2023-08-31T07:36:32-0700",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "708c0d7f8bbad85f7ff09555517d9718df362e03",
15
- "version": "3.4.0"
14
+ "full-revisionid": "ada96bb4afc9729b4aac2552209a78428a27c313",
15
+ "version": "3.6.0"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -30,7 +30,6 @@ class MongoDBStorage(Storage, MovingWindowSupport):
30
30
 
31
31
  DEFAULT_OPTIONS: Dict[str, Union[float, str, bool]] = {
32
32
  "serverSelectionTimeoutMS": 1000,
33
- "socketTimeoutMS": 1000,
34
33
  "connectTimeoutMS": 1000,
35
34
  }
36
35
  "Default options passed to :class:`~motor.motor_asyncio.AsyncIOMotorClient`"
@@ -349,11 +349,6 @@ class RedisSentinelStorage(RedisStorage):
349
349
  STORAGE_SCHEME = ["async+redis+sentinel"]
350
350
  """The storage scheme for redis accessed via a redis sentinel installation"""
351
351
 
352
- DEFAULT_OPTIONS: Dict[str, Union[float, str, bool]] = {
353
- "stream_timeout": 0.2,
354
- }
355
- "Default options passed to :class:`~coredis.sentinel.Sentinel`"
356
-
357
352
  DEPENDENCIES = {"coredis.sentinel": Version("3.4.0")}
358
353
 
359
354
  def __init__(
@@ -402,8 +397,6 @@ class RedisSentinelStorage(RedisStorage):
402
397
  if self.service_name is None:
403
398
  raise ConfigurationError("'service_name' not provided")
404
399
 
405
- connection_options.setdefault("stream_timeout", 0.2)
406
-
407
400
  super(RedisStorage, self).__init__()
408
401
 
409
402
  self.dependency = self.dependencies["coredis.sentinel"].module
@@ -9,15 +9,14 @@ end
9
9
 
10
10
  local entry = redis.call('lindex', KEYS[1], limit - amount)
11
11
 
12
-
13
12
  if entry and tonumber(entry) >= timestamp - expiry then
14
13
  return false
15
14
  end
16
- local entries= {}
17
- for i=1, amount do
18
- entries[i] = timestamp
15
+
16
+ for i = 1, amount do
17
+ redis.call('lpush', KEYS[1], timestamp)
19
18
  end
20
- redis.call('lpush', KEYS[1], unpack(entries))
19
+
21
20
  redis.call('ltrim', KEYS[1], 0, limit - 1)
22
21
  redis.call('expire', KEYS[1], expiry)
23
22
 
limits/storage/mongodb.py CHANGED
@@ -26,7 +26,6 @@ class MongoDBStorage(Storage, MovingWindowSupport):
26
26
  STORAGE_SCHEME = ["mongodb", "mongodb+srv"]
27
27
  DEFAULT_OPTIONS: Dict[str, Union[int, str, bool]] = {
28
28
  "serverSelectionTimeoutMS": 1000,
29
- "socketTimeoutMS": 1000,
30
29
  "connectTimeoutMS": 1000,
31
30
  }
32
31
  "Default options passed to :class:`~pymongo.mongo_client.MongoClient`"
@@ -21,11 +21,6 @@ class RedisSentinelStorage(RedisStorage):
21
21
  STORAGE_SCHEME = ["redis+sentinel"]
22
22
  """The storage scheme for redis accessed via a redis sentinel installation"""
23
23
 
24
- DEFAULT_OPTIONS: Dict[str, Union[float, str, bool]] = {
25
- "socket_timeout": 0.2,
26
- }
27
- "Default options passed to :class:`~redis.sentinel.Sentinel`"
28
-
29
24
  DEPENDENCIES = {"redis.sentinel": Version("3.0")}
30
25
 
31
26
  def __init__(
@@ -79,7 +74,7 @@ class RedisSentinelStorage(RedisStorage):
79
74
  self.sentinel: "redis.sentinel.Sentinel" = sentinel_dep.Sentinel(
80
75
  sentinel_configuration,
81
76
  sentinel_kwargs={**parsed_auth, **sentinel_options},
82
- **{**self.DEFAULT_OPTIONS, **parsed_auth, **options}
77
+ **{**parsed_auth, **options}
83
78
  )
84
79
  self.storage = self.sentinel.master_for(self.service_name)
85
80
  self.storage_slave = self.sentinel.slave_for(self.service_name)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: limits
3
- Version: 3.4.0
3
+ Version: 3.6.0
4
4
  Summary: Rate limiting utilities
5
5
  Home-page: https://limits.readthedocs.org
6
6
  Author: Ali-Akber Saifee
@@ -14,7 +14,6 @@ Classifier: Operating System :: MacOS
14
14
  Classifier: Operating System :: POSIX :: Linux
15
15
  Classifier: Operating System :: OS Independent
16
16
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
- Classifier: Programming Language :: Python :: 3.7
18
17
  Classifier: Programming Language :: Python :: 3.8
19
18
  Classifier: Programming Language :: Python :: 3.9
20
19
  Classifier: Programming Language :: Python :: 3.10
@@ -22,41 +21,40 @@ Classifier: Programming Language :: Python :: 3.11
22
21
  Classifier: Programming Language :: Python :: Implementation :: PyPy
23
22
  Requires-Python: >=3.7
24
23
  License-File: LICENSE.txt
25
- Requires-Dist: deprecated (>=1.2)
26
- Requires-Dist: importlib-resources (>=1.3)
27
- Requires-Dist: setuptools
28
- Requires-Dist: packaging (<24,>=21)
24
+ Requires-Dist: deprecated >=1.2
25
+ Requires-Dist: importlib-resources >=1.3
26
+ Requires-Dist: packaging <24,>=21
29
27
  Requires-Dist: typing-extensions
30
28
  Provides-Extra: all
31
- Requires-Dist: redis (!=4.5.2,!=4.5.3,<5.0.0,>3) ; extra == 'all'
32
- Requires-Dist: redis (!=4.5.2,!=4.5.3,>=4.2.0) ; extra == 'all'
33
- Requires-Dist: pymemcache (<5.0.0,>3) ; extra == 'all'
34
- Requires-Dist: pymongo (<5,>4.1) ; extra == 'all'
29
+ Requires-Dist: redis !=4.5.2,!=4.5.3,<6.0.0,>3 ; extra == 'all'
30
+ Requires-Dist: redis !=4.5.2,!=4.5.3,>=4.2.0 ; extra == 'all'
31
+ Requires-Dist: pymemcache <5.0.0,>3 ; extra == 'all'
32
+ Requires-Dist: pymongo <5,>4.1 ; extra == 'all'
35
33
  Requires-Dist: etcd3 ; extra == 'all'
36
- Requires-Dist: motor (<4,>=3) ; extra == 'all'
34
+ Requires-Dist: coredis <5,>=3.4.0 ; extra == 'all'
35
+ Requires-Dist: motor <4,>=3 ; extra == 'all'
37
36
  Requires-Dist: aetcd ; extra == 'all'
38
- Requires-Dist: emcache (>=0.6.1) ; (python_version < "3.11") and extra == 'all'
39
- Requires-Dist: coredis (<5,>=3.4.0) ; (python_version > "3.7") and extra == 'all'
40
- Requires-Dist: emcache (>=1) ; (python_version >= "3.11") and extra == 'all'
37
+ Requires-Dist: emcache >=0.6.1 ; (python_version < "3.11") and extra == 'all'
38
+ Requires-Dist: emcache >=1 ; (python_version >= "3.11") and extra == 'all'
41
39
  Provides-Extra: async-etcd
42
40
  Requires-Dist: aetcd ; extra == 'async-etcd'
43
41
  Provides-Extra: async-memcached
44
- Requires-Dist: emcache (>=0.6.1) ; (python_version < "3.11") and extra == 'async-memcached'
45
- Requires-Dist: emcache (>=1) ; (python_version >= "3.11") and extra == 'async-memcached'
42
+ Requires-Dist: emcache >=0.6.1 ; (python_version < "3.11") and extra == 'async-memcached'
43
+ Requires-Dist: emcache >=1 ; (python_version >= "3.11") and extra == 'async-memcached'
46
44
  Provides-Extra: async-mongodb
47
- Requires-Dist: motor (<4,>=3) ; extra == 'async-mongodb'
45
+ Requires-Dist: motor <4,>=3 ; extra == 'async-mongodb'
48
46
  Provides-Extra: async-redis
49
- Requires-Dist: coredis (<5,>=3.4.0) ; (python_version > "3.7") and extra == 'async-redis'
47
+ Requires-Dist: coredis <5,>=3.4.0 ; extra == 'async-redis'
50
48
  Provides-Extra: etcd
51
49
  Requires-Dist: etcd3 ; extra == 'etcd'
52
50
  Provides-Extra: memcached
53
- Requires-Dist: pymemcache (<5.0.0,>3) ; extra == 'memcached'
51
+ Requires-Dist: pymemcache <5.0.0,>3 ; extra == 'memcached'
54
52
  Provides-Extra: mongodb
55
- Requires-Dist: pymongo (<5,>4.1) ; extra == 'mongodb'
53
+ Requires-Dist: pymongo <5,>4.1 ; extra == 'mongodb'
56
54
  Provides-Extra: redis
57
- Requires-Dist: redis (!=4.5.2,!=4.5.3,<5.0.0,>3) ; extra == 'redis'
55
+ Requires-Dist: redis !=4.5.2,!=4.5.3,<6.0.0,>3 ; extra == 'redis'
58
56
  Provides-Extra: rediscluster
59
- Requires-Dist: redis (!=4.5.2,!=4.5.3,>=4.2.0) ; extra == 'rediscluster'
57
+ Requires-Dist: redis !=4.5.2,!=4.5.3,>=4.2.0 ; extra == 'rediscluster'
60
58
 
61
59
  .. |ci| image:: https://github.com/alisaifee/limits/workflows/CI/badge.svg?branch=master
62
60
  :target: https://github.com/alisaifee/limits/actions?query=branch%3Amaster+workflow%3ACI
@@ -1,5 +1,5 @@
1
1
  limits/__init__.py,sha256=j_yVhgN9pdz8o5rQjVwdJTBSq8F-CTzof9kkiYgjRbw,728
2
- limits/_version.py,sha256=i_CrWuFPD570n-OBHIVqQAf2x9MimaS2ubLEMYD7cyc,497
2
+ limits/_version.py,sha256=5KtTqbQ9xQXrC3mRk9avjH69WNCQc8PltKm5xQRBCj4,497
3
3
  limits/errors.py,sha256=sUolBUfTFLQSzo6dfE2E9j_0K7_8Nr9_Hx-v5C4D0EU,416
4
4
  limits/limits.py,sha256=lwQnA5wegkW_AXtplOH3tLuQ1LByMX9hqHJquYVYdTs,4943
5
5
  limits/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -14,9 +14,9 @@ limits/aio/storage/base.py,sha256=gsy_91lvm53AoAKi1plaegcEOSZXK3OiMP0mxA6lPAw,29
14
14
  limits/aio/storage/etcd.py,sha256=iGGuKHN5cCW9r4nLeiZ4TnoU1pfSXXLZhS2YOWznryw,4568
15
15
  limits/aio/storage/memcached.py,sha256=aR7f5NY-mXtFFjphbaxoL7z1cAHZuRYjpGUVOktoI4A,4296
16
16
  limits/aio/storage/memory.py,sha256=A506i0vncBmsaL9GGAqepQkPAXyc-HxmJ8gS8kJtqpE,5597
17
- limits/aio/storage/mongodb.py,sha256=s_eUawyITOT7nPHeI_fgMVmDhm9XxhoQ_bmYD2aXius,9057
18
- limits/aio/storage/redis.py,sha256=PCLPvogKNhtK89LWiG8-l_k7luVgDh5gBKFkxIsQlZ4,14858
19
- limits/resources/redis/lua_scripts/acquire_moving_window.lua,sha256=-YmVj_MHE5N6WazXmkAw4j-CtAOWk4XroTXloXSdHrA,527
17
+ limits/aio/storage/mongodb.py,sha256=79D6HU3vGLmY1WDvtoaKItRHly7L__mZpu7XEmOgBnY,9024
18
+ limits/aio/storage/redis.py,sha256=eBfTtk5w0s8IQKWUBeqbVFrKFr5xTIcRC7eim7uoYnA,14630
19
+ limits/resources/redis/lua_scripts/acquire_moving_window.lua,sha256=5CFJX7D6T6RG5SFr6eVZ6zepmI1EkGWmKeVEO4QNrWo,483
20
20
  limits/resources/redis/lua_scripts/clear_keys.lua,sha256=zU0cVfLGmapRQF9x9u0GclapM_IB2pJLszNzVQ1QRK4,184
21
21
  limits/resources/redis/lua_scripts/incr_expire.lua,sha256=Uq9NcrrcDI-F87TDAJexoSJn2SDgeXIUEYozCp9S3oA,195
22
22
  limits/resources/redis/lua_scripts/moving_window.lua,sha256=ir0SkuRVnrqkVSFNIuedTV_KW6zG70Z56u6-_FpR_20,352
@@ -25,13 +25,13 @@ limits/storage/base.py,sha256=-JV-zAkss7pOETZyPYjo8ZZqTMGs-DPqgz_gcfArXfs,2818
25
25
  limits/storage/etcd.py,sha256=SlDHRItliRaR2j5Rf_v_oQ57ITpmNMYQJSamM3SbwCA,4258
26
26
  limits/storage/memcached.py,sha256=qMvRIEtRRzZXSgcZSUTBgUlBDeNOpIr_gDTV2r5SPak,6005
27
27
  limits/storage/memory.py,sha256=plPsyLB26QN9I6jQq00fra-cdh8xoDAgaoM-kWuECtk,5302
28
- limits/storage/mongodb.py,sha256=ZdFr2-MTtdPcOZE5XKd-XxNmbl9dHLZbU2PmqmH9CA4,7942
28
+ limits/storage/mongodb.py,sha256=Z4_Og2Ys6uwQT_D4dUDdDAEndBY7UfCh_LiHgZf8IUk,7909
29
29
  limits/storage/redis.py,sha256=nysRkOIK9pKTC1p0mBpIu5wHjmihLsFbwOx8nfFMpaI,7560
30
30
  limits/storage/redis_cluster.py,sha256=8578Slo-cwh5GdbuUDhYjQfBsWTwJyGoQ1d_mxVfcIM,5342
31
- limits/storage/redis_sentinel.py,sha256=fbTHyxeNsnGG4ll3hMDejE2C2DqWPpKwE3JklUY9pHA,3835
31
+ limits/storage/redis_sentinel.py,sha256=AxbtYZQXCNL-4yu7dQ8i6MhwO2PNLMRLHe3JcHkMKvA,3647
32
32
  limits/storage/registry.py,sha256=xcBcxuu6srqmoS4WqDpkCXnRLB19ctH98v21P8S9kS8,708
33
- limits-3.4.0.dist-info/LICENSE.txt,sha256=T6i7kq7F5gIPfcno9FCxU5Hcwm22Bjq0uHZV3ElcjsQ,1061
34
- limits-3.4.0.dist-info/METADATA,sha256=mjhfU40iP1TxeuFFJ9pqxZzUhstTlm-Vr-pILEUFaEk,7486
35
- limits-3.4.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
36
- limits-3.4.0.dist-info/top_level.txt,sha256=C7g5ahldPoU2s6iWTaJayUrbGmPK1d6e9t5Nn0vQ2jM,7
37
- limits-3.4.0.dist-info/RECORD,,
33
+ limits-3.6.0.dist-info/LICENSE.txt,sha256=T6i7kq7F5gIPfcno9FCxU5Hcwm22Bjq0uHZV3ElcjsQ,1061
34
+ limits-3.6.0.dist-info/METADATA,sha256=YXO0qBkd4XtBcXu5OvH7d_VUubzVMEPY1hxQSNIZjrY,7314
35
+ limits-3.6.0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
36
+ limits-3.6.0.dist-info/top_level.txt,sha256=C7g5ahldPoU2s6iWTaJayUrbGmPK1d6e9t5Nn0vQ2jM,7
37
+ limits-3.6.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.40.0)
2
+ Generator: bdist_wheel (0.41.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5