limits 5.2.0__tar.gz → 5.3.0__tar.gz

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.
Files changed (96) hide show
  1. {limits-5.2.0 → limits-5.3.0}/HISTORY.rst +12 -0
  2. {limits-5.2.0 → limits-5.3.0}/PKG-INFO +1 -1
  3. {limits-5.2.0 → limits-5.3.0}/limits/_version.py +3 -3
  4. {limits-5.2.0 → limits-5.3.0}/limits/aio/storage/memory.py +6 -6
  5. {limits-5.2.0 → limits-5.3.0}/limits.egg-info/PKG-INFO +1 -1
  6. {limits-5.2.0 → limits-5.3.0}/CLASSIFIERS +0 -0
  7. {limits-5.2.0 → limits-5.3.0}/CONTRIBUTIONS.rst +0 -0
  8. {limits-5.2.0 → limits-5.3.0}/LICENSE.txt +0 -0
  9. {limits-5.2.0 → limits-5.3.0}/MANIFEST.in +0 -0
  10. {limits-5.2.0 → limits-5.3.0}/README.rst +0 -0
  11. {limits-5.2.0 → limits-5.3.0}/doc/Makefile +0 -0
  12. {limits-5.2.0 → limits-5.3.0}/doc/source/_static/custom.css +0 -0
  13. {limits-5.2.0 → limits-5.3.0}/doc/source/api.rst +0 -0
  14. {limits-5.2.0 → limits-5.3.0}/doc/source/async.rst +0 -0
  15. {limits-5.2.0 → limits-5.3.0}/doc/source/changelog.rst +0 -0
  16. {limits-5.2.0 → limits-5.3.0}/doc/source/conf.py +0 -0
  17. {limits-5.2.0 → limits-5.3.0}/doc/source/custom-storage.rst +0 -0
  18. {limits-5.2.0 → limits-5.3.0}/doc/source/ext/_static/benchmark-chart.css +0 -0
  19. {limits-5.2.0 → limits-5.3.0}/doc/source/ext/_static/js/benchmark-chart.js +0 -0
  20. {limits-5.2.0 → limits-5.3.0}/doc/source/ext/_static/js/benchmark-details.js +0 -0
  21. {limits-5.2.0 → limits-5.3.0}/doc/source/ext/_static/js/benchmark-loader.js +0 -0
  22. {limits-5.2.0 → limits-5.3.0}/doc/source/ext/_templates/git_info.js +0 -0
  23. {limits-5.2.0 → limits-5.3.0}/doc/source/ext/bench_chart.py +0 -0
  24. {limits-5.2.0 → limits-5.3.0}/doc/source/index.rst +0 -0
  25. {limits-5.2.0 → limits-5.3.0}/doc/source/installation.rst +0 -0
  26. {limits-5.2.0 → limits-5.3.0}/doc/source/performance.rst +0 -0
  27. {limits-5.2.0 → limits-5.3.0}/doc/source/quickstart.rst +0 -0
  28. {limits-5.2.0 → limits-5.3.0}/doc/source/storage.rst +0 -0
  29. {limits-5.2.0 → limits-5.3.0}/doc/source/strategies.rst +0 -0
  30. {limits-5.2.0 → limits-5.3.0}/doc/source/theme_config.py +0 -0
  31. {limits-5.2.0 → limits-5.3.0}/limits/__init__.py +0 -0
  32. {limits-5.2.0 → limits-5.3.0}/limits/aio/__init__.py +0 -0
  33. {limits-5.2.0 → limits-5.3.0}/limits/aio/storage/__init__.py +0 -0
  34. {limits-5.2.0 → limits-5.3.0}/limits/aio/storage/base.py +0 -0
  35. {limits-5.2.0 → limits-5.3.0}/limits/aio/storage/memcached/__init__.py +0 -0
  36. {limits-5.2.0 → limits-5.3.0}/limits/aio/storage/memcached/bridge.py +0 -0
  37. {limits-5.2.0 → limits-5.3.0}/limits/aio/storage/memcached/emcache.py +0 -0
  38. {limits-5.2.0 → limits-5.3.0}/limits/aio/storage/memcached/memcachio.py +0 -0
  39. {limits-5.2.0 → limits-5.3.0}/limits/aio/storage/mongodb.py +0 -0
  40. {limits-5.2.0 → limits-5.3.0}/limits/aio/storage/redis/__init__.py +0 -0
  41. {limits-5.2.0 → limits-5.3.0}/limits/aio/storage/redis/bridge.py +0 -0
  42. {limits-5.2.0 → limits-5.3.0}/limits/aio/storage/redis/coredis.py +0 -0
  43. {limits-5.2.0 → limits-5.3.0}/limits/aio/storage/redis/redispy.py +0 -0
  44. {limits-5.2.0 → limits-5.3.0}/limits/aio/storage/redis/valkey.py +0 -0
  45. {limits-5.2.0 → limits-5.3.0}/limits/aio/strategies.py +0 -0
  46. {limits-5.2.0 → limits-5.3.0}/limits/errors.py +0 -0
  47. {limits-5.2.0 → limits-5.3.0}/limits/limits.py +0 -0
  48. {limits-5.2.0 → limits-5.3.0}/limits/py.typed +0 -0
  49. {limits-5.2.0 → limits-5.3.0}/limits/resources/redis/lua_scripts/acquire_moving_window.lua +0 -0
  50. {limits-5.2.0 → limits-5.3.0}/limits/resources/redis/lua_scripts/acquire_sliding_window.lua +0 -0
  51. {limits-5.2.0 → limits-5.3.0}/limits/resources/redis/lua_scripts/clear_keys.lua +0 -0
  52. {limits-5.2.0 → limits-5.3.0}/limits/resources/redis/lua_scripts/incr_expire.lua +0 -0
  53. {limits-5.2.0 → limits-5.3.0}/limits/resources/redis/lua_scripts/moving_window.lua +0 -0
  54. {limits-5.2.0 → limits-5.3.0}/limits/resources/redis/lua_scripts/sliding_window.lua +0 -0
  55. {limits-5.2.0 → limits-5.3.0}/limits/storage/__init__.py +0 -0
  56. {limits-5.2.0 → limits-5.3.0}/limits/storage/base.py +0 -0
  57. {limits-5.2.0 → limits-5.3.0}/limits/storage/memcached.py +0 -0
  58. {limits-5.2.0 → limits-5.3.0}/limits/storage/memory.py +0 -0
  59. {limits-5.2.0 → limits-5.3.0}/limits/storage/mongodb.py +0 -0
  60. {limits-5.2.0 → limits-5.3.0}/limits/storage/redis.py +0 -0
  61. {limits-5.2.0 → limits-5.3.0}/limits/storage/redis_cluster.py +0 -0
  62. {limits-5.2.0 → limits-5.3.0}/limits/storage/redis_sentinel.py +0 -0
  63. {limits-5.2.0 → limits-5.3.0}/limits/storage/registry.py +0 -0
  64. {limits-5.2.0 → limits-5.3.0}/limits/strategies.py +0 -0
  65. {limits-5.2.0 → limits-5.3.0}/limits/typing.py +0 -0
  66. {limits-5.2.0 → limits-5.3.0}/limits/util.py +0 -0
  67. {limits-5.2.0 → limits-5.3.0}/limits/version.py +0 -0
  68. {limits-5.2.0 → limits-5.3.0}/limits.egg-info/SOURCES.txt +0 -0
  69. {limits-5.2.0 → limits-5.3.0}/limits.egg-info/dependency_links.txt +0 -0
  70. {limits-5.2.0 → limits-5.3.0}/limits.egg-info/not-zip-safe +0 -0
  71. {limits-5.2.0 → limits-5.3.0}/limits.egg-info/requires.txt +0 -0
  72. {limits-5.2.0 → limits-5.3.0}/limits.egg-info/top_level.txt +0 -0
  73. {limits-5.2.0 → limits-5.3.0}/pyproject.toml +0 -0
  74. {limits-5.2.0 → limits-5.3.0}/requirements/ci.txt +0 -0
  75. {limits-5.2.0 → limits-5.3.0}/requirements/dev.txt +0 -0
  76. {limits-5.2.0 → limits-5.3.0}/requirements/docs.txt +0 -0
  77. {limits-5.2.0 → limits-5.3.0}/requirements/main.txt +0 -0
  78. {limits-5.2.0 → limits-5.3.0}/requirements/storage/async-memcached.txt +0 -0
  79. {limits-5.2.0 → limits-5.3.0}/requirements/storage/async-mongodb.txt +0 -0
  80. {limits-5.2.0 → limits-5.3.0}/requirements/storage/async-redis.txt +0 -0
  81. {limits-5.2.0 → limits-5.3.0}/requirements/storage/async-valkey.txt +0 -0
  82. {limits-5.2.0 → limits-5.3.0}/requirements/storage/memcached.txt +0 -0
  83. {limits-5.2.0 → limits-5.3.0}/requirements/storage/mongodb.txt +0 -0
  84. {limits-5.2.0 → limits-5.3.0}/requirements/storage/redis.txt +0 -0
  85. {limits-5.2.0 → limits-5.3.0}/requirements/storage/rediscluster.txt +0 -0
  86. {limits-5.2.0 → limits-5.3.0}/requirements/storage/valkey.txt +0 -0
  87. {limits-5.2.0 → limits-5.3.0}/requirements/test.txt +0 -0
  88. {limits-5.2.0 → limits-5.3.0}/setup.cfg +0 -0
  89. {limits-5.2.0 → limits-5.3.0}/setup.py +0 -0
  90. {limits-5.2.0 → limits-5.3.0}/tests/test_limit_granularities.py +0 -0
  91. {limits-5.2.0 → limits-5.3.0}/tests/test_limits.py +0 -0
  92. {limits-5.2.0 → limits-5.3.0}/tests/test_ratelimit_parser.py +0 -0
  93. {limits-5.2.0 → limits-5.3.0}/tests/test_storage.py +0 -0
  94. {limits-5.2.0 → limits-5.3.0}/tests/test_strategy.py +0 -0
  95. {limits-5.2.0 → limits-5.3.0}/tests/test_utils.py +0 -0
  96. {limits-5.2.0 → limits-5.3.0}/versioneer.py +0 -0
