1{
2 lib,
3 buildPythonPackage,
4 cherrypy,
5 fetchFromGitHub,
6 flit-core,
7 filelock,
8 mock,
9 msgpack,
10 pytestCheckHook,
11 redis,
12 requests,
13}:
14
15buildPythonPackage rec {
16 pname = "cachecontrol";
17 version = "0.14.3";
18 pyproject = true;
19
20 __darwinAllowLocalNetworking = true;
21
22 src = fetchFromGitHub {
23 owner = "ionrock";
24 repo = "cachecontrol";
25 tag = "v${version}";
26 hash = "sha256-V8RWTDxhKCvf5bz2j6anp8bkCzkicTRY+Kd6eHu1peg=";
27 };
28
29 build-system = [ flit-core ];
30
31 dependencies = [
32 msgpack
33 requests
34 ];
35
36 optional-dependencies = {
37 filecache = [ filelock ];
38 redis = [ redis ];
39 };
40
41 nativeCheckInputs = [
42 cherrypy
43 mock
44 pytestCheckHook
45 requests
46 ]
47 ++ lib.flatten (builtins.attrValues optional-dependencies);
48
49 pythonImportsCheck = [ "cachecontrol" ];
50
51 meta = with lib; {
52 description = "Httplib2 caching for requests";
53 mainProgram = "doesitcache";
54 homepage = "https://github.com/ionrock/cachecontrol";
55 changelog = "https://github.com/psf/cachecontrol/releases/tag/${src.tag}";
56 license = licenses.asl20;
57 maintainers = with maintainers; [ dotlambda ];
58 };
59}