Skip to content

Commit 56a4d5b

Browse files
authored
Pin pydevd to compatible versions. (#127)
1 parent 7c11fe8 commit 56a4d5b

File tree

3 files changed

+87
-19
lines changed

3 files changed

+87
-19
lines changed

python/helper-image/Dockerfile

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,51 +29,51 @@
2929

3030
FROM python:2.7 as python27
3131
RUN PYTHONUSERBASE=/dbgpy pip install --user ptvsd debugpy
32-
RUN PYTHONUSERBASE=/dbgpy/pydevd/python2.7 pip install --user pydevd --no-warn-script-location
33-
COPY pydevd.patch .
32+
RUN PYTHONUSERBASE=/dbgpy/pydevd/python2.7 pip install --user pydevd==2.8.0 --no-warn-script-location
33+
COPY pydevd_2_8_0.patch ./pydevd.patch
3434
RUN patch -p0 -d /dbgpy/pydevd/python2.7/lib/python2.7/site-packages < pydevd.patch
3535
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python2.7 pip install --user pydevd-pycharm --no-warn-script-location
3636

3737
FROM python:3.5 as python35
3838
RUN PYTHONUSERBASE=/dbgpy pip install --user ptvsd debugpy
39-
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.5 pip install --user pydevd --no-warn-script-location
40-
COPY pydevd.patch .
39+
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.5 pip install --user pydevd==2.8.0 --no-warn-script-location
40+
COPY pydevd_2_8_0.patch ./pydevd.patch
4141
RUN patch -p0 -d /dbgpy/pydevd/python3.5/lib/python3.5/site-packages < pydevd.patch
4242
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python3.5 pip install --user pydevd-pycharm --no-warn-script-location
4343

4444
FROM python:3.6 as python36
4545
RUN PYTHONUSERBASE=/dbgpy pip install --user ptvsd debugpy
46-
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.6 pip install --user pydevd --no-warn-script-location
47-
COPY pydevd.patch .
48-
RUN patch -p0 -d /dbgpy/pydevd/python3.6/lib/python3.6/site-packages < pydevd.patch
46+
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.6 pip install --user pydevd==2.9.5 --no-warn-script-location
47+
COPY pydevd_2_9_5.patch ./pydevd.patch
48+
RUN patch --binary -p0 -d /dbgpy/pydevd/python3.6/lib/python3.6/site-packages < pydevd.patch
4949
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python3.6 pip install --user pydevd-pycharm --no-warn-script-location
5050

5151
FROM python:3.7 as python37
5252
RUN PYTHONUSERBASE=/dbgpy pip install --user ptvsd debugpy
53-
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.7 pip install --user pydevd --no-warn-script-location
54-
COPY pydevd.patch .
55-
RUN patch -p0 -d /dbgpy/pydevd/python3.7/lib/python3.7/site-packages < pydevd.patch
53+
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.7 pip install --user pydevd==2.9.5 --no-warn-script-location
54+
COPY pydevd_2_9_5.patch ./pydevd.patch
55+
RUN patch --binary -p0 -d /dbgpy/pydevd/python3.7/lib/python3.7/site-packages < pydevd.patch
5656
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python3.7 pip install --user pydevd-pycharm --no-warn-script-location
5757

5858
FROM python:3.8 as python38
5959
RUN PYTHONUSERBASE=/dbgpy pip install --user ptvsd debugpy
60-
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.8 pip install --user pydevd --no-warn-script-location
61-
COPY pydevd.patch .
62-
RUN patch -p0 -d /dbgpy/pydevd/python3.8/lib/python3.8/site-packages < pydevd.patch
60+
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.8 pip install --user pydevd==2.9.5 --no-warn-script-location
61+
COPY pydevd_2_9_5.patch ./pydevd.patch
62+
RUN patch --binary -p0 -d /dbgpy/pydevd/python3.8/lib/python3.8/site-packages < pydevd.patch
6363
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python3.8 pip install --user pydevd-pycharm --no-warn-script-location
6464

6565
FROM python:3.9 as python39
6666
RUN PYTHONUSERBASE=/dbgpy pip install --user ptvsd debugpy
67-
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.9 pip install --user pydevd --no-warn-script-location
68-
COPY pydevd.patch .
69-
RUN patch -p0 -d /dbgpy/pydevd/python3.9/lib/python3.9/site-packages < pydevd.patch
67+
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.9 pip install --user pydevd==2.9.5 --no-warn-script-location
68+
COPY pydevd_2_9_5.patch ./pydevd.patch
69+
RUN patch --binary -p0 -d /dbgpy/pydevd/python3.9/lib/python3.9/site-packages < pydevd.patch
7070
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python3.9 pip install --user pydevd-pycharm --no-warn-script-location
7171

7272
FROM python:3.10 as python3_10
7373
RUN PYTHONUSERBASE=/dbgpy pip install --user ptvsd debugpy
74-
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.10 pip install --user pydevd --no-warn-script-location
75-
COPY pydevd.patch .
76-
RUN patch -p0 -d /dbgpy/pydevd/python3.10/lib/python3.10/site-packages < pydevd.patch
74+
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.10 pip install --user pydevd==2.9.5 --no-warn-script-location
75+
COPY pydevd_2_9_5.patch ./pydevd.patch
76+
RUN patch --binary -p0 -d /dbgpy/pydevd/python3.10/lib/python3.10/site-packages < pydevd.patch
7777
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python3.10 pip install --user pydevd-pycharm --no-warn-script-location
7878

7979
FROM --platform=$BUILDPLATFORM golang:1.17 as build
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
diff --git _pydevd_bundle/pydevd_command_line_handling.py _pydevd_bundle/pydevd_command_line_handling.py
2+
index b46c98b..cc858b9 100644
3+
--- _pydevd_bundle/pydevd_command_line_handling.py
4+
+++ _pydevd_bundle/pydevd_command_line_handling.py
5+
@@ -76,6 +76,7 @@ ACCEPTED_ARG_HANDLERS = [
6+
ArgHandlerWithParam('log-level', int, None),
7+
8+
ArgHandlerBool('server'),
9+
+ ArgHandlerBool('continue'),
10+
ArgHandlerBool('multiproc'), # Used by PyCharm (reuses connection: ssh tunneling)
11+
ArgHandlerBool('multiprocess'), # Used by PyDev (creates new connection to ide)
12+
ArgHandlerBool('save-signatures'),
13+
diff --git pydevd.py pydevd.py
14+
index ae865b1..8751621 100644
15+
--- pydevd.py
16+
+++ pydevd.py
17+
@@ -1453,6 +1453,8 @@ class PyDB(object):
18+
19+
def run(self):
20+
host = SetupHolder.setup['client']
21+
+ if host is None:
22+
+ host = ''
23+
port = SetupHolder.setup['port']
24+
25+
self._server_socket = create_server_socket(host=host, port=port)
26+
@@ -2391,7 +2393,7 @@ class PyDB(object):
27+
from _pydev_bundle.pydev_monkey import patch_thread_modules
28+
patch_thread_modules()
29+
30+
- def run(self, file, globals=None, locals=None, is_module=False, set_trace=True):
31+
+ def run(self, file, globals=None, locals=None, is_module=False, set_trace=True, wait=True):
32+
module_name = None
33+
entry_point_fn = ''
34+
if is_module:
35+
@@ -2473,7 +2475,8 @@ class PyDB(object):
36+
sys.path.insert(0, os.path.split(os_path_abspath(file))[0])
37+
38+
if set_trace:
39+
- self.wait_for_ready_to_run()
40+
+ if wait:
41+
+ self.wait_for_ready_to_run()
42+
43+
# call prepare_to_run when we already have all information about breakpoints
44+
self.prepare_to_run()
45+
@@ -3472,14 +3475,21 @@ def main():
46+
47+
apply_debugger_options(setup)
48+
49+
+ wait = True
50+
+ if setup['continue']:
51+
+ wait = False
52+
+
53+
try:
54+
- debugger.connect(host, port)
55+
+ if wait:
56+
+ debugger.connect(host, port)
57+
+ else:
58+
+ debugger.create_wait_for_connection_thread()
59+
except:
60+
sys.stderr.write("Could not connect to %s: %s\n" % (host, port))
61+
pydev_log.exception()
62+
sys.exit(1)
63+
64+
- globals = debugger.run(setup['file'], None, None, is_module)
65+
+ globals = debugger.run(setup['file'], None, None, is_module, wait=wait)
66+
67+
if setup['cmd-line']:
68+
debugger.wait_for_commands(globals)

0 commit comments

Comments
 (0)