1{ lib
2, buildPythonPackage
3, callPackage
4, fetchFromGitHub
5, flaky
6, hypothesis
7, pytest
8, pytestCheckHook
9, pythonOlder
10, setuptools-scm
11}:
12
13buildPythonPackage rec {
14 pname = "pytest-asyncio";
15 version = "0.19.0";
16 format = "pyproject";
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "pytest-dev";
22 repo = pname;
23 rev = "refs/tags/v${version}";
24 hash = "sha256-A8ngASbSRwY4RjanalnWBGgskZMDO50ffOf6wMNqOvA=";
25 };
26
27 outputs = [
28 "out"
29 "testout"
30 ];
31
32 SETUPTOOLS_SCM_PRETEND_VERSION = version;
33
34 nativeBuildInputs = [
35 setuptools-scm
36 ];
37
38 buildInputs = [
39 pytest
40 ];
41
42 postInstall = ''
43 mkdir $testout
44 cp -R tests $testout/tests
45 '';
46
47 doCheck = false;
48 passthru.tests.pytest = callPackage ./tests.nix {};
49
50 pythonImportsCheck = [
51 "pytest_asyncio"
52 ];
53
54 meta = with lib; {
55 description = "Library for testing asyncio code with pytest";
56 homepage = "https://github.com/pytest-dev/pytest-asyncio";
57 changelog = "https://github.com/pytest-dev/pytest-asyncio/blob/v${version}/CHANGELOG.rst";
58 license = licenses.asl20;
59 maintainers = with maintainers; [ dotlambda ];
60 };
61}