Python 3.14: assertion failure related to ast._const_node_type_names
Describe the bug
In rope/base/ast.py, it’s expected that ast._const_node_type_names exists. Otherwise, the library falls back to a backport intended for Python 3.7 and older, and this assumption is confirmed with an assertion:
https://github.com/python-rope/rope/blob/55169bb6f687ee3c0ce76c9230e93b0834acbde5/rope/base/ast.py#L7-L22
However, as of Python 3.14.0a5, Python 3.14 also lacks ast._const_node_type_names, so importing rope.base.ast results in an assertion failure.
To Reproduce Steps to reproduce the behavior:
$ git checkout https://github.com/python-rope/rope.git
$ cd rope
$ uv venv --python 3.14
$ source .venv/bin/activate
(rope) $ uv pip install -e .[dev]
(rope) $ python -m pytest
- Describe the error or unexpected result that you are getting
ImportError while loading conftest '/home/ben/src/forks/rope/ropetest/conftest.py'.
ropetest/conftest.py:10: in <module>
from ropetest import testutils
ropetest/testutils.py:9: in <module>
import rope.base.project
rope/base/project.py:13: in <module>
from rope.base import exceptions, history, pycore, taskhandle, utils
rope/base/pycore.py:6: in <module>
import rope.base.libutils
rope/base/libutils.py:7: in <module>
from rope.base import pyobjectsdef, taskhandle, utils
rope/base/pyobjectsdef.py:1: in <module>
import rope.base.builtins
rope/base/builtins.py:6: in <module>
import rope.base.evaluate
rope/base/evaluate.py:5: in <module>
import rope.base.pynames
rope/base/pynames.py:5: in <module>
import rope.base.pyobjects
rope/base/pyobjects.py:3: in <module>
from rope.base import ast, exceptions, utils
rope/base/ast.py:12: in <module>
assert sys.version_info < (3, 8)
E AssertionError
Screenshots If applicable, add screenshots to help explain your problem.
Editor information (please complete the following information):
- Project Python version: ...
- Rope Python version: ...
- Rope version: ...
- Text editor/IDE and version: ...
Additional context Add any other context about the problem here.