2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
attrs,
|
|
|
|
buildPythonPackage,
|
|
|
|
bson,
|
|
|
|
boto3,
|
|
|
|
botocore,
|
|
|
|
cattrs,
|
|
|
|
fetchFromGitHub,
|
|
|
|
itsdangerous,
|
|
|
|
platformdirs,
|
|
|
|
poetry-core,
|
|
|
|
psutil,
|
|
|
|
pymongo,
|
|
|
|
pytestCheckHook,
|
|
|
|
pytest-rerunfailures,
|
|
|
|
pytest-xdist,
|
|
|
|
pythonOlder,
|
|
|
|
pyyaml,
|
|
|
|
redis,
|
|
|
|
requests,
|
|
|
|
requests-mock,
|
|
|
|
responses,
|
|
|
|
rich,
|
|
|
|
tenacity,
|
|
|
|
time-machine,
|
|
|
|
timeout-decorator,
|
|
|
|
ujson,
|
|
|
|
urllib3,
|
|
|
|
url-normalize,
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "requests-cache";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "1.2.0";
|
|
|
|
pyproject = true;
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2021-09-23 15:35:13 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
src = fetchFromGitHub {
|
2022-09-09 14:08:57 +00:00
|
|
|
owner = "requests-cache";
|
2021-06-28 23:13:55 +00:00
|
|
|
repo = "requests-cache";
|
2023-03-15 16:39:30 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-w1ptKi/MH3kGZxLMUNq/Gs6btGx+n2fG4nfQUXCXmiY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ poetry-core ];
|
2021-07-14 22:03:04 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
attrs
|
2021-07-14 22:03:04 +00:00
|
|
|
cattrs
|
2023-11-16 04:20:00 +00:00
|
|
|
platformdirs
|
2021-06-28 23:13:55 +00:00
|
|
|
requests
|
2022-08-12 12:06:08 +00:00
|
|
|
urllib3
|
2021-06-28 23:13:55 +00:00
|
|
|
url-normalize
|
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
dynamodb = [
|
|
|
|
boto3
|
|
|
|
botocore
|
|
|
|
];
|
2024-06-05 15:53:02 +00:00
|
|
|
mongodbo = [ pymongo ];
|
|
|
|
redis = [ redis ];
|
|
|
|
bson = [ bson ];
|
|
|
|
json = [ ujson ];
|
|
|
|
security = [ itsdangerous ];
|
|
|
|
yaml = [ pyyaml ];
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-11-16 04:20:00 +00:00
|
|
|
psutil
|
2021-06-28 23:13:55 +00:00
|
|
|
pytestCheckHook
|
2023-11-16 04:20:00 +00:00
|
|
|
pytest-rerunfailures
|
|
|
|
pytest-xdist
|
2021-06-28 23:13:55 +00:00
|
|
|
requests-mock
|
2023-11-16 04:20:00 +00:00
|
|
|
responses
|
2021-07-14 22:03:04 +00:00
|
|
|
rich
|
2023-11-16 04:20:00 +00:00
|
|
|
tenacity
|
|
|
|
time-machine
|
2021-06-28 23:13:55 +00:00
|
|
|
timeout-decorator
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ passthru.optional-dependencies.json ++ passthru.optional-dependencies.security;
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d);
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
# Integration tests require local DBs
|
|
|
|
"tests/unit"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests are flaky in the sandbox
|
|
|
|
"test_remove_expired_responses"
|
2023-11-16 04:20:00 +00:00
|
|
|
# Tests that broke with urllib 2.0.5
|
|
|
|
"test_request_only_if_cached__stale_if_error__expired"
|
|
|
|
"test_stale_if_error__error_code"
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "requests_cache" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Persistent cache for requests library";
|
2021-06-28 23:13:55 +00:00
|
|
|
homepage = "https://github.com/reclosedev/requests-cache";
|
2023-03-15 16:39:30 +00:00
|
|
|
changelog = "https://github.com/requests-cache/requests-cache/blob/v${version}/HISTORY.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
2021-07-14 22:03:04 +00:00
|
|
|
maintainers = with maintainers; [ fab ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|