Bug 1898083

Summary: python-funcsigs fails to build with Python 3.10: README doctests and test_inspect fail, reprs changed
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-funcsigsAssignee: Haïkel Guémar <karlthered>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: karlthered, mhroncok, rbean, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-06-14 10:37:29 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-16 10:41:46 UTC
python-funcsigs fails to build with Python 3.10.0a2.

This is 

**********************************************************************
File "/builddir/build/BUILD/funcsigs-1.0.2/tests/../README.rst", line 58, in README.rst
Failed example:
    sig
Expected:
    <funcsigs.Signature object at 0x...>
Got:
    <funcsigs.Signature object at 0x7f8cdabdaa00>
**********************************************************************
File "/builddir/build/BUILD/funcsigs-1.0.2/tests/../README.rst", line 60, in README.rst
Failed example:
    sig.parameters
Expected:
    OrderedDict([('a', <Parameter at 0x... 'a'>), ('b', <Parameter at 0x... 'b'>), ('args', <Parameter at 0x... 'args'>), ('kwargs', <Parameter at 0x... 'kwargs'>)])
Got:
    mappingproxy(OrderedDict([('a', <Parameter at 0x7f8cdabe0bd0 'a'>), ('b', <Parameter at 0x7f8cdabe4ae0 'b'>), ('args', <Parameter at 0x7f8cdabe4a90 'args'>), ('kwargs', <Parameter at 0x7f8cdabe4b30 'kwargs'>)]))
**********************************************************************
File "/builddir/build/BUILD/funcsigs-1.0.2/tests/../README.rst", line 87, in README.rst
Failed example:
    str(sig)
Expected:
    '(a, *, b:int, **kwargs)'
Got:
    "(a, *, b:'int', **kwargs)"
**********************************************************************
File "/builddir/build/BUILD/funcsigs-1.0.2/tests/../README.rst", line 90, in README.rst
Failed example:
    str(sig.parameters['b'])
Expected:
    'b:int'
Got:
    "b:'int'"
**********************************************************************
File "/builddir/build/BUILD/funcsigs-1.0.2/tests/../README.rst", line 93, in README.rst
Failed example:
    sig.parameters['b'].annotation
Expected:
    <class 'int'>
Got:
    'int'
**********************************************************************
1 items had failures:
   5 of  30 in README.rst


Also:

