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
|
|
|
|
, lockfile
|
|
|
|
, 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";
|
2022-06-26 10:26:21 +00:00
|
|
|
version = "0.12.11";
|
2021-12-06 16:07:01 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
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;
|
|
|
|
rev = "v${version}";
|
2022-06-26 10:26:21 +00:00
|
|
|
hash = "sha256-uUPIQz/n347Q9G7NDOGuB760B/KxOglUxiS/rYjt5Po=";
|
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"
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
msgpack
|
|
|
|
requests
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
cherrypy
|
|
|
|
mock
|
|
|
|
pytestCheckHook
|
2022-06-26 10:26:21 +00:00
|
|
|
] ++ passthru.optional-dependencies.filecache;
|
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
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
filecache = [ lockfile ];
|
|
|
|
redis = [ redis ];
|
|
|
|
};
|
|
|
|
|
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";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ costrouc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|