Bug 2368972 - python-jedi fails to build with Python 3.14: test_string_annotation: AssertionError: assert [] == ['int', 'str'] etc.
Summary: python-jedi fails to build with Python 3.14: test_string_annotation: Assertio...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-jedi
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lumír Balhar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2025-05-28 14:48 UTC by Karolina Surma
Modified: 2025-06-03 14:07 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github davidhalter jedi issues 2064 0 None open Python 3.14 compatibility 2025-06-03 14:07:11 UTC

Description Karolina Surma 2025-05-28 14:48:01 UTC
python-jedi fails to build with Python 3.14.0b2.

________________ test_string_annotation[annotations8-result8-] _________________

annotations = {'return': 'typing.Union[str, int]'}, result = ['int', 'str']
code = ''

    @pytest.mark.parametrize(
        'annotations, result, code', [
            ({}, [], ''),
            (None, [], ''),
            ({'asdf': 'str'}, [], ''),
    
            ({'return': 'str'}, ['str'], ''),
            ({'return': 'None'}, ['NoneType'], ''),
            ({'return': 'str().upper'}, [], ''),
            ({'return': 'foo()'}, [], ''),
            ({'return': 'bar()'}, ['float'], ''),
    
            # typing is available via globals.
            ({'return': 'typing.Union[str, int]'}, ['int', 'str'], ''),
            ({'return': 'typing.Union["str", int]'},
             ['int', 'str'] if sys.version_info >= (3, 9) else ['int'], ''),
            ({'return': 'typing.Union["str", 1]'},
             ['str'] if sys.version_info >= (3, 11) else [], ''),
            ({'return': 'typing.Optional[str]'}, ['NoneType', 'str'], ''),
            ({'return': 'typing.Optional[str, int]'}, [], ''),  # Takes only one arg
            ({'return': 'typing.Any'},
             ['_AnyMeta'] if sys.version_info >= (3, 11) else [], ''),
    
            ({'return': 'typing.Tuple[int, str]'},
             ['Tuple' if sys.version_info[:2] == (3, 6) else 'tuple'], ''),
            ({'return': 'typing.Tuple[int, str]'}, ['int'], 'x()[0]'),
            ({'return': 'typing.Tuple[int, str]'}, ['str'], 'x()[1]'),
            ({'return': 'typing.Tuple[int, str]'}, [], 'x()[2]'),
    
            ({'return': 'typing.List'}, ['list'], 'list'),
            ({'return': 'typing.List[int]'}, ['list'], 'list'),
            ({'return': 'typing.List[int]'}, ['int'], 'x()[0]'),
            ({'return': 'typing.List[int, str]'}, [], 'x()[0]'),
    
            ({'return': 'typing.Iterator[int]'}, [], 'x()[0]'),
            ({'return': 'typing.Iterator[int]'}, ['int'], 'next(x())'),
            ({'return': 'typing.Iterable[float]'}, ['float'], 'list(x())[0]'),
    
            ({'return': 'decimal.Decimal'}, [], ''),
            ({'return': 'lalalalallalaa'}, [], ''),
            ({'return': 'lalalalallalaa.lala'}, [], ''),
        ]
    )
    def test_string_annotation(annotations, result, code):
        x = lambda foo: 1  # noqa: E731
        x.__annotations__ = annotations
        defs = jedi.Interpreter(code or 'x()', [locals()]).infer()
>       assert [d.name for d in defs] == result
E       AssertionError: assert [] == ['int', 'str']
E         
E         Right contains 2 more items, first extra item: 'int'
E         Use -v to get more diff

test/test_api/test_interpreter.py:697: AssertionError
________________ test_string_annotation[annotations9-result9-] _________________

