Bug 1898083 - python-funcsigs fails to build with Python 3.10: README doctests and test_inspect fail, reprs changed
Summary: python-funcsigs fails to build with Python 3.10: README doctests and test_ins...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-funcsigs
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Haïkel Guémar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2020-11-16 10:41 UTC by Miro Hrončok
Modified: 2021-02-09 16:23 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: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.


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