Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Oct 7, 2023
1 parent 6182f48 commit 31405f5
Show file tree
Hide file tree
Showing 21 changed files with 17,972 additions and 11,243 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pydevd-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- name: Set up Python
Expand All @@ -30,7 +30,7 @@ jobs:
- name: Install common Python deps
run: |
pip install --upgrade pip
pip install wheel cython psutil twine --no-warn-script-location
pip install wheel cython setuptools psutil twine --no-warn-script-location
- name: Build cython
env:
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/pydevd-tests-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
"windows-py310-cython",
"windows-py311-cython",
"ubuntu-py311-cython",
"ubuntu-py312-cython",
]

include:
Expand Down Expand Up @@ -54,6 +55,10 @@ jobs:
python: "3.11.0"
os: ubuntu-latest
PYDEVD_USE_CYTHON: YES
- name: "ubuntu-py312-cython"
python: "3.12.0"
os: ubuntu-latest
PYDEVD_USE_CYTHON: YES

steps:
- uses: actions/checkout@v1
Expand All @@ -73,6 +78,7 @@ jobs:
- name: Install common Python deps
run: |
pip install --upgrade pip
pip install setuptools --no-warn-script-location
pip install wheel --no-warn-script-location
pip install cython --no-warn-script-location
pip install psutil --no-warn-script-location
Expand All @@ -83,12 +89,12 @@ jobs:
pip install ipython --no-warn-script-location
pip install untangle --no-warn-script-location
- name: Install Python 3.x deps
if: contains(matrix.name, 'py3') && !contains(matrix.name, 'pypy') && !contains(matrix.name, 'py311')
if: contains(matrix.name, 'py3') && !contains(matrix.name, 'pypy') && !contains(matrix.name, 'py311') && !contains(matrix.name, 'py312')
run: |
pip install PySide2 --no-warn-script-location
pip install django
pip install cherrypy --no-warn-script-location
pip install gevent greenlet==1.1.3
pip install gevent greenlet
- name: Install Pandas
if: contains(matrix.name, 'py310') && !contains(matrix.name, 'pypy')
# The pandas Styler also requires jinja2.
Expand Down
18 changes: 13 additions & 5 deletions _pydevd_bundle/pydevd_collect_bytecode_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def iter_instructions(co):


def collect_return_info(co, use_func_first_line=False):
if not hasattr(co, 'co_lnotab'):
if not hasattr(co, 'co_lines') and not hasattr(co, 'co_lnotab'):
return []

if use_func_first_line:
Expand Down Expand Up @@ -256,7 +256,7 @@ def _get_except_target_info(instructions, exception_end_instruction_index, offse

def collect_try_except_info(co, use_func_first_line=False):
# We no longer have 'END_FINALLY', so, we need to do things differently in Python 3.9
if not hasattr(co, 'co_lnotab'):
if not hasattr(co, 'co_lines') and not hasattr(co, 'co_lnotab'):
return []

if use_func_first_line:
Expand Down Expand Up @@ -376,7 +376,7 @@ def _get_except_target_info(instructions, exception_end_instruction_index, offse

def collect_try_except_info(co, use_func_first_line=False):
# We no longer have 'END_FINALLY', so, we need to do things differently in Python 3.9
if not hasattr(co, 'co_lnotab'):
if not hasattr(co, 'co_lines') and not hasattr(co, 'co_lnotab'):
return []

if use_func_first_line:
Expand Down Expand Up @@ -552,6 +552,11 @@ def __init__(self, line, tok):
self.line = line
self.tok = tok

def __str__(self) -> str:
return '_MsgPart(line: %s tok: %s)' % (self.line, self.tok)

__repr__ = __str__

@classmethod
def add_to_line_to_contents(cls, obj, line_to_contents, line=None):
if isinstance(obj, (list, tuple)):
Expand Down Expand Up @@ -669,7 +674,7 @@ def _lookahead(self):
)
return RESTART_FROM_LOOKAHEAD

if next_instruction.opname in ('CALL_FUNCTION', 'PRECALL'):
if next_instruction.opname in ('CALL_FUNCTION', 'PRECALL', 'CALL'):
if len(found) == next_instruction.argval + 1:
force_restart = False
delta = 0
Expand Down Expand Up @@ -804,9 +809,12 @@ def _next_instruction_to_str(self, line_to_contents):

instruction = self.instructions.pop(0)

if instruction.opname in 'RESUME':
if instruction.opname in ('RESUME', 'NULL'):
return None

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'):
next_instruction = self.instructions[0]
if next_instruction.opname in ('STORE_FAST', 'STORE_NAME'):
Expand Down
Loading

0 comments on commit 31405f5

Please sign in to comment.