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