1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 poetry-core,
7 pytestCheckHook,
8 pytest-cov-stub,
9 pytest-asyncio,
10 stdenv,
11}:
12
13buildPythonPackage rec {
14 pname = "onecache";
15 version = "0.7.1";
16 pyproject = true;
17
18 disabled = pythonOlder "3.8";
19
20 src = fetchFromGitHub {
21 owner = "sonic182";
22 repo = "onecache";
23 tag = version;
24 hash = "sha256-uUtH2MIsnAa3cC5W1NEecrSScpKsKLFrqz7f3WdAO70=";
25 };
26
27 build-system = [ poetry-core ];
28
29 nativeCheckInputs = [
30 pytestCheckHook
31 pytest-cov-stub
32 pytest-asyncio
33 ];
34
35 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
36 # test fails due to unknown reason on darwin
37 "test_lru_and_ttl_refresh"
38 ];
39
40 pythonImportsCheck = [ "onecache" ];
41
42 meta = {
43 changelog = "https://github.com/sonic182/onecache/blob/${version}/CHANGELOG.md";
44 description = "Python LRU and TTL cache for sync and async code";
45 license = lib.licenses.mit;
46 homepage = "https://github.com/sonic182/onecache";
47 maintainers = with lib.maintainers; [ geraldog ];
48 };
49}