1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch
5, pytestCheckHook
6, freezegun
7, pythonOlder
8}:
9
10buildPythonPackage rec {
11 pname = "cached-property";
12 version = "1.5.2";
13 format = "setuptools";
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchFromGitHub {
18 owner = "pydanny";
19 repo = pname;
20 rev = "refs/tags/${version}";
21 hash = "sha256-DGI8FaEjFd2bDeBDKcA0zDCE+5I6meapVNZgycE1gzs=";
22 };
23
24 patches = [
25 # Don't use asyncio.coroutine if it's not available, https://github.com/pydanny/cached-property/pull/267
26 (fetchpatch {
27 name = "asyncio-coroutine.patch";
28 url = "https://github.com/pydanny/cached-property/commit/297031687679762849dedeaf24aa3a19116f095b.patch";
29 hash = "sha256-qolrUdaX7db4hE125Lt9ICmPNYsD/uBmQrdO4q5NG3c=";
30 })
31 ];
32
33 checkInputs = [
34 pytestCheckHook
35 freezegun
36 ];
37
38 disabledTests = [
39 # https://github.com/pydanny/cached-property/issues/131
40 "test_threads_ttl_expiry"
41 ];
42
43 pythonImportsCheck = [
44 "cached_property"
45 ];
46
47 meta = with lib; {
48 description = "A decorator for caching properties in classes";
49 homepage = "https://github.com/pydanny/cached-property";
50 changelog = "https://github.com/pydanny/cached-property/releases/tag/${version}";
51 license = licenses.bsd3;
52 platforms = platforms.unix;
53 maintainers = with maintainers; [ ericsagnes ];
54 };
55}