66 deprecated ,
77 etcd3 ,
88 fetchFromGitHub ,
9+ fetchpatch2 ,
10+ flaky ,
911 hiro ,
1012 importlib-resources ,
1113 motor ,
1214 packaging ,
1315 pymemcache ,
1416 pymongo ,
1517 pytest-asyncio ,
18+ pytest-benchmark ,
1619 pytest-lazy-fixture ,
1720 pytestCheckHook ,
1821 pythonOlder ,
2326
2427buildPythonPackage rec {
2528 pname = "limits" ;
26- version = "3.12 .0" ;
29+ version = "3.13 .0" ;
2730 pyproject = true ;
2831
29- disabled = pythonOlder "3.7 " ;
32+ disabled = pythonOlder "3.8 " ;
3033
3134 src = fetchFromGitHub {
3235 owner = "alisaifee" ;
@@ -38,9 +41,20 @@ buildPythonPackage rec {
3841 postFetch = ''
3942 rm "$out/limits/_version.py"
4043 '' ;
41- hash = "sha256-EH2/75tcKuS11XKuo4lCQrFe4/XJZpcWhuGlSuhIk18 =" ;
44+ hash = "sha256-y5iMx+AC52ZgGvAvThRaeKFqCGkwmukyZsJ+nzR2AFM =" ;
4245 } ;
4346
47+ patches = [
48+ ( fetchpatch2 {
49+ name = "fix-incompatibility-with-latest-pytest-asyncio.patch" ;
50+ url = "https://github.com/alisaifee/limits/commit/f6dcdb253cd44ca8dc7380c481da1afd8b57af6b.patch" ;
51+ excludes = [ "requirements/test.txt" ] ;
52+ hash = "sha256-NwtN8WHNrwsRcIq18pRjzzGmm7XCzn6O5y+jo9Qr6iQ=" ;
53+ } )
54+ ./remove-fixed-start-from-async-tests.patch
55+ ./only-test-in-memory.patch
56+ ] ;
57+
4458 postPatch = ''
4559 substituteInPlace pytest.ini \
4660 --replace-fail "--cov=limits" "" \
@@ -53,16 +67,16 @@ buildPythonPackage rec {
5367 echo 'def get_versions(): return {"version": "${ version } "}' > limits/_version.py
5468 '' ;
5569
56- nativeBuildInputs = [ setuptools ] ;
70+ build-system = [ setuptools ] ;
5771
58- propagatedBuildInputs = [
72+ dependencies = [
5973 deprecated
6074 importlib-resources
6175 packaging
6276 typing-extensions
6377 ] ;
6478
65- passthru . optional-dependencies = {
79+ optional-dependencies = {
6680 redis = [ redis ] ;
6781 rediscluster = [ redis ] ;
6882 memcached = [ pymemcache ] ;
@@ -79,20 +93,17 @@ buildPythonPackage rec {
7993 doCheck = pythonOlder "3.12" ; # SystemError in protobuf
8094
8195 nativeCheckInputs = [
96+ flaky
8297 hiro
8398 pytest-asyncio
99+ pytest-benchmark
84100 pytest-lazy-fixture
85101 pytestCheckHook
86- ] ++ lib . flatten ( lib . attrValues passthru . optional-dependencies ) ;
102+ ] ++ lib . flatten ( lib . attrValues optional-dependencies ) ;
87103
88- pythonImportsCheck = [ "limits " ] ;
104+ disabledTests = [ "test_moving_window_memcached " ] ;
89105
90- pytestFlagsArray = [
91- # All other tests require a running Docker instance
92- "tests/test_limits.py"
93- "tests/test_ratelimit_parser.py"
94- "tests/test_limit_granularities.py"
95- ] ;
106+ pythonImportsCheck = [ "limits" ] ;
96107
97108 meta = with lib ; {
98109 description = "Rate limiting using various strategies and storage backends such as redis & memcached" ;
0 commit comments