annotations = {'return': 'typing.Union["str", int]'}, result = ['int', 'str']
code = ''

    @pytest.mark.parametrize(
        'annotations, result, code', [
            ({}, [], ''),
            (None, [], ''),
            ({'asdf': 'str'}, [], ''),
    
            ({'return': 'str'}, ['str'], ''),
            ({'return': 'None'}, ['NoneType'], ''),
            ({'return': 'str().upper'}, [], ''),
            ({'return': 'foo()'}, [], ''),
            ({'return': 'bar()'}, ['float'], ''),
    
            # typing is available via globals.
            ({'return': 'typing.Union[str, int]'}, ['int', 'str'], ''),
            ({'return': 'typing.Union["str", int]'},
             ['int', 'str'] if sys.version_info >= (3, 9) else ['int'], ''),
            ({'return': 'typing.Union["str", 1]'},
             ['str'] if sys.version_info >= (3, 11) else [], ''),
            ({'return': 'typing.Optional[str]'}, ['NoneType', 'str'], ''),
            ({'return': 'typing.Optional[str, int]'}, [], ''),  # Takes only one arg
            ({'return': 'typing.Any'},
             ['_AnyMeta'] if sys.version_info >= (3, 11) else [], ''),
    
            ({'return': 'typing.Tuple[int, str]'},
             ['Tuple' if sys.version_info[:2] == (3, 6) else 'tuple'], ''),
            ({'return': 'typing.Tuple[int, str]'}, ['int'], 'x()[0]'),
            ({'return': 'typing.Tuple[int, str]'}, ['str'], 'x()[1]'),
            ({'return': 'typing.Tuple[int, str]'}, [], 'x()[2]'),
    
            ({'return': 'typing.List'}, ['list'], 'list'),
            ({'return': 'typing.List[int]'}, ['list'], 'list'),
            ({'return': 'typing.List[int]'}, ['int'], 'x()[0]'),
            ({'return': 'typing.List[int, str]'}, [], 'x()[0]'),
    
            ({'return': 'typing.Iterator[int]'}, [], 'x()[0]'),
            ({'return': 'typing.Iterator[int]'}, ['int'], 'next(x())'),
            ({'return': 'typing.Iterable[float]'}, ['float'], 'list(x())[0]'),
    
            ({'return': 'decimal.Decimal'}, [], ''),
            ({'return': 'lalalalallalaa'}, [], ''),
            ({'return': 'lalalalallalaa.lala'}, [], ''),
        ]
    )
    def test_string_annotation(annotations, result, code):
        x = lambda foo: 1  # noqa: E731
        x.__annotations__ = annotations
        defs = jedi.Interpreter(code or 'x()', [locals()]).infer()
>       assert [d.name for d in defs] == result
E       AssertionError: assert [] == ['int', 'str']
E         
E         Right contains 2 more items, first extra item: 'int'
E         Use -v to get more diff

test/test_api/test_interpreter.py:697: AssertionError
_______________ test_string_annotation[annotations10-result10-] ________________

annotations = {'return': 'typing.Union["str", 1]'}, result = ['str'], code = ''

    @pytest.mark.parametrize(
        'annotations, result, code', [
            ({}, [], ''),
            (None, [], ''),
            ({'asdf': 'str'}, [], ''),
    
            ({'return': 'str'}, ['str'], ''),
            ({'return': 'None'}, ['NoneType'], ''),
            ({'return': 'str().upper'}, [], ''),
            ({'return': 'foo()'}, [], ''),
            ({'return': 'bar()'}, ['float'], ''),
    
            # typing is available via globals.
            ({'return': 'typing.Union[str, int]'}, ['int', 'str'], ''),
            ({'return': 'typing.Union["str", int]'},
             ['int', 'str'] if sys.version_info >= (3, 9) else ['int'], ''),
            ({'return': 'typing.Union["str", 1]'},
             ['str'] if sys.version_info >= (3, 11) else [], ''),
            ({'return': 'typing.Optional[str]'}, ['NoneType', 'str'], ''),
            ({'return': 'typing.Optional[str, int]'}, [], ''),  # Takes only one arg
            ({'return': 'typing.Any'},
             ['_AnyMeta'] if sys.version_info >= (3, 11) else [], ''),
    
            ({'return': 'typing.Tuple[int, str]'},
             ['Tuple' if sys.version_info[:2] == (3, 6) else 'tuple'], ''),
            ({'return': 'typing.Tuple[int, str]'}, ['int'], 'x()[0]'),
            ({'return': 'typing.Tuple[int, str]'}, ['str'], 'x()[1]'),
            ({'return': 'typing.Tuple[int, str]'}, [], 'x()[2]'),
    
            ({'return': 'typing.List'}, ['list'], 'list'),
            ({'return': 'typing.List[int]'}, ['list'], 'list'),
            ({'return': 'typing.List[int]'}, ['int'], 'x()[0]'),
            ({'return': 'typing.List[int, str]'}, [], 'x()[0]'),
    
            ({'return': 'typing.Iterator[int]'}, [], 'x()[0]'),
            ({'return': 'typing.Iterator[int]'}, ['int'], 'next(x())'),
            ({'return': 'typing.Iterable[float]'}, ['float'], 'list(x())[0]'),
    
            ({'return': 'decimal.Decimal'}, [], ''),
            ({'return': 'lalalalallalaa'}, [], ''),
            ({'return': 'lalalalallalaa.lala'}, [], ''),
        ]
    )
    def test_string_annotation(annotations, result, code):
        x = lambda foo: 1  # noqa: E731
        x.__annotations__ = annotations
        defs = jedi.Interpreter(code or 'x()', [locals()]).infer()
