2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2021-12-06 16:07:01 +00:00
|
|
|
, cherrypy
|
|
|
|
, fetchFromGitHub
|
2023-07-15 17:15:38 +00:00
|
|
|
, flit-core
|
|
|
|
, filelock
|
2021-12-06 16:07:01 +00:00
|
|
|
, mock
|
2020-04-24 23:36:52 +00:00
|
|
|
, msgpack
|
2021-12-06 16:07:01 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2022-06-26 10:26:21 +00:00
|
|
|
, redis
|
2021-12-06 16:07:01 +00:00
|
|
|
, requests
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "cachecontrol";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "0.13.1";
|
|
|
|
format = "pyproject";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ionrock";
|
|
|
|
repo = pname;
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-4N+vk65WxOrT+IJRn+lEnbs5vlWQh9ievVHWWe3BKJ0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
# https://github.com/ionrock/cachecontrol/issues/297
|
|
|
|
substituteInPlace tests/test_etag.py --replace \
|
|
|
|
"requests.adapters.HTTPResponse.from_httplib" \
|
|
|
|
"urllib3.response.HTTPResponse.from_httplib"
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
flit-core
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
msgpack
|
|
|
|
requests
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
filecache = [
|
|
|
|
filelock
|
|
|
|
];
|
|
|
|
redis = [
|
|
|
|
redis
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
cherrypy
|
|
|
|
mock
|
|
|
|
pytestCheckHook
|
2023-07-15 17:15:38 +00:00
|
|
|
requests
|
|
|
|
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"cachecontrol"
|
|
|
|
];
|
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 = "Httplib2 caching for requests";
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://github.com/ionrock/cachecontrol";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/psf/cachecontrol/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|