1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pythonOlder,
6 setuptools-scm,
7 pytestCheckHook,
8 filelock,
9 execnet,
10 pytest,
11 psutil,
12 setproctitle,
13}:
14
15buildPythonPackage rec {
16 pname = "pytest-xdist";
17 version = "3.5.0";
18 disabled = pythonOlder "3.7";
19
20 pyproject = true;
21
22 src = fetchPypi {
23 inherit pname version;
24 hash = "sha256-y7NvPWfgxHi6pX+k7ciEOIfg9s/ELWd1MKNtdHKzLYo=";
25 };
26
27 nativeBuildInputs = [ setuptools-scm ];
28
29 buildInputs = [ pytest ];
30
31 propagatedBuildInputs = [ execnet ];
32
33 nativeCheckInputs = [
34 filelock
35 pytestCheckHook
36 ];
37
38 passthru.optional-dependencies = {
39 psutil = [ psutil ];
40 setproctitle = [ setproctitle ];
41 };
42
43 pytestFlagsArray = [
44 # pytest can already use xdist at this point
45 "--numprocesses=$NIX_BUILD_CORES"
46 ];
47
48 # access file system
49 disabledTests = [
50 "test_distribution_rsyncdirs_example"
51 "test_rsync_popen_with_path"
52 "test_popen_rsync_subdir"
53 "test_rsync_report"
54 "test_init_rsync_roots"
55 "test_rsyncignore"
56 # flakey
57 "test_internal_errors_propagate_to_controller"
58 # https://github.com/pytest-dev/pytest-xdist/issues/985
59 "test_workqueue_ordered_by_size"
60 ];
61
62 setupHook = ./setup-hook.sh;
63
64 meta = with lib; {
65 changelog = "https://github.com/pytest-dev/pytest-xdist/blob/v${version}/CHANGELOG.rst";
66 description = "Pytest xdist plugin for distributed testing and loop-on-failing modes";
67 homepage = "https://github.com/pytest-dev/pytest-xdist";
68 license = licenses.mit;
69 maintainers = with maintainers; [ dotlambda ];
70 };
71}