@@ -3,6 +3,17 @@
3
3
  Changelog
4
4
  =========
5
5
 
6
+ v5.3.0
7
+ ------
8
+ Release Date: 2025-06-13
9
+
10
+ * Bug Fix
11
+
12
+ * Fix race condition during expiration of in-memory
13
+ moving window limits that resulted in incorrectly removing
14
+ unexpired entries.
15
+ `Issue 277 <https://github.com/alisaifee/limits/issues/277>`_
16
+
6
17
  v5.2.0
7
18
  ------
8
19
  Release Date: 2025-05-16
@@ -848,3 +859,4 @@ Release Date: 2015-01-08
848
859
 
849
860
 
850
861
 
862
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: limits
3
- Version: 5.2.0
3
+ Version: 5.3.0
4
4
  Summary: Rate limiting utilities
5
5
  Home-page: https://limits.readthedocs.org
6
6
  Author: Ali-Akber Saifee
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2025-05-16T12:15:52-0700",
11
+ "date": "2025-06-13T16:23:24-0700",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "0c8d73757f54788d5fa213a678dfbdf3fdd7ccfb",
15
- "version": "5.2.0"
14
+ "full-revisionid": "311fe101b2d63c03e8c6a8f0ab363dd49f3e733b",
15
+ "version": "5.3.0"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -65,13 +65,13 @@ class MemoryStorage(
65
65
  try:
66
66
  now = time.time()
67
67
  for key in list(self.events.keys()):
68
- cutoff = await asyncio.to_thread(
69
- lambda evts: bisect.bisect_left(
70
- evts, -now, key=lambda event: -event.expiry
71
- ),
72
- self.events[key],
73
- )
74
68
  async with self.locks[key]:
69
+ cutoff = await asyncio.to_thread(
70
+ lambda evts: bisect.bisect_left(
71
+ evts, -now, key=lambda event: -event.expiry
72
+ ),
73
+ self.events[key],
74
+ )
75
75
  if self.events.get(key, []):
76
76
  self.events[key] = self.events[key][:cutoff]
77
77
  if not self.events.get(key, None):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: limits
3
- Version: 5.2.0
3
+ Version: 5.3.0
4
4
  Summary: Rate limiting utilities
5
5
  Home-page: https://limits.readthedocs.org
6
6
  Author: Ali-Akber Saifee
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes