Bug 1981556 - python-sphinx %check fails with Python 3.10.0b4+: Enum changes were reverted in Python 3.10
Summary: python-sphinx %check fails with Python 3.10.0b4+: Enum changes were reverted ...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: python-sphinx
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karolina Surma
QA Contact: Fedora Extras Quality Assurance
URL: https://koschei.fedoraproject.org/pac...
Whiteboard:
Depends On:
Blocks: PYTHON3.10 F35FTBFS
TreeView+ depends on / blocked
 
Reported: 2021-07-12 19:40 UTC by Miro Hrončok
Modified: 2021-07-26 07:38 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-07-26 07:38:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github sphinx-doc sphinx pull 9443 0 None open Fix test_enum_class with Python 3.10-beta4 2021-07-13 07:43:58 UTC

Description Miro Hrončok 2021-07-12 19:40:26 UTC
Description of problem:
Package python-sphinx fails to build from source in Fedora rawhide after we upgraded to Python 3.10.0b4+.

=================================== FAILURES ===================================
_______________________________ test_enum_class ________________________________
app = <SphinxTestApp buildername='html'>
    @pytest.mark.sphinx('html', testroot='ext-autodoc')
    def test_enum_class(app):
        options = {"members": None}
        actual = do_autodoc(app, 'class', 'target.enums.EnumCls', options)
    
        if sys.version_info < (3, 10):
            sig = '(value)'
        else:
            sig = ('(value, names=None, *, module=None, qualname=None, type=None, start=1, '
                   'boundary=None)')
    
>       assert list(actual) == [
            '',
            '.. py:class:: EnumCls%s' % sig,
            '   :module: target.enums',
            '',
            '   this is enum class',
            '',
            '',
            '   .. py:method:: EnumCls.say_goodbye()',
            '      :module: target.enums',
            '      :classmethod:',
            '',
            '      a classmethod says good-bye to you.',
            '',
            '',
            '   .. py:method:: EnumCls.say_hello()',
            '      :module: target.enums',
            '',
            '      a method says hello to you.',
            '',
            '',
            '   .. py:attribute:: EnumCls.val1',
            '      :module: target.enums',
            '      :value: 12',
            '',
            '      doc for val1',
            '',
            '',
            '   .. py:attribute:: EnumCls.val2',
            '      :module: target.enums',
            '      :value: 23',
            '',
            '      doc for val2',
            '',
            '',
            '   .. py:attribute:: EnumCls.val3',
            '      :module: target.enums',
            '      :value: 34',
            '',
            '      doc for val3',
            '',
        ]
E       AssertionError: assert ['', '.. py:c...ass', '', ...] == ['', '.. py:c...ass', '', ...]
E         At index 1 diff: '.. py:class:: EnumCls(value)' != '.. py:class:: EnumCls(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)'
E         Use -v to get the full diff
tests/test_ext_autodoc.py:1380: AssertionError

Version-Release number of selected component (if applicable):
4.0.2-3.fc35

Steps to Reproduce:
fedpkg build

Additional info:
This package is tracked by Koschei. See:
https://koschei.fedoraproject.org/package/python-sphinx

This is caused by a revert of enum changes in Python 3.10.0b4. The code seems to have a if sys.version_info < (3, 10) conditional and we just need to adapt that.

Context: https://mail.python.org/archives/list/python-dev@python.org/message/LSTMFAPSPD3BGZ4D6HQFODXZVB3PLYKF/

Comment 1 Karolina Surma 2021-07-13 07:44:01 UTC
The proposed solution solves FTBFS (https://copr.fedorainfracloud.org/coprs/ksurma/sphinx-4.1.0/build/2326945/), so I've opened an issue and sent PR upstream.

Comment 2 Karolina Surma 2021-07-26 07:38:15 UTC
The fix will be included in Sphinx 4.1.2.


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