1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pytest,
6 coverage,
7 setuptools,
8 toml,
9 tomli,
10}:
11
12buildPythonPackage rec {
13 pname = "pytest-cov";
14 version = "6.2.1";
15 pyproject = true;
16
17 src = fetchPypi {
18 pname = "pytest_cov";
19 inherit version;
20 hash = "sha256-JcxswKU1ggS4EI7O3FGptXs0zGuMlnzCwBpOANimfaI=";
21 };
22
23 build-system = [ setuptools ];
24
25 buildInputs = [ pytest ];
26
27 dependencies = [
28 coverage
29 toml
30 tomli
31 ];
32
33 # xdist related tests fail with the following error
34 # OSError: [Errno 13] Permission denied: 'py/_code'
35 doCheck = false;
36 checkPhase = ''
37 # allow to find the module helper during the test run
38 export PYTHONPATH=$PYTHONPATH:$PWD/tests
39 py.test tests
40 '';
41
42 pythonImportsCheck = [ "pytest_cov" ];
43
44 meta = with lib; {
45 description = "Plugin for coverage reporting with support for both centralised and distributed testing, including subprocesses and multiprocessing";
46 homepage = "https://github.com/pytest-dev/pytest-cov";
47 changelog = "https://github.com/pytest-dev/pytest-cov/blob/v${version}/CHANGELOG.rst";
48 license = licenses.mit;
49 maintainers = [ ];
50 };
51}