1{ 2 lib, 3 attrs, 4 buildPythonPackage, 5 bson, 6 boto3, 7 botocore, 8 cattrs, 9 fetchFromGitHub, 10 itsdangerous, 11 platformdirs, 12 poetry-core, 13 psutil, 14 pymongo, 15 pytestCheckHook, 16 pytest-rerunfailures, 17 pytest-xdist, 18 pythonOlder, 19 pyyaml, 20 redis, 21 requests, 22 requests-mock, 23 responses, 24 rich, 25 tenacity, 26 time-machine, 27 timeout-decorator, 28 ujson, 29 urllib3, 30 url-normalize, 31}: 32 33buildPythonPackage rec { 34 pname = "requests-cache"; 35 version = "1.2.1"; 36 pyproject = true; 37 38 disabled = pythonOlder "3.8"; 39 40 src = fetchFromGitHub { 41 owner = "requests-cache"; 42 repo = "requests-cache"; 43 tag = "v${version}"; 44 hash = "sha256-juRCcBUr+Ko6kVPpUapwRbUGqWLKaRiCqppOc3S5FMU="; 45 }; 46 47 nativeBuildInputs = [ poetry-core ]; 48 49 propagatedBuildInputs = [ 50 attrs 51 cattrs 52 platformdirs 53 requests 54 urllib3 55 url-normalize 56 ]; 57 58 optional-dependencies = { 59 dynamodb = [ 60 boto3 61 botocore 62 ]; 63 mongodbo = [ pymongo ]; 64 redis = [ redis ]; 65 bson = [ bson ]; 66 json = [ ujson ]; 67 security = [ itsdangerous ]; 68 yaml = [ pyyaml ]; 69 }; 70 71 nativeCheckInputs = 72 [ 73 psutil 74 pytestCheckHook 75 pytest-rerunfailures 76 pytest-xdist 77 requests-mock 78 responses 79 rich 80 tenacity 81 time-machine 82 timeout-decorator 83 ] 84 ++ optional-dependencies.json 85 ++ optional-dependencies.security; 86 87 preCheck = '' 88 export HOME=$(mktemp -d); 89 ''; 90 91 pytestFlagsArray = [ 92 # Integration tests require local DBs 93 "tests/unit" 94 ]; 95 96 disabledTests = [ 97 # Tests are flaky in the sandbox 98 "test_remove_expired_responses" 99 # Tests that broke with urllib 2.0.5 100 "test_request_only_if_cached__stale_if_error__expired" 101 "test_stale_if_error__error_code" 102 ]; 103 104 pythonImportsCheck = [ "requests_cache" ]; 105 106 meta = with lib; { 107 description = "Persistent cache for requests library"; 108 homepage = "https://github.com/reclosedev/requests-cache"; 109 changelog = "https://github.com/requests-cache/requests-cache/blob/v${version}/HISTORY.md"; 110 license = licenses.bsd3; 111 maintainers = with maintainers; [ fab ]; 112 }; 113}