+ /usr/bin/python3 -m unittest tests.test_inspect
...........................F..F..F.FFFF..
======================================================================
FAIL: test_signature_on_complex_args (tests.test_inspect.TestSignatureObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "<string>", line 5, in test_signature_on_complex_args
AssertionError: Tuples differ: ((('a[54 chars] 10, "'foo'", 'positional_or_keyword'), ('args[175 chars]psis) != ((('a[54 chars] 10, 'foo', 'positional_or_keyword'), ('args',[177 chars]psis)

First differing element 0:
(('a'[53 chars] 10, "'foo'", 'positional_or_keyword'), ('args[164 chars]rd'))
(('a'[53 chars] 10, 'foo', 'positional_or_keyword'), ('args',[166 chars]rd'))

  ((('a', Ellipsis, Ellipsis, 'positional_or_keyword'),
-   ('b', 10, "'foo'", 'positional_or_keyword'),
?             -     -

+   ('b', 10, 'foo', 'positional_or_keyword'),
-   ('args', Ellipsis, "'bar'", 'var_positional'),
?                      -     -

+   ('args', Ellipsis, 'bar', 'var_positional'),
-   ('spam', Ellipsis, "'baz'", 'keyword_only'),
?                      -     -

+   ('spam', Ellipsis, 'baz', 'keyword_only'),
    ('ham', 123, Ellipsis, 'keyword_only'),
-   ('kwargs', Ellipsis, 'int', 'var_keyword')),
+   ('kwargs', Ellipsis, <class 'int'>, 'var_keyword')),
?                        +++++++     +

   Ellipsis)

======================================================================
FAIL: test_signature_on_method (tests.test_inspect.TestSignatureObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "<string>", line 9, in test_signature_on_method
AssertionError: Tuples differ: ((('a[52 chars]('arg2', 1, Ellipsis, 'positional_or_keyword')), 'int') != ((('a[52 chars]('arg2', 1, Ellipsis, 'positional_or_keyword')), <class 'int'>)

First differing element 1:
'int'
<class 'int'>

  ((('arg1', Ellipsis, Ellipsis, 'positional_or_keyword'),
    ('arg2', 1, Ellipsis, 'positional_or_keyword')),
-  'int')
+  <class 'int'>)

======================================================================
FAIL: test_signature_on_partial (tests.test_inspect.TestSignatureObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "<string>", line 98, in test_signature_on_partial
AssertionError: Tuples differ: ((('b[47 chars], ('c', Ellipsis, 'int', 'positional_or_keyword')), '42') != ((('b[47 chars], ('c', Ellipsis, <class 'int'>, 'positional_or_keyword')), 42)

First differing element 0:
(('b'[41 chars]ord'), ('c', Ellipsis, 'int', 'positional_or_keyword'))
(('b'[41 chars]ord'), ('c', Ellipsis, <class 'int'>, 'positional_or_keyword'))

  ((('b', Ellipsis, Ellipsis, 'positional_or_keyword'),
-   ('c', Ellipsis, 'int', 'positional_or_keyword')),
+   ('c', Ellipsis, <class 'int'>, 'positional_or_keyword')),
?                   +++++++     +

-  '42')
?  -  -

+  42)

======================================================================
FAIL: test_signature_on_wargs (tests.test_inspect.TestSignatureObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "<string>", line 5, in test_signature_on_wargs
AssertionError: Tuples differ: ((('a[44 chars]d'), ('b', Ellipsis, "'foo'", 'positional_or_keyword')), '123') != ((('a[44 chars]d'), ('b', Ellipsis, 'foo', 'positional_or_keyword')), 123)

First differing element 0:
(('a'[35 chars]r_keyword'), ('b', Ellipsis, "'foo'", 'positional_or_keyword'))
(('a'[35 chars]r_keyword'), ('b', Ellipsis, 'foo', 'positional_or_keyword'))

  ((('a', Ellipsis, Ellipsis, 'positional_or_keyword'),
-   ('b', Ellipsis, "'foo'", 'positional_or_keyword')),
?                   -     -

+   ('b', Ellipsis, 'foo', 'positional_or_keyword')),
-  '123')
?  -   -

+  123)

======================================================================
FAIL: test_signature_on_wkwonly (tests.test_inspect.TestSignatureObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "<string>", line 5, in test_signature_on_wkwonly
AssertionError: Tuples differ: ((('a', Ellipsis, 'float', 'keyword_only'), ('b', Ellipsis,[27 chars]int') != ((('a', Ellipsis, <class 'float'>, 'keyword_only'), ('b', E[51 chars]nt'>)

First differing element 0:
(('a', Ellipsis, 'float', 'keyword_only'), ('b', Ellipsis,[19 chars]ly'))
(('a', Ellipsis, <class 'float'>, 'keyword_only'), ('b', E[35 chars]ly'))

- ((('a', Ellipsis, 'float', 'keyword_only'),
+ ((('a', Ellipsis, <class 'float'>, 'keyword_only'),
?                   +++++++       +

-   ('b', Ellipsis, 'str', 'keyword_only')),
+   ('b', Ellipsis, <class 'str'>, 'keyword_only')),
?                   +++++++     +

-  'int')
+  <class 'int'>)

======================================================================
FAIL: test_signature_replace_anno (tests.test_inspect.TestSignatureObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "<string>", line 13, in test_signature_replace_anno
AssertionError: <funcsigs.Signature object at 0x7f8560908a60> != <funcsigs.Signature object at 0x7f8560908310>

======================================================================
FAIL: test_signature_str (tests.test_inspect.TestSignatureObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "<string>", line 5, in test_signature_str
AssertionError: "(a:'int'=1, *, b, c=None, **kwargs) -> '42'" != '(a:int=1, *, b, c=None, **kwargs) -> 42'
- (a:'int'=1, *, b, c=None, **kwargs) -> '42'
?    -   -                               -  -
+ (a:int=1, *, b, c=None, **kwargs) -> 42


----------------------------------------------------------------------
Ran 41 tests in 0.019s

FAILED (failures=7)



This all seem like problems in different object reprs.


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

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

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 Ben Cotton 2021-02-09 15:24:48 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 2 Miro Hrončok 2021-06-04 20:14:04 UTC
This is a mass-posted update. Sorry if it is not 100% accurate to this bugzilla.


The Python 3.10 rebuild is in progress in a Koji side tag. If you manage to fix the problem, please commit the fix in the rawhide branch, but don't build the package in regular rawhide.

You can either build the package in the side tag, with:

    $ fedpkg build --target=f35-python

Or you can the build and we will eventually build it for you.

Note that the rebuild is still in progress, so not all (build) dependencies of this package might be available right away.

Thanks.

See also https://fedoraproject.org/wiki/Changes/Python3.10

If you have general questions about the rebuild, please use this mailing list thread: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/G47SGOYIQLRDTWGOSLSWERZSSHXDEDH5/

Comment 3 Miro Hrončok 2021-06-07 22:58:45 UTC
The f35-python side tag has been merged to Rawhide. From now on, build as you would normally build.

Comment 4 Miro Hrončok 2021-06-14 10:37:29 UTC
This package was successfully rebuilt with Python 3.10.

If you need this bugzilla open for tracking purposes, sorry for the automatic closing: feel free to reopen it.