1{
2 stdenv,
3 lib,
4 buildPythonPackage,
5 fetchFromGitHub,
6 cython,
7 setuptools,
8 numpy,
9 psutil,
10 pytest-xdist,
11 pytestCheckHook,
12 pythonAtLeast,
13 pythonOlder,
14 trio,
15 untangle,
16}:
17
18buildPythonPackage rec {
19 pname = "pydevd";
20 version = "3.3.0";
21 pyproject = true;
22
23 disabled = pythonOlder "3.8";
24
25 src = fetchFromGitHub {
26 owner = "fabioz";
27 repo = "PyDev.Debugger";
28 rev = "pydev_debugger_${lib.replaceStrings [ "." ] [ "_" ] version}";
29 hash = "sha256-V5pM0xnMFnpR1oK0purHFCV3wu+4fOmd72kmy7pVeyk=";
30 };
31
32 postPatch = ''
33 sed -i '/addopts/d' pytest.ini
34 '';
35
36 __darwinAllowLocalNetworking = true;
37
38 build-system = [
39 cython
40 setuptools
41 ];
42
43 nativeCheckInputs = [
44 numpy
45 psutil
46 #pytest-xdist
47 pytestCheckHook
48 trio
49 untangle
50 ];
51
52 disabledTests =
53 [
54 # Require network connection
55 "test_completion_sockets_and_messages"
56 "test_path_translation"
57 "test_attach_to_pid_no_threads"
58 "test_attach_to_pid_halted"
59 "test_remote_debugger_threads"
60 "test_path_translation_and_source_reference"
61 "test_attach_to_pid"
62 "test_terminate"
63 "test_gui_event_loop_custom"
64 # AssertionError: assert '/usr/bin/' == '/usr/bin'
65 # https://github.com/fabioz/PyDev.Debugger/issues/227
66 "test_to_server_and_to_client"
67 # Times out
68 "test_case_sys_exit_multiple_exception_attach"
69 ]
70 ++ lib.optionals (pythonAtLeast "3.12") [
71 # raise segmentation fault
72 # https://github.com/fabioz/PyDev.Debugger/issues/269
73 "test_evaluate_expression"
74 ]
75 ++ lib.optionals stdenv.hostPlatform.isDarwin [
76 "test_multiprocessing_simple"
77 "test_evaluate_exception_trace"
78 ];
79
80 pythonImportsCheck = [ "pydevd" ];
81
82 meta = {
83 description = "PyDev.Debugger (used in PyDev, PyCharm and VSCode Python)";
84 homepage = "https://github.com/fabioz/PyDev.Debugger";
85 license = lib.licenses.epl10;
86 maintainers = with lib.maintainers; [ onny ];
87 mainProgram = "pydevd";
88 };
89}