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