+15
-16
pkgs/development/python-modules/debugpy/default.nix
+15
-16
pkgs/development/python-modules/debugpy/default.nix
···
1
1
{ lib
2
2
, stdenv
3
3
, buildPythonPackage
4
+
, pythonOlder
4
5
, fetchFromGitHub
5
6
, substituteAll
7
+
, fetchpatch
6
8
, gdb
7
9
, django
8
10
, flask
···
12
14
, pytest-xdist
13
15
, pytestCheckHook
14
16
, requests
15
-
, isPy3k
16
-
, pythonAtLeast
17
17
}:
18
18
19
19
buildPythonPackage rec {
20
20
pname = "debugpy";
21
-
version = "1.6.0";
21
+
version = "1.6.2";
22
22
format = "setuptools";
23
+
24
+
disabled = pythonOlder "3.7";
23
25
24
26
src = fetchFromGitHub {
25
27
owner = "Microsoft";
26
28
repo = pname;
27
29
rev = "v${version}";
28
-
sha256 = "sha256-WfZz2SimOTpG8CWNUic8NSp4Qd2JTXk+7JSUEPhuQ6Q=";
30
+
sha256 = "sha256-jcokiAZ2WwyIvsXNIUzvMIrRttR76RwDSE7gk0xHExc=";
29
31
};
30
32
31
33
patches = [
···
50
52
# To avoid this issue, debugpy should be installed using python.withPackages:
51
53
# python.withPackages (ps: with ps; [ debugpy ])
52
54
./fix-test-pythonpath.patch
55
+
56
+
# Fix compiling attach library from source
57
+
# https://github.com/microsoft/debugpy/pull/978
58
+
(fetchpatch {
59
+
url = "https://github.com/microsoft/debugpy/commit/08b3b13cba9035f4ab3308153aef26e3cc9275f9.patch";
60
+
sha256 = "sha256-8E+Y40mYQou9T1ozWslEK2XNQtuy5+MBvPvDLt4eQak=";
61
+
})
53
62
];
54
63
55
64
# Remove pre-compiled "attach" libraries and recompile for host platform
···
68
77
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}")}
69
78
)'';
70
79
71
-
doCheck = isPy3k;
72
-
73
80
checkInputs = [
74
81
django
75
82
flask
···
86
93
"--timeout=0"
87
94
];
88
95
89
-
disabledTests = lib.optionals (pythonAtLeast "3.10") [
90
-
"test_flask_breakpoint_multiproc"
91
-
"test_subprocess[program-launch-None]"
92
-
"test_systemexit[0-zero-uncaught-raised-launch(integratedTerminal)-module]"
93
-
"test_systemexit[0-zero-uncaught--attach_pid-program]"
94
-
"test_success_exitcodes[-break_on_system_exit_zero-0-attach_listen(cli)-module]"
95
-
"test_success_exitcodes[--0-attach_connect(api)-program]"
96
-
"test_run[code-attach_connect(api)]"
97
-
"test_subprocess[program-launch-None]"
98
-
];
96
+
# Fixes hanging tests on Darwin
97
+
__darwinAllowLocalNetworking = true;
99
98
100
99
pythonImportsCheck = [
101
100
"debugpy"
+2
-2
pkgs/development/python-modules/debugpy/fix-test-pythonpath.patch
+2
-2
pkgs/development/python-modules/debugpy/fix-test-pythonpath.patch
···
1
1
diff --git a/tests/debug/session.py b/tests/debug/session.py
2
-
index 101492fc..4ee7cfbe 100644
2
+
index af242877..30b21a1e 100644
3
3
--- a/tests/debug/session.py
4
4
+++ b/tests/debug/session.py
5
-
@@ -630,6 +630,7 @@ class Session(object):
5
+
@@ -622,6 +622,7 @@ class Session(object):
6
6
if "PYTHONPATH" in self.config.env:
7
7
# If specified, launcher will use it in lieu of PYTHONPATH it inherited
8
8
# from the adapter when spawning debuggee, so we need to adjust again.
+1
-1
pkgs/development/python-modules/debugpy/hardcode-gdb.patch
+1
-1
pkgs/development/python-modules/debugpy/hardcode-gdb.patch
···
1
1
diff --git a/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py b/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py
2
-
index 3c0e1b94..e995a20f 100644
2
+
index 462feae9..eb2aa945 100644
3
3
--- a/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py
4
4
+++ b/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py
5
5
@@ -399,7 +399,7 @@ def run_python_code_linux(pid, python_code, connect_debugger_tracing=False, show
+15
-17
pkgs/development/python-modules/debugpy/hardcode-version.patch
+15
-17
pkgs/development/python-modules/debugpy/hardcode-version.patch
···
1
1
diff --git a/setup.py b/setup.py
2
-
index e7487100..10d36520 100644
2
+
index 5fc40070..775a08ec 100644
3
3
--- a/setup.py
4
4
+++ b/setup.py
5
5
@@ -12,7 +12,6 @@ import sys
···
26
26
description="An implementation of the Debug Adapter Protocol for Python", # noqa
27
27
long_description=long_description,
28
28
long_description_content_type="text/markdown",
29
-
diff --git a/src/debugpy/__init__.py b/src/debugpy/__init__.py
30
-
index baa5a7c5..53553272 100644
31
-
--- a/src/debugpy/__init__.py
32
-
+++ b/src/debugpy/__init__.py
33
-
@@ -27,7 +27,6 @@ __all__ = [
34
-
import codecs
35
-
import os
29
+
diff --git a/src/debugpy/public_api.py b/src/debugpy/public_api.py
30
+
index 3c800898..27743245 100644
31
+
--- a/src/debugpy/public_api.py
32
+
+++ b/src/debugpy/public_api.py
33
+
@@ -7,8 +7,6 @@ from __future__ import annotations
34
+
import functools
35
+
import typing
36
36
37
37
-from debugpy import _version
38
-
from debugpy.common import compat
38
+
-
39
39
40
+
# Expose debugpy.server API from subpackage, but do not actually import it unless
41
+
# and until a member is invoked - we don't want the server package loaded in the
42
+
@@ -182,4 +180,4 @@ def trace_this_thread(__should_trace: bool):
43
+
"""
40
44
41
-
@@ -204,7 +203,7 @@ def trace_this_thread(should_trace):
42
-
return api.trace_this_thread(should_trace)
43
45
44
-
45
-
-__version__ = _version.get_versions()["version"]
46
-
+__version__ = "@version@"
47
-
48
-
# Force absolute path on Python 2.
49
-
__file__ = os.path.abspath(__file__)
46
+
-__version__: str = _version.get_versions()["version"]
47
+
+__version__: str = "@version@"