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