Skip to content

Commit d9954c1

Browse files
committed
Initial support for Python 3.14 (still not complete).
1 parent 3030fa9 commit d9954c1

39 files changed

+36714
-40512
lines changed

.github/workflows/pydevd-release-manylinux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
os: [ubuntu-20.04]
19+
os: [ubuntu-latest]
2020
steps:
2121
- uses: actions/checkout@v4
2222

.github/workflows/pydevd-tests-python.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,22 @@ jobs:
2626
"windows-py312-cython-checkbin",
2727
"ubuntu-py313-cython",
2828
"windows-py313-cython",
29+
"ubuntu-py314-cython",
30+
"windows-py314-cython",
2931
]
3032

3133
include:
3234
- name: "ubuntu-pypy3"
3335
python: "pypy3.10"
34-
os: ubuntu-20.04
36+
os: ubuntu-latest
3537
PYDEVD_USE_CYTHON: NO
3638
# - name: "macos-py37-cython"
3739
# python: "3.7"
3840
# os: macos-latest
3941
# PYDEVD_USE_CYTHON: YES
4042
- name: "ubuntu-py38-cython-checkbin"
4143
python: "3.8"
42-
os: ubuntu-20.04
44+
os: ubuntu-latest
4345
PYDEVD_USE_CYTHON: YES
4446
- name: "windows-py39-cython"
4547
python: "3.9"
@@ -56,24 +58,32 @@ jobs:
5658
PYDEVD_USE_CYTHON: YES
5759
- name: "ubuntu-py311-cython"
5860
python: "3.11.0"
59-
os: ubuntu-20.04
61+
os: ubuntu-latest
6062
PYDEVD_USE_CYTHON: YES
6163
- name: "ubuntu-py312-cython-checkbin"
6264
python: "3.12.0"
63-
os: ubuntu-20.04
65+
os: ubuntu-latest
6466
PYDEVD_USE_CYTHON: YES
6567
- name: "windows-py312-cython-checkbin"
6668
python: "3.12"
6769
os: windows-latest
6870
PYDEVD_USE_CYTHON: YES
6971
- name: "ubuntu-py313-cython"
7072
python: "3.13"
71-
os: ubuntu-20.04
73+
os: ubuntu-latest
7274
PYDEVD_USE_CYTHON: YES
7375
- name: "windows-py313-cython"
7476
python: "3.13"
7577
os: windows-latest
7678
PYDEVD_USE_CYTHON: YES
79+
- name: "ubuntu-py314-cython"
80+
python: "3.14-dev"
81+
os: ubuntu-latest
82+
PYDEVD_USE_CYTHON: YES
83+
- name: "windows-py314-cython"
84+
python: "3.14-dev"
85+
os: windows-latest
86+
PYDEVD_USE_CYTHON: YES
7787

7888
steps:
7989
- uses: actions/checkout@v1
@@ -105,7 +115,7 @@ jobs:
105115
pip install untangle --no-warn-script-location
106116
pip install importlib-metadata --no-warn-script-location
107117
- name: Install Python 3.x deps
108-
if: contains(matrix.name, 'py3') && !contains(matrix.name, 'pypy') && !contains(matrix.name, 'py312') && !contains(matrix.name, 'py311') && !contains(matrix.name, 'py313')
118+
if: contains(matrix.name, 'py3') && !contains(matrix.name, 'pypy') && !contains(matrix.name, 'py312') && !contains(matrix.name, 'py311') && !contains(matrix.name, 'py313') && !contains(matrix.name, 'py314')
109119
run: |
110120
pip install PySide2 --no-warn-script-location
111121
pip install "numpy<2" --force --no-warn-script-location

_pydev_bundle/pydev_ipython_console_011.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,20 @@ def __init__(self, *args, **kwargs):
9696
def matchers(self):
9797
"""All active matcher routines for completion"""
9898
# To remove python_matches we now have to override it as it's now a property in the superclass.
99+
100+
# Newer versions of IPython have file_matcher and magic_matcher.
101+
try:
102+
file_matches = self.file_matches
103+
except AttributeError:
104+
file_matches = self.file_matcher
105+
106+
try:
107+
magic_matches = self.magic_matches
108+
except AttributeError:
109+
magic_matches = self.magic_matcher
99110
return [
100-
self.file_matches,
101-
self.magic_matches,
111+
file_matches,
112+
magic_matches,
102113
self.python_func_kw_matches,
103114
self.dict_key_matches,
104115
]
@@ -137,6 +148,7 @@ class PyDevTerminalInteractiveShell(TerminalInteractiveShell):
137148
# Since IPython 5 the terminal interface is not compatible with Emacs `inferior-shell` and
138149
# the `simple_prompt` flag is needed
139150
simple_prompt = CBool(True)
151+
use_jedy = CBool(False)
140152

141153
# In the PyDev Console, GUI control is done via hookable XML-RPC server
142154
@staticmethod
@@ -366,12 +378,17 @@ def update(self, globals, locals):
366378
def complete(self, string):
367379
try:
368380
if string:
369-
return self.ipython.complete(None, line=string, cursor_pos=string.__len__())
381+
ret = self.ipython.complete(None, line=string, cursor_pos=string.__len__())
370382
else:
371-
return self.ipython.complete(string, string, 0)
383+
ret = self.ipython.complete(string, string, 0)
384+
385+
return ret
372386
except:
387+
import traceback
388+
389+
traceback.print_exc()
373390
# Silence completer exceptions
374-
pass
391+
return None, []
375392

376393
def is_complete(self, string):
377394
# Based on IPython 0.10.1
@@ -435,8 +452,6 @@ def getCompletions(self, text, act_tok):
435452
append((ipython_completion, pydev_doc, "", pydev_type))
436453
return ret
437454
except:
438-
import traceback
439-
440455
traceback.print_exc()
441456
return []
442457

_pydev_bundle/pydev_is_thread_alive.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
# It is required to debug threads started by start_new_thread in Python 3.4
66
_temp = threading.Thread()
77

8-
if hasattr(_temp, "_handle") and hasattr(_temp, "_started"): # Python 3.13 and later has this
8+
if hasattr(_temp, "_os_thread_handle"): # Python 3.14 and later has this
9+
def is_thread_alive(t):
10+
return not t._os_thread_handle.is_done()
11+
12+
elif hasattr(_temp, "_handle") and hasattr(_temp, "_started"): # Python 3.13 and later has this
913

1014
def is_thread_alive(t):
1115
return not t._handle.is_done()

_pydev_bundle/pydev_monkey.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,9 @@ def patch_new_process_functions():
10221022
monkey_patch_os("spawnvpe", create_spawnve)
10231023
monkey_patch_os("posix_spawn", create_posix_spawn)
10241024

1025+
if not IS_WINDOWS:
1026+
monkey_patch_os("posix_spawnp", create_posix_spawn)
1027+
10251028
if not IS_JYTHON:
10261029
if not IS_WINDOWS:
10271030
monkey_patch_os("fork", create_fork)

_pydevd_bundle/pydevd_comm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ def internal_change_variable_json(py_db, request):
934934
)
935935
return
936936

937-
child_var = variable.change_variable(arguments.name, arguments.value, py_db, fmt=fmt)
937+
child_var = variable.change_variable(arguments.name, arguments.value, py_db, fmt=fmt, scope=scope)
938938

939939
if child_var is None:
940940
_write_variable_response(py_db, request, value="", success=False, message="Unable to change: %s." % (arguments.name,))

0 commit comments

Comments
 (0)