From 7faf775c39b8eee5812e593b992245e9eeb0ab3d Mon Sep 17 00:00:00 2001 From: Denis Mashutin Date: Tue, 11 Feb 2025 12:04:24 +0100 Subject: [PATCH] PCQA-929 Start running debugger backend tests on Python 3.14 GitOrigin-RevId: 0b5326a05afbc4b26d88dba3cbce7f3fa938d48c --- .../pydev/_pydevd_bundle/pydevd_constants.py | 6 +++ .../ci-requirements/ci-requirements-314.txt | 13 +++++ .../pydev/pydev_tests/test_simpleTipper.py | 4 +- .../test_bytecode_modification.py | 6 ++- .../pydev/pydev_tests_python/test_debugger.py | 12 +++-- .../test_smart_step_into.py | 2 + .../test-requirements-314.txt | 52 +++++++++++++++++++ python/helpers/pydev/tox.ini | 6 ++- 8 files changed, 91 insertions(+), 10 deletions(-) create mode 100644 python/helpers/pydev/ci-requirements/ci-requirements-314.txt create mode 100644 python/helpers/pydev/test-requirements/test-requirements-314.txt diff --git a/python/helpers/pydev/_pydevd_bundle/pydevd_constants.py b/python/helpers/pydev/_pydevd_bundle/pydevd_constants.py index 56ca953ea170..16a85e02f7f7 100644 --- a/python/helpers/pydev/_pydevd_bundle/pydevd_constants.py +++ b/python/helpers/pydev/_pydevd_bundle/pydevd_constants.py @@ -134,6 +134,9 @@ IS_PY311_OR_GREATER = False IS_PY312_OR_GREATER = False IS_PY312_OR_LESSER = False IS_PY313 = False +IS_PY313_OR_GREATER = False +IS_PY313_OR_LESSER = False +IS_PY314 = False IS_PY2 = True IS_PY27 = False IS_PY24 = False @@ -156,6 +159,9 @@ try: IS_PY312_OR_GREATER = sys.version_info >= (3, 12) IS_PY312_OR_LESSER = sys.version_info[:2] <= (3, 12) IS_PY313 = sys.version_info[0] == 3 and sys.version_info[1] == 13 + IS_PY313_OR_GREATER = sys.version_info >= (3, 13) + IS_PY313_OR_LESSER = sys.version_info[:2] <= (3, 13) + IS_PY314 = sys.version_info[0] == 3 and sys.version_info[1] == 14 elif sys.version_info[0] == 2 and sys.version_info[1] == 7: IS_PY27 = True elif sys.version_info[0] == 2 and sys.version_info[1] == 4: diff --git a/python/helpers/pydev/ci-requirements/ci-requirements-314.txt b/python/helpers/pydev/ci-requirements/ci-requirements-314.txt new file mode 100644 index 000000000000..b5c304d22141 --- /dev/null +++ b/python/helpers/pydev/ci-requirements/ci-requirements-314.txt @@ -0,0 +1,13 @@ +pip==25.0 +tox==4.24.1 + +cachetools==5.5.1 +chardet==5.2.0 +colorama==0.4.6 +distlib==0.3.9 +filelock==3.17.0 +packaging==24.2 +platformdirs==4.3.6 +pluggy==1.5.0 +pyproject-api==1.9.0 +virtualenv==20.29.1 \ No newline at end of file diff --git a/python/helpers/pydev/pydev_tests/test_simpleTipper.py b/python/helpers/pydev/pydev_tests/test_simpleTipper.py index 4a5e356a2fee..4e9092288976 100644 --- a/python/helpers/pydev/pydev_tests/test_simpleTipper.py +++ b/python/helpers/pydev/pydev_tests/test_simpleTipper.py @@ -3,7 +3,7 @@ ''' from _pydev_bundle import _pydev_imports_tipper from _pydevd_bundle.pydevd_constants import IS_PY38_OR_GREATER -from _pydevd_bundle.pydevd_constants import IS_PY313 +from _pydevd_bundle.pydevd_constants import IS_PY313_OR_GREATER import inspect import pytest import sys @@ -84,7 +84,7 @@ class TestCPython(unittest.TestCase): t = self.assert_in('readlines' , tips) self.assertTrue('->' in t[1] or 'sizehint' in t[1]) - @pytest.mark.xfail(IS_PY313, reason='PCQA-886') + @pytest.mark.xfail(IS_PY313_OR_GREATER, reason='PCQA-886') def test_imports(self): ''' You can print_ the results to check... diff --git a/python/helpers/pydev/pydev_tests_python/test_bytecode_modification.py b/python/helpers/pydev/pydev_tests_python/test_bytecode_modification.py index 7707cf52ff15..ce8ee6422004 100644 --- a/python/helpers/pydev/pydev_tests_python/test_bytecode_modification.py +++ b/python/helpers/pydev/pydev_tests_python/test_bytecode_modification.py @@ -7,9 +7,11 @@ from types import CodeType import pytest from _pydevd_frame_eval.pydevd_modify_bytecode import insert_code, \ - add_jump_instruction, IS_PY310_OR_GREATER + add_jump_instruction from _pydevd_bundle.pydevd_constants import IS_PY39 +from _pydevd_bundle.pydevd_constants import IS_PY310_OR_GREATER from _pydevd_bundle.pydevd_constants import IS_PY311_OR_GREATER +from _pydevd_bundle.pydevd_constants import IS_PY313_OR_LESSER from opcode import EXTENDED_ARG TRACE_MESSAGE = "Trace called" @@ -32,7 +34,7 @@ IS_PY37_OR_GREATER = sys.version_info > (3, 7) LOAD_OPCODES = [dis.opmap[x] for x in ('LOAD_ATTR', 'LOAD_CONST', 'LOAD_FAST', 'LOAD_GLOBAL', 'LOAD_NAME')] -if IS_PY37_OR_GREATER: +if IS_PY37_OR_GREATER and IS_PY313_OR_LESSER: LOAD_OPCODES.append(dis.opmap['LOAD_METHOD']) diff --git a/python/helpers/pydev/pydev_tests_python/test_debugger.py b/python/helpers/pydev/pydev_tests_python/test_debugger.py index 8a9ac8e05c81..5b6595942314 100644 --- a/python/helpers/pydev/pydev_tests_python/test_debugger.py +++ b/python/helpers/pydev/pydev_tests_python/test_debugger.py @@ -24,6 +24,8 @@ from _pydevd_bundle.pydevd_constants import IS_PY39_OR_GREATER from _pydevd_bundle.pydevd_constants import IS_PY310_OR_GREATER from _pydevd_bundle.pydevd_constants import IS_PY312_OR_GREATER from _pydevd_bundle.pydevd_constants import IS_PY313 +from _pydevd_bundle.pydevd_constants import IS_PY313_OR_GREATER +from _pydevd_bundle.pydevd_constants import IS_PY314 try: @@ -284,7 +286,7 @@ def test_case_suspend_thread(case_setup): # we're inside the tracing other threads don't run (so, we can have only one # thread paused in the debugger). @pytest.mark.skipif(IS_JYTHON, reason='Jython can only have one thread stopped at each time.') -@pytest.mark.xfail(IS_PY313, reason='PCQA-888') +@pytest.mark.xfail(IS_PY313_OR_GREATER, reason='PCQA-888') def test_case_suspend_all_thread(case_setup): with case_setup.test_file('_debugger_case_suspend_all.py') as writer: writer.write_make_initial_run() @@ -1064,7 +1066,7 @@ def test_case_qthread4(case_setup): writer.log.append('Marking finished ok.') writer.finished_ok = True - +@pytest.mark.xfail(IS_PY314, reason='PCQA-941') def test_m_switch(case_setup_m_switch): with case_setup_m_switch.test_file() as writer: writer.log.append('writing add breakpoint') @@ -1091,7 +1093,7 @@ def test_m_switch(case_setup_m_switch): writer.finished_ok = True - +@pytest.mark.xfail(IS_PY314, reason='PCQA-942') def test_module_entry_point(case_setup_m_switch_entry_point): with case_setup_m_switch_entry_point.test_file() as writer: writer.log.append('writing add breakpoint') @@ -2455,8 +2457,8 @@ def test_return_value(case_setup): @pytest.mark.parametrize( 'check_single_notification', ( - pytest.param(True, marks=pytest.mark.xfail(IS_PY313, reason='PCQA-889')), - pytest.param(False, marks=pytest.mark.xfail(IS_PY313, reason='PCQA-890')), + pytest.param(True, marks=pytest.mark.xfail(IS_PY313_OR_GREATER, reason='PCQA-889')), + pytest.param(False, marks=pytest.mark.xfail(IS_PY313_OR_GREATER, reason='PCQA-890')), ), ) def test_run_pause_all_threads_single_notification(case_setup, check_single_notification): diff --git a/python/helpers/pydev/pydev_tests_python/test_smart_step_into.py b/python/helpers/pydev/pydev_tests_python/test_smart_step_into.py index da7396590f00..9bccc0b4b3d2 100644 --- a/python/helpers/pydev/pydev_tests_python/test_smart_step_into.py +++ b/python/helpers/pydev/pydev_tests_python/test_smart_step_into.py @@ -6,6 +6,7 @@ from _pydevd_bundle.smart_step_into import get_stepping_variants from _pydevd_bundle.pydevd_constants import IS_PY38 from _pydevd_bundle.pydevd_constants import IS_PY39 from _pydevd_bundle.pydevd_constants import IS_PY310 +from _pydevd_bundle.pydevd_constants import IS_PY314 @pytest.fixture @@ -82,6 +83,7 @@ def test_candidates_for_inner_decorator_py2(inner_decorator_code): @pytest.mark.python3(reason="Python 3 is required to step into binary operators") +@pytest.mark.xfail(IS_PY314, reason='PCQA-943') def test_candidates_for_inner_decorator_py3(inner_decorator_code): variants = list(get_stepping_variants(inner_decorator_code)) assert len(variants) == 2 diff --git a/python/helpers/pydev/test-requirements/test-requirements-314.txt b/python/helpers/pydev/test-requirements/test-requirements-314.txt new file mode 100644 index 000000000000..2073f6abbbb1 --- /dev/null +++ b/python/helpers/pydev/test-requirements/test-requirements-314.txt @@ -0,0 +1,52 @@ +pytest==8.3.4 +teamcity-messages==1.33 +ipython==8.32.0 +Django==5.1.5 +behave==1.2.7.dev6 +Jinja2==3.1.5 +nose==1.3.7 +django-nose==1.4.7 +behave-django==1.5.0 +pytest-xdist==3.6.1 +untangle==1.2.1 +pandas==2.2.3 +py==1.11.0 + +asgiref==3.8.1 +asttokens==3.0.0 +beautifulsoup4==4.12.3 +colorama==0.4.6 +cucumber-expressions==18.0.1 +cucumber-tag-expressions==6.1.2 +decorator==5.1.1 +defusedxml==0.7.1 +exceptiongroup==1.2.2 +execnet==2.1.1 +executing==2.2.0 +iniconfig==2.0.0 +jedi==0.19.2 +MarkupSafe==3.0.2 +matplotlib-inline==0.1.7 +numpy==2.2.2 +packaging==24.2 +parse==1.20.2 +parse_type==0.6.4 +parso==0.8.4 +pexpect==4.9.0 +pluggy==1.5.0 +prompt_toolkit==3.0.50 +ptyprocess==0.7.0 +pure_eval==0.2.3 +Pygments==2.19.1 + +python-dateutil==2.9.0.post0 +pytz==2025.1 +six==1.17.0 +soupsieve==2.6 +sqlparse==0.5.3 +stack-data==0.6.3 +tomli==2.2.1 +traitlets==5.14.3 +typing_extensions==4.12.2 +tzdata==2025.1 +wcwidth==0.2.13 \ No newline at end of file diff --git a/python/helpers/pydev/tox.ini b/python/helpers/pydev/tox.ini index 93947311e92c..0c98762aed3e 100644 --- a/python/helpers/pydev/tox.ini +++ b/python/helpers/pydev/tox.ini @@ -7,6 +7,7 @@ envlist = py311 py312 py313 + py314 skipsdist=True [testenv] @@ -33,4 +34,7 @@ deps = -rtest-requirements/test-requirements-311.txt deps = -rtest-requirements/test-requirements-312.txt [testenv:py313] -deps = -rtest-requirements/test-requirements-313.txt \ No newline at end of file +deps = -rtest-requirements/test-requirements-313.txt + +[testenv:py314] +deps = -rtest-requirements/test-requirements-314.txt \ No newline at end of file