1{ stdenv
2, lib
3, buildPythonPackage
4, fetchFromGitHub
5, fetchpatch
6, numpy
7, psutil
8, pytestCheckHook
9, pythonOlder
10, trio
11, untangle
12}:
13
14buildPythonPackage rec {
15 pname = "pydevd";
16 version = "2.9.6";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.8";
20
21 src = fetchFromGitHub {
22 owner = "fabioz";
23 repo = "PyDev.Debugger";
24 rev = "pydev_debugger_${lib.replaceStrings ["."] ["_"] version}";
25 hash = "sha256-TDU/V7kY7zVxiP4OVjGqpsRVYplpkgCly2qAOqhZONo=";
26 };
27
28 patches = [
29 # https://github.com/fabioz/PyDev.Debugger/pull/258
30 (fetchpatch {
31 name = "numpy-1.25-test-compatibility.patch";
32 url = "https://github.com/fabioz/PyDev.Debugger/commit/6f637d951cda62dc2202a2c7b6af526c4d1e8a00.patch";
33 hash = "sha256-DLzZZwQHtqGZGA8nsBLNQqamuI4xUfQ89Gd21sJa9/s=";
34 })
35 ];
36
37 __darwinAllowLocalNetworking = true;
38
39 nativeCheckInputs = [
40 numpy
41 psutil
42 pytestCheckHook
43 trio
44 untangle
45 ];
46
47 disabledTests = [
48 # Require network connection
49 "test_completion_sockets_and_messages"
50 "test_path_translation"
51 "test_attach_to_pid_no_threads"
52 "test_attach_to_pid_halted"
53 "test_remote_debugger_threads"
54 "test_path_translation_and_source_reference"
55 "test_attach_to_pid"
56 "test_terminate"
57 "test_gui_event_loop_custom"
58 # AssertionError: assert '/usr/bin/' == '/usr/bin'
59 # https://github.com/fabioz/PyDev.Debugger/issues/227
60 "test_to_server_and_to_client"
61 # AssertionError pydevd_tracing.set_trace_to_threads(tracing_func) == 0
62 "test_tracing_other_threads"
63 "test_tracing_basic"
64 ] ++ lib.optionals stdenv.isDarwin [
65 "test_multiprocessing_simple"
66 "test_evaluate_exception_trace"
67 ];
68
69 pythonImportsCheck = [
70 "pydevd"
71 ];
72
73 meta = with lib; {
74 description = "PyDev.Debugger (used in PyDev, PyCharm and VSCode Python)";
75 homepage = "https://github.com/fabioz/PyDev.Debugger";
76 license = licenses.epl10;
77 maintainers = with maintainers; [ onny ];
78 };
79}