Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ In order to update the source, you would:

You might need to regenerate the Cython modules after any changes. This can be done by:

- Install Python latest (3.14 as of this writing)
- Install Python 3.13
- pip install cython 'django>=1.9' 'setuptools>=0.9' 'wheel>0.21' twine
- On a windows machine:
- set FORCE_PYDEVD_VC_VARS=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat
- On a windows machine in a Visual Studio Developer Prompt:
- set FORCE_PYDEVD_VC_VARS=%VCINSTALLDIR%\Auxiliary\Build\vcvars64.bat
- in the pydevd folder: python .\build_tools\build.py

## Pushing pydevd back to PyDev.Debugger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4

Expand All @@ -35,7 +35,7 @@ jobs:
CIBW_SKIP: pp* cp36-* cp37-*
CIBW_BUILD_VERBOSITY: 1

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Create sdist
run: python setup.py sdist bdist_wheel

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-${{ matrix.python-version }}
path: dist/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,22 @@ jobs:
"windows-py312-cython-checkbin",
"ubuntu-py313-cython",
"windows-py313-cython",
"ubuntu-py314-cython",
"windows-py314-cython",
]

include:
- name: "ubuntu-pypy3"
python: "pypy3.10"
os: ubuntu-20.04
os: ubuntu-latest
PYDEVD_USE_CYTHON: NO
# - name: "macos-py37-cython"
# python: "3.7"
# os: macos-latest
# PYDEVD_USE_CYTHON: YES
- name: "ubuntu-py38-cython-checkbin"
python: "3.8"
os: ubuntu-20.04
os: ubuntu-latest
PYDEVD_USE_CYTHON: YES
- name: "windows-py39-cython"
python: "3.9"
Expand All @@ -56,24 +58,32 @@ jobs:
PYDEVD_USE_CYTHON: YES
- name: "ubuntu-py311-cython"
python: "3.11.0"
os: ubuntu-20.04
os: ubuntu-latest
PYDEVD_USE_CYTHON: YES
- name: "ubuntu-py312-cython-checkbin"
python: "3.12.0"
os: ubuntu-20.04
os: ubuntu-latest
PYDEVD_USE_CYTHON: YES
- name: "windows-py312-cython-checkbin"
python: "3.12"
os: windows-latest
PYDEVD_USE_CYTHON: YES
- name: "ubuntu-py313-cython"
python: "3.13"
os: ubuntu-20.04
os: ubuntu-latest
PYDEVD_USE_CYTHON: YES
- name: "windows-py313-cython"
python: "3.13"
os: windows-latest
PYDEVD_USE_CYTHON: YES
- name: "ubuntu-py314-cython"
python: "3.14-dev"
os: ubuntu-latest
PYDEVD_USE_CYTHON: YES
- name: "windows-py314-cython"
python: "3.14"
os: windows-latest
PYDEVD_USE_CYTHON: YES

steps:
- uses: actions/checkout@v1
Expand Down Expand Up @@ -105,7 +115,7 @@ jobs:
pip install untangle --no-warn-script-location
pip install importlib-metadata --no-warn-script-location
- name: Install Python 3.x deps
if: contains(matrix.name, 'py3') && !contains(matrix.name, 'pypy') && !contains(matrix.name, 'py312') && !contains(matrix.name, 'py311') && !contains(matrix.name, 'py313')
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')
run: |
pip install PySide2 --no-warn-script-location
pip install "numpy<2" --force --no-warn-script-location
Expand Down
4 changes: 2 additions & 2 deletions src/debugpy/_vendored/pydevd/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/fabioz/PyDev.Debugger.git
branch = main
commit = d0f81de46ec51687ac24ae9598eb2615010a4b44
commit = b5cfeb38d1b11b429e5befe88cb27fcc57fdad12
parent = 8ab4ee89e9ae9a926f711904900a27e3c96d43d4
method = merge
cmdver = 0.4.9
cmdver = 0.4.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
License: Apache 2.0
Author: Yuli Fitterman
"""

import types

from _pydevd_bundle.pydevd_constants import IS_JYTHON
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def start_watching(): # Called from thread

Note: changes are only reported for files (added/modified/deleted), not directories.
"""

