1{
2 lib,
3 buildPythonPackage,
4 callPackage,
5 fetchFromGitHub,
6 pytest,
7 setuptools-scm,
8}:
9
10buildPythonPackage rec {
11 pname = "pytest-asyncio";
12 version = "0.26.0"; # N.B.: when updating, tests bleak and aioesphomeapi tests
13 pyproject = true;
14
15 src = fetchFromGitHub {
16 owner = "pytest-dev";
17 repo = "pytest-asyncio";
18 tag = "v${version}";
19 hash = "sha256-GEhFwwQCXwtqfSiew/sOvJYV3JREqOGD4fQONlRR/Mw=";
20 };
21
22 outputs = [
23 "out"
24 "testout"
25 ];
26
27 build-system = [ setuptools-scm ];
28
29 buildInputs = [ pytest ];
30
31 postInstall = ''
32 mkdir $testout
33 cp -R tests $testout/tests
34 '';
35
36 doCheck = false;
37 passthru.tests.pytest = callPackage ./tests.nix { };
38
39 pythonImportsCheck = [ "pytest_asyncio" ];
40
41 meta = with lib; {
42 description = "Library for testing asyncio code with pytest";
43 homepage = "https://github.com/pytest-dev/pytest-asyncio";
44 changelog = "https://github.com/pytest-dev/pytest-asyncio/blob/${src.tag}/docs/reference/changelog.rst";
45 license = licenses.asl20;
46 maintainers = with maintainers; [ dotlambda ];
47 };
48}