Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at domenkozar-patch-1 72 lines 1.5 kB view raw
1{ lib 2, buildPythonPackage 3, fastapi 4, fetchFromGitHub 5, limits 6, mock 7, hiro 8, poetry-core 9, pytestCheckHook 10, pythonAtLeast 11, pythonOlder 12, redis 13, starlette 14}: 15 16buildPythonPackage rec { 17 pname = "slowapi"; 18 version = "0.1.7"; 19 format = "pyproject"; 20 21 disabled = pythonOlder "3.7"; 22 23 src = fetchFromGitHub { 24 owner = "laurentS"; 25 repo = pname; 26 rev = "refs/tags/v${version}"; 27 hash = "sha256-IAB7JW8iVb5M610GVK0POXlSiya22KzNgr26BNvPC4Q="; 28 }; 29 30 nativeBuildInputs = [ 31 poetry-core 32 ]; 33 34 propagatedBuildInputs = [ 35 limits 36 redis 37 ]; 38 39 checkInputs = [ 40 fastapi 41 hiro 42 mock 43 pytestCheckHook 44 starlette 45 ]; 46 47 postPatch = '' 48 substituteInPlace pyproject.toml \ 49 --replace 'limits = "^1.5"' 'limits = "*"' \ 50 --replace 'redis = "^3.4.1"' 'redis = "*"' 51 ''; 52 53 disabledTests = [ 54 # AssertionError: Regex pattern 'parameter `request` must be an instance of starlette.requests.Request' does not match 'This portal is not running'. 55 "test_endpoint_request_param_invalid" 56 "test_endpoint_response_param_invalid" 57 ] ++ lib.optionals (pythonAtLeast "3.10") [ 58 "test_multiple_decorators" 59 ]; 60 61 pythonImportsCheck = [ 62 "slowapi" 63 ]; 64 65 meta = with lib; { 66 description = "Python library for API rate limiting"; 67 homepage = "https://github.com/laurentS/slowapi"; 68 changelog = "https://github.com/laurentS/slowapi/blob/v${version}/CHANGELOG.md"; 69 license = with licenses; [ mit ]; 70 maintainers = with maintainers; [ fab ]; 71 }; 72}