1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 typing-extensions,
7 pytestCheckHook,
8 pytest-asyncio,
9}:
10
11buildPythonPackage rec {
12 pname = "async-lru";
13 version = "2.0.4";
14
15 disabled = pythonOlder "3.8";
16
17 format = "setuptools";
18
19 src = fetchFromGitHub {
20 owner = "aio-libs";
21 repo = "async-lru";
22 rev = "refs/tags/v${version}";
23 hash = "sha256-S2sOkgtS+YdMtVP7UHD3+oR8Fem8roLhhgVVfh33PcM=";
24 };
25
26 propagatedBuildInputs = lib.optionals (pythonOlder "3.11") [ typing-extensions ];
27
28 postPatch = ''
29 sed -i -e '/^addopts/d' -e '/^filterwarnings/,+2d' setup.cfg
30 '';
31
32 nativeCheckInputs = [
33 pytestCheckHook
34 pytest-asyncio
35 ];
36
37 pythonImportsCheck = [ "async_lru" ];
38
39 meta = with lib; {
40 description = "Simple lru cache for asyncio";
41 homepage = "https://github.com/wikibusiness/async_lru";
42 license = licenses.mit;
43 maintainers = with maintainers; [ dotlambda ];
44 };
45}