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