2021-07-14 22:03:04 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fastapi
|
|
|
|
, fetchFromGitHub
|
|
|
|
, limits
|
|
|
|
, mock
|
|
|
|
, hiro
|
|
|
|
, poetry-core
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, redis
|
|
|
|
, starlette
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "slowapi";
|
2021-09-18 10:52:07 +00:00
|
|
|
version = "0.1.5";
|
2021-07-14 22:03:04 +00:00
|
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "laurentS";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "1wjnlhjfgil86h6i5yij723ncg18rqdprs1q6i68w4msaspwpxg9";
|
2021-07-14 22:03:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
limits
|
|
|
|
redis
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
fastapi
|
|
|
|
hiro
|
|
|
|
mock
|
|
|
|
pytestCheckHook
|
|
|
|
starlette
|
|
|
|
];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
disabledTests = [
|
|
|
|
# E AssertionError: Regex pattern 'parameter `request` must be an instance of starlette.requests.Request' does not match 'This portal is not running'.
|
|
|
|
"test_endpoint_request_param_invalid"
|
|
|
|
"test_endpoint_response_param_invalid"
|
2021-07-14 22:03:04 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "slowapi" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library for API rate limiting";
|
|
|
|
homepage = "https://github.com/laurentS/slowapi";
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|