Bug 2221984

Summary: python-sphinxcontrib-bibtex fails to build with Sphinx 7.x
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-sphinxcontrib-bibtexAssignee: Jerry James <loganjerry>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: loganjerry
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-sphinxcontrib-bibtex-2.5.0-4.fc39 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-11 19:12:54 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: 2188968    

Description Karolina Surma 2023-07-11 12:17:56 UTC
python-sphinxcontrib-bibtex fails to build with Sphinx 7.x in Fedora 39 (currently Rawhide).

The issue detected - 3 tests fail.

=================================== FAILURES ===================================
_________________________________ test_autodoc _________________________________

app = <SphinxTestApp buildername='html'>
warning = <_io.StringIO object at 0x7fd9ca443b80>

    @pytest.mark.sphinx('html', testroot='autodoc')
    def test_autodoc(app, warning) -> None:
        app.build()
        assert not warning.getvalue()
        output = (app.outdir / "doc_cite.html").read_text()
        labels = ['One', 'Two', 'Thr', 'Fou', 'Fiv', 'Six', 'Sev', 'Eig', 'Nin',
                  'Ten', 'Ele']
        titles = ['Een', 'Twee', 'Drie', 'Vier', 'Vijf', 'Zes', 'Zeven', 'Acht',
                  'Negen', 'Tien', 'Elf']
        for label, title in zip(labels, titles):
            assert len(html_citation_refs_single(label=label).findall(output)) == 1
            assert len(html_citations(label=label).findall(output)) == 1
            match_ref = html_citation_refs_single(label=label).search(output)
            match = html_citations(label=label).search(output)
            assert match_ref
            assert match
            assert match_ref.group('refid') == match.group('id_')
            assert title in match.group('text')
            assert match_ref.group('id_') == match.group('backref')
        output2 = (app.outdir / "doc_footcite.html").read_text()
        assert len(html_footnote_refs().findall(output2)) == 11
        for title in titles:
            text = ".*" + title + ".*"
