Bug 1901141

Summary: ipython fails to build with Python 3.10: IPython.core.tests.test_oinspect.test_render_signature_long fails
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: ipythonAssignee: Lumír Balhar <lbalhar>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dcantrell, lbalhar, mhroncok, michel, mrunge, orion, python-sig, thrnciar, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipython-7.20.0-1.fc34 ipython-7.20.0-1.eln109 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-03 02:39:10 UTC 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: 1890881    

Description Miro Hrončok 2020-11-24 15:23:56 UTC
ipython fails to build with Python 3.10.0a2.

FAIL: IPython.core.tests.test_oinspect.test_render_signature_long
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/builddir/build/BUILDROOT/ipython-7.19.0-1.fc34.x86_64/usr/lib/python3.10/site-packages/IPython/core/tests/test_oinspect.py", line 423, in test_render_signature_long
    nt.assert_in(sig, [
AssertionError: "long_function(\n    a_really_long_parameter: 'int',\n    and_another_long_one: 'bool' = False,\n    let_us_make_sure_this_is_looong: 'Optional[str]' = None,\n) -> 'bool'" not found in ['long_function(\n    a_really_long_parameter: int,\n    and_another_long_one: bool = False,\n    let_us_make_sure_this_is_looong: Optional[str] = None,\n) -> bool', 'long_function(\n    a_really_long_parameter: int,\n    and_another_long_one: bool = False,\n    let_us_make_sure_this_is_looong: Union[str, NoneType] = None,\n) -> bool', 'long_function(\n    a_really_long_parameter:int,\n    and_another_long_one:bool=False,\n    let_us_make_sure_this_is_looong:Union[str, NoneType]=None,\n) -> bool']
    """Fail immediately, with the given message."""
>>  raise self.failureException('"long_function(\\n    a_really_long_parameter: \'int\',\\n    and_another_long_one: \'bool\' = False,\\n    let_us_make_sure_this_is_looong: \'Optional[str]\' = None,\\n) -> \'bool\'" not found in [\'long_function(\\n    a_really_long_parameter: int,\\n    and_another_long_one: bool = False,\\n    let_us_make_sure_this_is_looong: Optional[str] = None,\\n) -> bool\', \'long_function(\\n    a_really_long_parameter: int,\\n    and_another_long_one: bool = False,\\n    let_us_make_sure_this_is_looong: Union[str, NoneType] = None,\\n) -> bool\', \'long_function(\\n    a_really_long_parameter:int,\\n    and_another_long_one:bool=False,\\n    let_us_make_sure_this_is_looong:Union[str, NoneType]=None,\\n) -> bool\']')

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

For all our attempts to build ipython with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/ipython/

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 Lumír Balhar 2020-12-08 12:52:54 UTC
Python 3.10a2:

>>> from IPython.core import oinspect
>>> from inspect import signature
>>> 
>>> def long_function(
...         a_really_long_parameter: int,
...         and_another_long_one: bool = False,
...         let_us_make_sure_this_is_looong: Optional[str] = None,
...     ) -> bool: pass
... 
>>> print(oinspect._render_signature(signature(long_function), long_function.__name__))
long_function(
    a_really_long_parameter: 'int',
    and_another_long_one: 'bool' = False,
    let_us_make_sure_this_is_looong: 'Optional[str]' = None,
) -> 'bool'

but Python 3.10a3 (from master branch compiled locally today):

>>> from IPython.core import oinspect
>>> from typing import Optional
>>> from inspect import signature
>>> def long_function(
...         a_really_long_parameter: int,
...         and_another_long_one: bool = False,
...         let_us_make_sure_this_is_looong: Optional[str] = None,
...     ) -> bool: pass
... 
>>> print(oinspect._render_signature(signature(long_function), long_function.__name__))
long_function(
    a_really_long_parameter: int,
    and_another_long_one: bool = False,
    let_us_make_sure_this_is_looong: Optional[str] = None,
) -> bool

See the '' around type annotations. The latter one looks like the testing option for Python 3.9 and higher so it should pass.

Could you please try it one more time when the latest release will be in COPR?

Comment 3 Fedora Update System 2021-02-03 02:39:10 UTC
FEDORA-2021-9aeb216830 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 4 Fedora Update System 2021-02-05 23:22:53 UTC
FEDORA-2021-467d41a8f8 has been pushed to the Fedora ELN stable repository.
If problem still persists, please make note of it in this bug report.