summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pytest-aio/default.nix
blob: 704d91641026ac694d627ddaaffe6d061331e830 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
  lib,
  anyio,
  buildPythonPackage,
  curio-compat,
  fetchFromGitHub,
  hypothesis,
  pytest,
  pytestCheckHook,
  pythonOlder,
  poetry-core,
  trio,
  trio-asyncio,
  uvloop,
}:

buildPythonPackage rec {
  pname = "pytest-aio";
  version = "2.0.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "klen";
    repo = "pytest-aio";
    rev = "43681bcfc6d2ee07bf9397a1b42d1ccfbb891deb";
    hash = "sha256-IBtiy4pyXblIkYQunFO6HpBkCnBcEpTqcFtVELrULkk=";
  };

  build-system = [ poetry-core ];

  buildInputs = [ pytest ];

  optional-dependencies = {
    curio = [ curio-compat ];
    trio = [ trio ];
    uvloop = [ uvloop ];
  };

  nativeCheckInputs = [
    anyio
    hypothesis
    pytestCheckHook
  ]
  # https://github.com/python-trio/trio-asyncio/issues/160
  ++ lib.optionals (pythonOlder "3.14") [
    trio-asyncio
  ]
  ++ lib.concatAttrValues optional-dependencies;

  pythonImportsCheck = [ "pytest_aio" ];

  meta = {
    description = "Pytest plugin for aiohttp support";
    homepage = "https://github.com/klen/pytest-aio";
    changelog = "https://github.com/klen/pytest-aio/blob/${version}/CHANGELOG.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };
}