1{ lib
2, stdenv
3, buildPythonPackage
4, pythonOlder
5, fetchPypi
6, cachelib
7, flask
8, asgiref
9, pytest-asyncio
10, pytest-xprocess
11, pytestCheckHook
12}:
13
14buildPythonPackage rec {
15 pname = "Flask-Caching";
16 version = "2.0.2";
17 format = "setuptools";
18 disabled = pythonOlder "3.7";
19
20 src = fetchPypi {
21 inherit pname version;
22 hash = "sha256-JLYMVS1ZqWBcwbakLFbNs5qCoo2rRTK77bkiKuVOy04=";
23 };
24
25 postPatch = ''
26 substituteInPlace setup.py \
27 --replace "cachelib >= 0.9.0, < 0.10.0" "cachelib"
28 '';
29
30 propagatedBuildInputs = [
31 cachelib
32 flask
33 ];
34
35 nativeCheckInputs = [
36 asgiref
37 pytest-asyncio
38 pytest-xprocess
39 pytestCheckHook
40 ];
41
42 disabledTests = [
43 # backend_cache relies on pytest-cache, which is a stale package from 2013
44 "backend_cache"
45 # optional backends
46 "Redis"
47 "Memcache"
48 ] ++ lib.optionals stdenv.isDarwin [
49 # ignore flaky test
50 "test_cached_view_class"
51 ];
52
53 meta = with lib; {
54 description = "A caching extension for Flask";
55 homepage = "https://github.com/pallets-eco/flask-caching";
56 changelog = "https://github.com/pallets-eco/flask-caching/blob/v${version}/CHANGES.rst";
57 maintainers = with maintainers; [ ];
58 license = licenses.bsd3;
59 };
60}