Bug 1898081 - python-jedi fails to build with Python 3.10: three tests fail
Summary: python-jedi fails to build with Python 3.10: three tests fail
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: python-jedi
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Lumír Balhar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2020-11-16 10:38 UTC by Miro Hrončok
Modified: 2021-02-09 16:22 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)

Description Miro Hrončok 2020-11-16 10:38:41 UTC
python-jedi fails to build with Python 3.10.0a2.

________________________ test_find_system_environments _________________________

    def test_find_system_environments():
        envs = list(find_system_environments())
>       assert len(envs)
E       assert 0
E        +  where 0 = len([])

test/test_api/test_environment.py:19: AssertionError
______________________ test_completion_param_annotations _______________________

    def test_completion_param_annotations():
        # Need to define this function not directly in Python. Otherwise Jedi is too
        # clever and uses the Python code instead of the signature object.
        code = 'def foo(a: 1, b: str, c: int = 1.0) -> bytes: pass'
        exec(code, locals())
        script = jedi.Interpreter('foo', [locals()])
        c, = script.complete()
        sig, = c.get_signatures()
        a, b, c = sig.params
        assert a.infer() == []
>       assert [d.name for d in b.infer()] == ['str']
E       AssertionError: assert [] == ['str']
E         Right contains one more item: 'str'
E         Use -v to get the full diff

test/test_api/test_interpreter.py:316: AssertionError
__________________ test_compiled_signature_annotation_string ___________________

    def test_compiled_signature_annotation_string():
        import typing
    
        def func(x: typing.Type, y: typing.Union[typing.Type, int]):
            pass
        func.__name__ = 'not_func'
    
        s, = jedi.Interpreter('func()', [locals()]).get_signatures(1, 5)
>       assert s.params[0].description == 'param x: Type'
E       assert "param x: 'typing.Type'" == 'param x: Type'
E         - param x: Type
E         + param x: 'typing.Type'

test/test_inference/test_mixed.py:113: AssertionError
===== 3 failed, 1451 passed, 20 skipped, 2 deselected, 5 xfailed in 42.38s =====





I understand the third failure: typing names/repor have been changed in Python 3.10.

For the first two failures, I have no clue.



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

For all our attempts to build python-jedi with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/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.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
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.

Comment 1 Miro Hrončok 2020-11-18 11:14:55 UTC
Latest upstream commit behaves the same. Bumping the severity here, an entire stack ipython stack depends on it.

Comment 2 Miro Hrončok 2020-12-11 14:45:27 UTC
Petr, could you please take this upstream?

Comment 3 Lumír Balhar 2021-01-12 09:45:05 UTC
Upstream issue created: https://github.com/davidhalter/jedi/issues/1732

Unfortunately, it seems that the fix will be much more complex than just adapting tests to new outputs.

Comment 4 Ben Cotton 2021-02-09 16:11:56 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.


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