nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, appdirs
3, attrs
4, buildPythonPackage
5, bson
6, cattrs
7, fetchFromGitHub
8, itsdangerous
9, poetry-core
10, pytestCheckHook
11, pythonOlder
12, pyyaml
13, requests
14, requests-mock
15, rich
16, timeout-decorator
17, ujson
18, url-normalize
19}:
20
21buildPythonPackage rec {
22 pname = "requests-cache";
23 version = "0.9.4";
24 format = "pyproject";
25
26 disabled = pythonOlder "3.7";
27
28 src = fetchFromGitHub {
29 owner = "reclosedev";
30 repo = "requests-cache";
31 rev = "v${version}";
32 hash = "sha256-9OlWMom/0OMlbPd3evjIaX75Gjlu+F8vKBJwX4Z58qQ=";
33 };
34
35 nativeBuildInputs = [
36 poetry-core
37 ];
38
39 propagatedBuildInputs = [
40 appdirs
41 attrs
42 bson
43 cattrs
44 itsdangerous
45 pyyaml
46 requests
47 ujson
48 url-normalize
49 ];
50
51 checkInputs = [
52 pytestCheckHook
53 requests-mock
54 rich
55 timeout-decorator
56 ];
57
58 preCheck = ''
59 export HOME=$(mktemp -d);
60 '';
61
62 pytestFlagsArray = [
63 # Integration tests require local DBs
64 "tests/unit"
65 ];
66
67 disabledTests = [
68 # Tests are flaky in the sandbox
69 "test_remove_expired_responses"
70 ];
71
72 pythonImportsCheck = [
73 "requests_cache"
74 ];
75
76 meta = with lib; {
77 description = "Persistent cache for requests library";
78 homepage = "https://github.com/reclosedev/requests-cache";
79 license = licenses.bsd3;
80 maintainers = with maintainers; [ fab ];
81 };
82}