import sys
from os.path import basename
from _pydev_bundle import pydev_log, _pydev_saved_modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# eg: Completing a magic when user typed it without the leading % causes the % to be inserted
# to the left of what should be the first colon.
"""Interface to TerminalInteractiveShell for PyDev Interactive Console frontend
for IPython 0.11 to 1.0+.
for IPython 0.11 to 1.0+.
"""

from __future__ import print_function
Expand Down Expand Up @@ -96,9 +96,20 @@ def __init__(self, *args, **kwargs):
def matchers(self):
"""All active matcher routines for completion"""
# To remove python_matches we now have to override it as it's now a property in the superclass.

# Newer versions of IPython have file_matcher and magic_matcher.
try:
file_matches = self.file_matches
except AttributeError:
file_matches = self.file_matcher

try:
magic_matches = self.magic_matches
except AttributeError:
magic_matches = self.magic_matcher
return [
self.file_matches,
self.magic_matches,
file_matches,
magic_matches,
self.python_func_kw_matches,
self.dict_key_matches,
]
Expand Down Expand Up @@ -137,6 +148,7 @@ class PyDevTerminalInteractiveShell(TerminalInteractiveShell):
# Since IPython 5 the terminal interface is not compatible with Emacs `inferior-shell` and
# the `simple_prompt` flag is needed
simple_prompt = CBool(True)
use_jedy = CBool(False)

# In the PyDev Console, GUI control is done via hookable XML-RPC server
@staticmethod
Expand Down Expand Up @@ -366,12 +378,17 @@ def update(self, globals, locals):
def complete(self, string):
try:
if string:
return self.ipython.complete(None, line=string, cursor_pos=string.__len__())
ret = self.ipython.complete(None, line=string, cursor_pos=string.__len__())
else:
return self.ipython.complete(string, string, 0)
ret = self.ipython.complete(string, string, 0)

return ret
except:
import traceback

traceback.print_exc()
# Silence completer exceptions
pass
return None, []

def is_complete(self, string):
# Based on IPython 0.10.1
Expand Down Expand Up @@ -435,8 +452,6 @@ def getCompletions(self, text, act_tok):
append((ipython_completion, pydev_doc, "", pydev_type))
return ret
except:
import traceback

traceback.print_exc()
return []

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
def is_thread_alive(t):
return not t._os_thread_handle.is_done()

if hasattr(_temp, "_handle") and hasattr(_temp, "_started"): # Python 3.13 and later has this
elif hasattr(_temp, "_handle") and hasattr(_temp, "_started"): # Python 3.13 and later has this

def is_thread_alive(t):
return not t._handle.is_done()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def _get_related_thread(self):
return None

if thread._ident is None: # Can this happen?
pydev_log.critical("thread._ident is None in _get_related_thread!")
pydev_log.critical("thread._ident is None in _get_related_thread! - thread: %s", thread)
return None

if threading._active.get(thread._ident) is not thread:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,13 @@ def _lookahead(self):
found = []
fullrepr = None

# Collect all the load instructions
# Collect all the load instructions (include 3.12+ LOAD_SMALL_INT, LOAD_FAST_BORROW)
_load_ops = (
"LOAD_GLOBAL", "LOAD_FAST", "LOAD_CONST", "LOAD_NAME",
"LOAD_SMALL_INT", "LOAD_FAST_BORROW",
)
for next_instruction in self.instructions:
if next_instruction.opname in ("LOAD_GLOBAL", "LOAD_FAST", "LOAD_CONST", "LOAD_NAME"):
if next_instruction.opname in _load_ops:
found.append(next_instruction)
else:
break
Expand Down Expand Up @@ -721,16 +725,23 @@ def _decorate_jump_target(self, instruction, instruction_repr):

return instruction_repr

def _get_display_argrepr(self, instruction):
argrepr = instruction.argrepr
if isinstance(argrepr, str) and argrepr.startswith("NULL + "):
argrepr = argrepr[7:]
if isinstance(argrepr, str) and argrepr.endswith(" + NULL"):
argrepr = argrepr[:-7]
# LOAD_SMALL_INT (3.12+) has no argrepr; use argval for display
if not argrepr and instruction.opname == "LOAD_SMALL_INT" and instruction.argval is not None:
return str(instruction.argval)
return argrepr

