1{
2 lib,
3 anyio,
4 buildPythonPackage,
5 curio-compat,
6 fetchFromGitHub,
7 hypothesis,
8 pytest,
9 pytestCheckHook,
10 pythonOlder,
11 poetry-core,
12 trio,
13 trio-asyncio,
14 uvloop,
15}:
16
17buildPythonPackage rec {
18 pname = "pytest-aio";
19 version = "1.9.0";
20 pyproject = true;
21
22 disabled = pythonOlder "3.9";
23
24 src = fetchFromGitHub {
25 owner = "klen";
26 repo = "pytest-aio";
27 tag = version;
28 hash = "sha256-6RxYn8/HAvXv1AEgSIEOLiaBkGgTcqQhWK+xbtxgj/o=";
29 };
30
31 build-system = [ poetry-core ];
32
33 buildInputs = [ pytest ];
34
35 optional-dependencies = {
36 curio = [ curio-compat ];
37 trio = [ trio ];
38 uvloop = [ uvloop ];
39 };
40
41 nativeCheckInputs = [
42 anyio
43 hypothesis
44 pytestCheckHook
45 trio-asyncio
46 ]
47 ++ lib.flatten (lib.attrValues optional-dependencies);
48
49 pythonImportsCheck = [ "pytest_aio" ];
50
51 meta = with lib; {
52 description = "Pytest plugin for aiohttp support";
53 homepage = "https://github.com/klen/pytest-aio";
54 changelog = "https://github.com/klen/pytest-aio/blob/${version}/CHANGELOG.md";
55 license = licenses.mit;
56 maintainers = with maintainers; [ fab ];
57 };
58}