1{
2 lib,
3 aiohttp,
4 async-timeout,
5 buildPythonPackage,
6 fetchFromGitHub,
7 poetry-core,
8 pytest-aiohttp,
9 pytestCheckHook,
10 pythonOlder,
11 yarl,
12}:
13
14buildPythonPackage rec {
15 pname = "aiohttp-middlewares";
16 version = "2.4.0";
17 pyproject = true;
18
19 disabled = pythonOlder "3.8";
20
21 src = fetchFromGitHub {
22 owner = "playpauseandstop";
23 repo = "aiohttp-middlewares";
24 tag = "v${version}";
25 hash = "sha256-jUH1XhkytRwR76wUTsGQGu6m8s+SZ/GO114Lz9atwE8=";
26 };
27
28 pythonRelaxDeps = [ "async-timeout" ];
29
30 postPatch = ''
31 sed -i "/addopts/d" pyproject.toml
32 '';
33
34 build-system = [ poetry-core ];
35
36 dependencies = [
37 aiohttp
38 async-timeout
39 yarl
40 ];
41
42 nativeCheckInputs = [
43 pytest-aiohttp
44 pytestCheckHook
45 ];
46
47 pythonImportsCheck = [ "aiohttp_middlewares" ];
48
49 meta = with lib; {
50 description = "Collection of useful middlewares for aiohttp.web applications";
51 homepage = "https://github.com/playpauseandstop/aiohttp-middlewares";
52 changelog = "https://github.com/playpauseandstop/aiohttp-middlewares/blob/${version}/CHANGELOG.rst";
53 license = licenses.bsd3;
54 maintainers = with maintainers; [ fab ];
55 };
56}