Bug 2368972

Summary: python-jedi fails to build with Python 3.14: test_string_annotation: AssertionError: assert [] == ['int', 'str'] etc.
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-jediAssignee: Lumír Balhar <lbalhar>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: carl, epel-packagers-sig, gui1ty, ksurma, lbalhar, mhroncok, phracek, python-packagers-sig, rcallicotte, romain.geissler
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2322407    

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.