def _create_msg_part(self, instruction, tok=None, line=None):
dec = self._decorate_jump_target
if line is None or line in (self.BIG_LINE_INT, self.SMALL_LINE_INT):
line = self.op_offset_to_line[instruction.offset]

argrepr = instruction.argrepr
if isinstance(argrepr, str) and argrepr.startswith("NULL + "):
argrepr = argrepr[7:]
if isinstance(argrepr, str) and argrepr.endswith("+ NULL"):
argrepr = argrepr[:-7]
argrepr = self._get_display_argrepr(instruction)
return _MsgPart(line, tok if tok is not None else dec(instruction, argrepr))

def _next_instruction_to_str(self, line_to_contents):
Expand All @@ -754,7 +765,7 @@ def _next_instruction_to_str(self, line_to_contents):
if instruction.opname == "RETURN_CONST":
return (msg(instruction, "return ", line=self.min_line(instruction)), msg(instruction))

if instruction.opname in ("LOAD_GLOBAL", "LOAD_FAST", "LOAD_CONST", "LOAD_NAME"):
if instruction.opname in ("LOAD_GLOBAL", "LOAD_FAST", "LOAD_CONST", "LOAD_NAME", "LOAD_SMALL_INT", "LOAD_FAST_BORROW"):
next_instruction = self.instructions[0]
if next_instruction.opname in ("STORE_FAST", "STORE_NAME"):
self.instructions.pop(0)
Expand Down Expand Up @@ -783,10 +794,10 @@ def _next_instruction_to_str(self, line_to_contents):
return msg(instruction, "raise")

if instruction.opname == "SETUP_FINALLY":
return msg(instruction, ("try(", instruction.argrepr, "):"))
return msg(instruction, ("try(", self._get_display_argrepr(instruction), "):"))

if instruction.argrepr:
return msg(instruction, (instruction.opname, "(", instruction.argrepr, ")"))
return msg(instruction, (instruction.opname, "(", self._get_display_argrepr(instruction), ")"))

if instruction.argval:
return msg(
Expand Down
17 changes: 9 additions & 8 deletions src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" pydevd - a debugging daemon
"""pydevd - a debugging daemon
This is the daemon you launch for python remote debugging.

Protocol:
Expand Down Expand Up @@ -1525,13 +1525,14 @@ def build_exception_info_response(dbg, thread_id, thread, request_seq, set_addit
if line_col_info.end_lineno is not None and lineno < line_col_info.end_lineno:
line_text = "\n".join(linecache.getlines(filename_in_utf8)[lineno : line_col_info.end_lineno + 1])
frame_summary = traceback.FrameSummary(
filename_in_utf8,
lineno,
method_name,
line=line_text,
end_lineno=line_col_info.end_lineno,
colno=line_col_info.colno,
end_colno=line_col_info.end_colno)
filename_in_utf8,
lineno,
method_name,
line=line_text,
end_lineno=line_col_info.end_lineno,
colno=line_col_info.colno,
end_colno=line_col_info.end_colno,
)
stack_summary.append(frame_summary)
else:
frame_summary = traceback.FrameSummary(filename_in_utf8, lineno, method_name, line=line_text)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""An helper file for the pydev debugger (REPL) console
"""
"""An helper file for the pydev debugger (REPL) console"""

import sys
import traceback
from _pydevd_bundle.pydevconsole_code import InteractiveConsole, _EvalAwaitInNewEventLoop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def _current_frames():
# Bug affecting Python 3.13.0 specifically makes some tests crash the interpreter!
# Hopefully it'll be fixed in 3.13.1.
IS_PY313_0 = sys.version_info[:3] == (3, 13, 0)
IS_PY313_1 = sys.version_info[:3] == (3, 13, 1)

# Mark tests that need to be fixed with this.
TODO_PY313_OR_GREATER = IS_PY313_OR_GREATER
Expand Down
Loading
Loading