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