Bug 2251948 - python-sphinx fails to build: AssertionError: assert ' list of weak references to the object (if defined)' in StringList(['', '.. py:class:: CustomIter()', ' :module: target', '', '', ' .. py:method:: CustomIter.__init__()',... 0
Summary: python-sphinx fails to build: AssertionError: assert ' list of weak refe...
Keywords:
Status: CLOSED RAWHIDE
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:
Whiteboard:
Depends On:
Blocks: F40FTBFS PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2023-11-28 15:14 UTC by Karolina Surma
Modified: 2023-12-12 15:03 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-12-12 15:03:42 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2023-11-28 15:14:45 UTC
python-sphinx fails to build with Python 3.13.0a2.

Reported upstream: https://github.com/sphinx-doc/sphinx/issues/11775
The change will eventually get to Python 3.11, 3.12 and 3.13.
We'll have to patch Sphinx all current Fedoras.


=================================== FAILURES ===================================
_________________________ test_autodoc_default_options _________________________

app = <SphinxTestApp buildername='html'>

    @pytest.mark.sphinx('html', testroot='ext-autodoc')
    def test_autodoc_default_options(app):
        # no settings
        actual = do_autodoc(app, 'class', 'target.enums.EnumCls')
        assert '   .. py:attribute:: EnumCls.val1' not in actual
        assert '   .. py:attribute:: EnumCls.val4' not in actual
        actual = do_autodoc(app, 'class', 'target.CustomIter')
        assert '   .. py:method:: target.CustomIter' not in actual
        actual = do_autodoc(app, 'module', 'target')
        assert '.. py:function:: function_to_be_imported(app)' not in actual
    
        # with :members:
        app.config.autodoc_default_options = {'members': None}
        actual = do_autodoc(app, 'class', 'target.enums.EnumCls')
        assert '   .. py:attribute:: EnumCls.val1' in actual
        assert '   .. py:attribute:: EnumCls.val4' not in actual
    
        # with :members: = True
        app.config.autodoc_default_options = {'members': None}
        actual = do_autodoc(app, 'class', 'target.enums.EnumCls')
        assert '   .. py:attribute:: EnumCls.val1' in actual
        assert '   .. py:attribute:: EnumCls.val4' not in actual
    
        # with :members: and :undoc-members:
        app.config.autodoc_default_options = {
            'members': None,
            'undoc-members': None,
        }
        actual = do_autodoc(app, 'class', 'target.enums.EnumCls')
        assert '   .. py:attribute:: EnumCls.val1' in actual
        assert '   .. py:attribute:: EnumCls.val4' in actual
    
        # with :special-members:
        # Note that :members: must be *on* for :special-members: to work.
        app.config.autodoc_default_options = {
            'members': None,
            'special-members': None,
        }
        actual = do_autodoc(app, 'class', 'target.CustomIter')
        assert '   .. py:method:: CustomIter.__init__()' in actual
        assert '      Create a new `CustomIter`.' in actual
        assert '   .. py:method:: CustomIter.__iter__()' in actual
        assert '      Iterate squares of each value.' in actual
        if not IS_PYPY:
            assert '   .. py:attribute:: CustomIter.__weakref__' in actual
>           assert '      list of weak references to the object (if defined)' in actual
E           AssertionError: assert '      list of weak references to the object (if defined)' in StringList(['', '.. py:class:: CustomIter()', '   :module: target', '', '', '   .. py:method:: CustomIter.__init__()',... 0), ('/tmp/pytest-of-mockbuild/pytest-0/ext-autodoc/target/__init__.py:docstring of target.CustomIter.snafucate', 1)])

tests/test_ext_autodoc_configs.py:1630: AssertionError
--------------------------- Captured stdout teardown ---------------------------
# testroot: root
# builder: html
# srcdir: /tmp/pytest-of-mockbuild/pytest-0/ext-autodoc
# outdir: /tmp/pytest-of-mockbuild/pytest-0/ext-autodoc/_build/html
# status: 
Running Sphinx v7.2.6
loading pickled environment... done

# warning: 

=========================== short test summary info ============================
FAILED tests/test_ext_autodoc_configs.py::test_autodoc_default_options - Asse...

https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06692253-python-sphinx/

For all our attempts to build python-sphinx with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-sphinx/

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.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
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 2023-12-12 11:30:32 UTC
3.12.1 happened and this now indeed fails in rawhide as well: https://koschei.fedoraproject.org/package/python-sphinx?collection=f40


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