Skip to content
Open
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
1 change: 1 addition & 0 deletions ci/python-gate.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@
// logging
["mx"] + self.mx_parameters + self.dy + ["sversions"],
],
run+: [ ["sleep", "30m"] ],
on_success+: [
["rm", "-rf", "graal_dumps"],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def get_setuptools(setuptools='setuptools==67.6.1'):
else:
py_executable = setuptools_path / 'bin' / 'python3'
extra_args = []
if sys.implementation.name == "graalpy" and not system_python and __graalpython__.is_bytecode_dsl_interpreter:
extra_args = ['--vm.Dpython.EnableBytecodeDSLInterpreter=true']
if sys.implementation.name == "graalpy" and not system_python and not __graalpython__.is_native:
extra_args += [f'--vm.Dpython.EnableBytecodeDSLInterpreter={str(__graalpython__.is_bytecode_dsl_interpreter).lower()}']
subprocess.run([py_executable, *extra_args, "-m", "pip", "install", "--target", str(setuptools_path), setuptools], check=True)
print('setuptools is installed in %s' % setuptools_path)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# The Universal Permissive License (UPL), Version 1.0
Expand Down Expand Up @@ -51,8 +51,8 @@
ARGS = []
if sys.implementation.name == 'graalpy':
ARGS = ['--experimental-options', '--python.EnableDebuggingBuiltins']
if not __graalpython__.is_native and __graalpython__.is_bytecode_dsl_interpreter:
ARGS += ['--vm.Dpython.EnableBytecodeDSLInterpreter=true']
if not __graalpython__.is_native:
ARGS += [f'--vm.Dpython.EnableBytecodeDSLInterpreter={str(__graalpython__.is_bytecode_dsl_interpreter).lower()}']
COMMAND = [sys.executable, *ARGS, str(MODULE_PATH)]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
# SOFTWARE.
import os
import sys

from tests import util

# IMPORTANT: DO NOT MOVE!
# This test checks that lineno works on frames,
# it MUST stay on this line!
def test_lineno():
assert sys._getframe(0).f_lineno == 47

if not os.environ.get('BYTECODE_DSL_INTERPRETER'): # Blocked by GR-61955
if not util.IS_BYTECODE_DSL: # Blocked by GR-61955
# IMPORTANT: DO NOT MOVE!
def test_nested_lineno():
def test_nested():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import sys
import os
import unittest
from tests import util


class ExceptionTest(unittest.TestCase):
Expand Down Expand Up @@ -557,7 +558,7 @@ def gen():
assert f.f_globals is globals()
assert f.f_locals == {'a': 1, 'b': 2, 'c': 3}
# TODO GR-61955
if sys.implementation.name != "graalpy" or not __graalpython__.is_bytecode_dsl_interpreter:
if not util.IS_BYTECODE_DSL:
assert f.f_lineno == gen.__code__.co_firstlineno + 5
assert not g.gi_frame

Expand Down Expand Up @@ -591,7 +592,7 @@ def gen():
assert f.f_globals is globals()
assert f.f_locals == {'a': 1, 'b': 2}
# TODO GR-61955
if sys.implementation.name != "graalpy" or not __graalpython__.is_bytecode_dsl_interpreter:
if not util.IS_BYTECODE_DSL:
assert f.f_lineno == gen.__code__.co_firstlineno + 3


Expand Down
113 changes: 55 additions & 58 deletions graalpython/com.oracle.graal.python.test/src/tests/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import doctest
import sys
import unittest
from tests import util


# Copied from test_doctest
Expand Down Expand Up @@ -69,8 +70,6 @@ def __exit__(self, *exc):
if self.orig_trace:
sys.settrace(self.orig_trace)


@unittest.skipIf(os.environ.get('BYTECODE_DSL_INTERPRETER'), "TODO: FrameSlotTypeException with reparsing")
def doctest_pdb_locals():
"""
Test that locals get synced after breakpoint
Expand Down Expand Up @@ -101,63 +100,61 @@ def doctest_pdb_locals():
"""


@unittest.skipIf(os.environ.get('BYTECODE_DSL_INTERPRETER'), "TODO: FrameSlotTypeException with reparsing")
def doctest_pdb_locals_generator():
"""
Test that locals get synced after breakpoint in a generator

>>> def test_function():
... a = 1
... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
... a = 2
... yield

>>> with PdbTestInput([
... 'p a',
... 'next',
... 'p a',
... 'continue',
... ]):
... next(test_function())
> <doctest tests.test_pdb.doctest_pdb_locals_generator[0]>(4)test_function()
-> a = 2
(Pdb) p a
1
(Pdb) next
> <doctest tests.test_pdb.doctest_pdb_locals_generator[0]>(5)test_function()
-> yield
(Pdb) p a
2
(Pdb) continue
"""


@unittest.skipIf(os.environ.get('BYTECODE_DSL_INTERPRETER'), "TODO: FrameSlotTypeException with reparsing")
def doctest_pdb_locals_sync_back():
"""
Test that locals set by debugger get propagated back into the frame.

>>> def test_function():
... foo = 1
... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
... return foo

>>> with PdbTestInput([
... 'p foo',
... 'foo = 5',
... 'continue',
... ]):
... print(test_function())
> <doctest tests.test_pdb.doctest_pdb_locals_sync_back[0]>(4)test_function()
-> return foo
(Pdb) p foo
1
(Pdb) foo = 5
(Pdb) continue
5
"""
if not util.IS_BYTECODE_DSL:
def doctest_pdb_locals_generator():
"""
Test that locals get synced after breakpoint in a generator

>>> def test_function():
... a = 1
... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
... a = 2
... yield

>>> with PdbTestInput([
... 'p a',
... 'next',
... 'p a',
... 'continue',
... ]):
... next(test_function())
> <doctest tests.test_pdb.doctest_pdb_locals_generator[0]>(4)test_function()
-> a = 2
(Pdb) p a
1
(Pdb) next
> <doctest tests.test_pdb.doctest_pdb_locals_generator[0]>(5)test_function()
-> yield
(Pdb) p a
2
(Pdb) continue
"""


def doctest_pdb_locals_sync_back():
"""
Test that locals set by debugger get propagated back into the frame.

>>> def test_function():
... foo = 1
... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
... return foo

>>> with PdbTestInput([
... 'p foo',
... 'foo = 5',
... 'continue',
... ]):
... print(test_function())
> <doctest tests.test_pdb.doctest_pdb_locals_sync_back[0]>(4)test_function()
-> return foo
(Pdb) p foo
1
(Pdb) foo = 5
(Pdb) continue
5
"""


@unittest.skipIf(os.environ.get('BYTECODE_DSL_INTERPRETER'), "TODO: FrameSlotTypeException with reparsing")
def test_run_doctests():
doctest.testmod(sys.modules[__name__], raise_on_error=True)
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import sys
import tempfile
import unittest
from tests import util
from dataclasses import dataclass
from textwrap import dedent

Expand Down Expand Up @@ -191,7 +192,7 @@ def test_continuation():
'''))


@unittest.skipIf(os.environ.get('BYTECODE_DSL_INTERPRETER'), "TODO: <interactive> vs <module> in traceback")
@util.skipIfBytecodeDSL("TODO: <interactive> vs <module> in traceback")
def test_exceptions():
validate_repl(dedent("""\
>>> 1 / 0
Expand Down
Loading