about summary refs log tree commit diff
path: root/pkgs/development/python-modules/cached-property/default.nix
blob: 555b1ce006e7ed82b42c86dbdfefbc0d43683d44 (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
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, pytestCheckHook
, freezegun
, pythonOlder
}:

buildPythonPackage rec {
  pname = "cached-property";
  version = "1.5.2";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "pydanny";
    repo = pname;
    rev = "refs/tags/${version}";
    hash = "sha256-DGI8FaEjFd2bDeBDKcA0zDCE+5I6meapVNZgycE1gzs=";
  };

  patches = [
    # Don't use asyncio.coroutine if it's not available, https://github.com/pydanny/cached-property/pull/267
    (fetchpatch {
      name = "asyncio-coroutine.patch";
      url = "https://github.com/pydanny/cached-property/commit/297031687679762849dedeaf24aa3a19116f095b.patch";
      hash = "sha256-qolrUdaX7db4hE125Lt9ICmPNYsD/uBmQrdO4q5NG3c=";
    })
  ];

  checkInputs = [
    pytestCheckHook
    freezegun
  ];

  disabledTests = [
    # https://github.com/pydanny/cached-property/issues/131
    "test_threads_ttl_expiry"
  ];

  pythonImportsCheck = [
    "cached_property"
  ];

  meta = with lib; {
    description = "A decorator for caching properties in classes";
    homepage = "https://github.com/pydanny/cached-property";
    changelog = "https://github.com/pydanny/cached-property/releases/tag/${version}";
    license = licenses.bsd3;
    platforms = platforms.unix;
    maintainers = with maintainers; [ ericsagnes ];
  };
}