depot/third_party/nixpkgs/pkgs/development/python-modules/requests-cache/default.nix
Default email 83627f9931 Project import generated by Copybara.
GitOrigin-RevId: 2893f56de08021cffd9b6b6dfc70fd9ccd51eb60
2024-06-24 14:47:55 -04:00

110 lines
2.1 KiB
Nix

{
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,
}:
buildPythonPackage rec {
pname = "requests-cache";
version = "1.2.1";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "requests-cache";
repo = "requests-cache";
rev = "refs/tags/v${version}";
hash = "sha256-juRCcBUr+Ko6kVPpUapwRbUGqWLKaRiCqppOc3S5FMU=";
};
nativeBuildInputs = [ poetry-core ];
propagatedBuildInputs = [
attrs
cattrs
platformdirs
requests
urllib3
url-normalize
];
passthru.optional-dependencies = {
dynamodb = [
boto3
botocore
];
mongodbo = [ pymongo ];
redis = [ redis ];
bson = [ bson ];
json = [ ujson ];
security = [ itsdangerous ];
yaml = [ pyyaml ];
};
nativeCheckInputs = [
psutil
pytestCheckHook
pytest-rerunfailures
pytest-xdist
requests-mock
responses
rich
tenacity
time-machine
timeout-decorator
] ++ passthru.optional-dependencies.json ++ passthru.optional-dependencies.security;
preCheck = ''
export HOME=$(mktemp -d);
'';
pytestFlagsArray = [
# Integration tests require local DBs
"tests/unit"
];
disabledTests = [
# Tests are flaky in the sandbox
"test_remove_expired_responses"
# Tests that broke with urllib 2.0.5
"test_request_only_if_cached__stale_if_error__expired"
"test_stale_if_error__error_code"
];
pythonImportsCheck = [ "requests_cache" ];
meta = with lib; {
description = "Persistent cache for requests library";
homepage = "https://github.com/reclosedev/requests-cache";
changelog = "https://github.com/requests-cache/requests-cache/blob/v${version}/HISTORY.md";
license = licenses.bsd3;
maintainers = with maintainers; [ fab ];
};
}