>           assert len(html_footnotes(text=text).findall(output2)) == 1
E           assert 0 == 1
E            +  where 0 = len([])
E            +    where [] = <built-in method findall of re.Pattern object at 0x55bdbab21d40>('<!DOCTYPE html>\n\n<html lang="en">\n  <head>\n    <meta charset="utf-8" />\n    <meta name="viewport" content="width...ources/doc_footcite.rst.txt"\n          rel="nofollow">Page source</a>\n    </div>\n\n    \n\n    \n  </body>\n</html>')
E            +      where <built-in method findall of re.Pattern object at 0x55bdbab21d40> = re.compile('<aside class="footnote brackets" id="(?P<id_>[a-z][-?a-z0-9]*)" role="note">\\s*<span class="label"><span class="fn-bracket">\\[</span>(?:<a role="doc-backlink" href="#(?P<backref>[a-z][-?a-z0-9]*)">).findall
E            +        where re.compile('<aside class="footnote brackets" id="(?P<id_>[a-z][-?a-z0-9]*)" role="note">\\s*<span class="label"><span class="fn-bracket">\\[</span>(?:<a role="doc-backlink" href="#(?P<backref>[a-z][-?a-z0-9]*)">) = html_footnotes(text='.*Een.*')

test/test_autodoc.py:48: AssertionError


_________________________ test_bibliography_multi_foot _________________________

app = <SphinxTestApp buildername='html'>
warning = <_io.StringIO object at 0x7fd9c9181840>

    @pytest.mark.sphinx('html', testroot='bibliography_multi_foot')
    def test_bibliography_multi_foot(app, warning) -> None:
        app.build()
        assert not warning.getvalue()
        output = (app.outdir / "index.html").read_text(encoding='utf-8')
        assert output.count('<p class="rubric"') == 3
>       assert len(re.findall(
            html_footnotes(id_="footcite-2009-mandel"), output)) == 1
E       assert 0 == 1
E        +  where 0 = len([])
E        +    where [] = <function findall at 0x7fd9cc221760>(re.compile('<aside class="footnote brackets" id="(?P<id_>footcite-2009-mandel)" role="note">\\s*<span class="label"><span class="fn-bracket">\\[</span>(?:<a role="doc-backlink" href="#(?P<backref>[a-z][-?a-z0-9]), '<!DOCTYPE html>\n\n<html lang="en">\n  <head>\n    <meta charset="utf-8" />\n    <meta name="viewport" content="width...ref="_sources/index.rst.txt"\n          rel="nofollow">Page source</a>\n    </div>\n\n    \n\n    \n  </body>\n</html>')
E        +      where <function findall at 0x7fd9cc221760> = re.findall
E        +      and   re.compile('<aside class="footnote brackets" id="(?P<id_>footcite-2009-mandel)" role="note">\\s*<span class="label"><span class="fn-bracket">\\[</span>(?:<a role="doc-backlink" href="#(?P<backref>[a-z][-?a-z0-9]) = html_footnotes(id_='footcite-2009-mandel')


_________________________ test_bibliography_custom_ids _________________________

app = <SphinxTestApp buildername='html'>
warning = <_io.StringIO object at 0x7fd9c9181b40>

    @pytest.mark.sphinx('html', testroot='bibliography_custom_ids')
    def test_bibliography_custom_ids(app, warning) -> None:
        app.build()
        assert not warning.getvalue()
        output = (app.outdir / "index.html").read_text(encoding='utf-8')
        assert ' id="bibliography-id-1"' in output
        assert ' id="bibliography-id-2"' in output
        assert ' id="footbibliography-id-1"' in output
        assert ' id="footbibliography-id-2"' in output
        match1 = html_citations(text='.*Evensen.*').search(output)
        match2 = html_citations(text='.*Mandel.*').search(output)
        match3 = html_citations(text='.*Lorenc.*').search(output)
        assert match1 is not None
        assert match2 is not None
        assert match3 is not None
        assert match1.group('id_') == 'cite-id-1-2003-evensen'
        assert match2.group('id_') == 'cite-id-1-2009-mandel'
        assert match3.group('id_') == 'cite-id-2-1986-lorenc'
        match1 = html_footnotes(text='.*Evensen.*').search(output)
        match2 = html_footnotes(text='.*Mandel.*').search(output)
        match3 = html_footnotes(text='.*Lorenc.*').search(output)
>       assert match1 is not None
E       assert None is not None

=========================== short test summary info ============================
FAILED test/test_autodoc.py::test_autodoc - assert 0 == 1
FAILED test/test_bibliography.py::test_bibliography_multi_foot - assert 0 == 1
FAILED test/test_bibliography.py::test_bibliography_custom_ids - assert None ...
========== 3 failed, 86 passed, 3 deselected, 671 warnings in 17.08s ===========


For the logs from testing build attempts, see:
https://copr.fedorainfracloud.org/coprs/ksurma/doc-stack/package/python-sphinxcontrib-bibtex/

You can test you package in mock running:

$ mock -r fedora-rawhide-x86_64 --addrepo=https://download.copr.fedorainfracloud.org/results/ksurma/doc-stack/fedora-rawhide-x86_64/ --no-clean your.src.rpm
$ mock -r fedora-rawhide-x86_64 --addrepo=https://download.copr.fedorainfracloud.org/results/ksurma/doc-stack/fedora-rawhide-x86_64/ shell

We'd like to include Sphinx 7 in Fedora 39.
Let us know here if you have any questions. Thank you!

Comment 1 Fedora Update System 2023-07-11 19:10:59 UTC
FEDORA-2023-492ecd9187 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-492ecd9187

Comment 2 Fedora Update System 2023-07-11 19:12:54 UTC
FEDORA-2023-492ecd9187 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.