>       assert [d.name for d in defs] == result
E       AssertionError: assert [] == ['str']
E         
E         Right contains one more item: 'str'
E         Use -v to get more diff

test/test_api/test_interpreter.py:697: AssertionError
_______________ test_string_annotation[annotations11-result11-] ________________

annotations = {'return': 'typing.Optional[str]'}, result = ['NoneType', 'str']
code = ''

    @pytest.mark.parametrize(
        'annotations, result, code', [
            ({}, [], ''),
            (None, [], ''),
            ({'asdf': 'str'}, [], ''),
    
            ({'return': 'str'}, ['str'], ''),
            ({'return': 'None'}, ['NoneType'], ''),
            ({'return': 'str().upper'}, [], ''),
            ({'return': 'foo()'}, [], ''),
            ({'return': 'bar()'}, ['float'], ''),
    
            # typing is available via globals.
            ({'return': 'typing.Union[str, int]'}, ['int', 'str'], ''),
            ({'return': 'typing.Union["str", int]'},
             ['int', 'str'] if sys.version_info >= (3, 9) else ['int'], ''),
            ({'return': 'typing.Union["str", 1]'},
             ['str'] if sys.version_info >= (3, 11) else [], ''),
            ({'return': 'typing.Optional[str]'}, ['NoneType', 'str'], ''),
            ({'return': 'typing.Optional[str, int]'}, [], ''),  # Takes only one arg
            ({'return': 'typing.Any'},
             ['_AnyMeta'] if sys.version_info >= (3, 11) else [], ''),
    
            ({'return': 'typing.Tuple[int, str]'},
             ['Tuple' if sys.version_info[:2] == (3, 6) else 'tuple'], ''),
            ({'return': 'typing.Tuple[int, str]'}, ['int'], 'x()[0]'),
            ({'return': 'typing.Tuple[int, str]'}, ['str'], 'x()[1]'),
            ({'return': 'typing.Tuple[int, str]'}, [], 'x()[2]'),
    
            ({'return': 'typing.List'}, ['list'], 'list'),
            ({'return': 'typing.List[int]'}, ['list'], 'list'),
            ({'return': 'typing.List[int]'}, ['int'], 'x()[0]'),
            ({'return': 'typing.List[int, str]'}, [], 'x()[0]'),
    
            ({'return': 'typing.Iterator[int]'}, [], 'x()[0]'),
            ({'return': 'typing.Iterator[int]'}, ['int'], 'next(x())'),
            ({'return': 'typing.Iterable[float]'}, ['float'], 'list(x())[0]'),
    
            ({'return': 'decimal.Decimal'}, [], ''),
            ({'return': 'lalalalallalaa'}, [], ''),
            ({'return': 'lalalalallalaa.lala'}, [], ''),
        ]
    )
    def test_string_annotation(annotations, result, code):
        x = lambda foo: 1  # noqa: E731
        x.__annotations__ = annotations
        defs = jedi.Interpreter(code or 'x()', [locals()]).infer()
>       assert [d.name for d in defs] == result
E       AssertionError: assert [] == ['NoneType', 'str']
E         
E         Right contains 2 more items, first extra item: 'NoneType'
E         Use -v to get more diff


https://docs.python.org/3.14/whatsnew/3.14.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14-b1/fedora-rawhide-x86_64/09093315-python-jedi/

For all our attempts to build python-jedi with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14-b1/package/python-jedi/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.14:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14-b1/

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.


Note You need to log in before you can comment on or make changes to this bug.