2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
pytestCheckHook,
|
|
|
|
freezegun,
|
|
|
|
pythonOlder,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cached-property";
|
2021-02-05 17:12:51 +00:00
|
|
|
version = "1.5.2";
|
2023-02-02 18:25:31 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pydanny";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-DGI8FaEjFd2bDeBDKcA0zDCE+5I6meapVNZgycE1gzs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
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
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
disabledTests = [
|
|
|
|
# https://github.com/pydanny/cached-property/issues/131
|
|
|
|
"test_threads_ttl_expiry"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "cached_property" ];
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Decorator for caching properties in classes";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/pydanny/cached-property";
|
2023-02-02 18:25:31 +00:00
|
|
|
changelog = "https://github.com/pydanny/cached-property/releases/tag/${version}";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ ericsagnes ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|