about summary refs log tree commit diff
path: root/pkgs/development/python-modules/flask-caching/default.nix
blob: e679bf16e8ebfaf00b351155add66004b60ad31f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
  lib,
  stdenv,
  buildPythonPackage,
  pythonOlder,
  fetchPypi,
  cachelib,
  flask,
  asgiref,
  pytest-asyncio,
  pytest-xprocess,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "flask-caching";
  version = "2.3.0";
  format = "setuptools";
  disabled = pythonOlder "3.7";

  src = fetchPypi {
    pname = "flask_caching";
    inherit version;
    hash = "sha256-1+TKZKM7Sf6zOfzdF+a6JfXgEWjPiF5TeQ6IX4Ok0s8=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace "cachelib >= 0.9.0, < 0.10.0" "cachelib"
  '';

  propagatedBuildInputs = [
    cachelib
    flask
  ];

  nativeCheckInputs = [
    asgiref
    pytest-asyncio
    pytest-xprocess
    pytestCheckHook
  ];

  disabledTests =
    [
      # backend_cache relies on pytest-cache, which is a stale package from 2013
      "backend_cache"
      # optional backends
      "Redis"
      "Memcache"
    ]
    ++ lib.optionals stdenv.isDarwin [
      # ignore flaky test
      "test_cache_timeout_dynamic"
      "test_cached_view_class"
    ];

  meta = with lib; {
    description = "Caching extension for Flask";
    homepage = "https://github.com/pallets-eco/flask-caching";
    changelog = "https://github.com/pallets-eco/flask-caching/blob/v${version}/CHANGES.rst";
    maintainers = with maintainers; [ ];
    license = licenses.bsd3;
  };
}