Bug 2233416 - python-sphinx-notfound-page FTBFS with Sphinx 7.1+ in Fedora Rawhide (F40)
Summary: python-sphinx-notfound-page FTBFS with Sphinx 7.1+ in Fedora Rawhide (F40)
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-sphinx-notfound-page
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kevin Fenzi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2249216 (view as bug list)
Depends On:
Blocks: 2225274 2232469
TreeView+ depends on / blocked
 
Reported: 2023-08-22 07:57 UTC by Karolina Surma
Modified: 2023-11-11 19:59 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-11-11 19:59:26 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2023-08-22 07:57:18 UTC
13 tests fail with Sphinx 7.1.2 which I want to include in Fedora Rawhide soon.

The issue: 
Sphinx has added checksum of some files to the html output. Tests, which rely on the equality of the html files, fail.


The example test output:
_____________________ test_toctree_urls_notfound_default ______________________

app = <SphinxTestApp buildername='html'>
status = <_io.StringIO object at 0x7fe804c14b80>
warning = <_io.StringIO object at 0x7fe804c15c00>

    @pytest.mark.sphinx(
        srcdir=srcdir,
        confoverrides={
            'notfound_default_version': 'default',
            'notfound_default_language': 'ja',
        },
    )
    def test_toctree_urls_notfound_default(app, status, warning):
        app.build()
        path = app.outdir / '404.html'
        assert path.exists()
    
        content = open(path).read()
    
        chunks = [
            # sidebar URLs
            '<form class="search" action="/ja/default/search.html" method="get">',
            '<li class="toctree-l1"><a class="reference internal" href="/ja/default/chapter.html">Chapter</a></li>',
    
            # resources
            _get_css_html_link_tag('ja', 'default', 'alabaster.css'),
            _get_css_html_link_tag('ja', 'default', 'pygments.css'),
            '<link rel="stylesheet" href="/ja/default/_static/custom.css" type="text/css" />',
        ]
    
        for chunk in chunks:
>           assert chunk in content
E           assert '<link rel="stylesheet" type="text/css" href="/ja/default/_static/alabaster.css" />' in '<!DOCTYPE html>\n\n<html lang="en">\n  <head>\n    <meta charset="utf-8" />\n    <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n    <title>Page not found &#8212; Python  documentation</title>\n    <link rel="stylesheet" type="text/css" href="/ja/default/_static/pygments.css?v=b3523f8e" />\n    <link rel="stylesheet" type="text/css" href="/ja/default/_static/alabaster.css?v=cb25574f" />\n    <script data-url_root="#" id="documentation_options" src="/ja/default/_static/documentation_options.js?v=b3ba4146"></script>\n    <script src="/ja/default/_static/doctools.js?v=888ff710"></script>\n    <script src="/ja/default/_static/sphinx_highlight.js?v=4825356b"></script>\n    <link rel="index" title="Index" href="/ja/default/genindex.html" />\n    <link rel="search" title="Search" href="/ja/default/search.html" />\n   \n  <link rel="stylesheet" href="/ja/default/_static/custom.css" type="text/css" />\n  \n  \n  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />\n\n  </head><body>\n  \n\n    <div class="document">\n      <div class="documentwrapper">\n        <div class="bodywrapper">\n          \n\n          <div class="...nternal" href="/ja/default/chapter.html">Chapter</a></li>\n<li class="toctree-l1"><a class="reference internal" href="/ja/default/chapter-i.html">Chapter I</a></li>\n</ul>\n\n<div class="relations">\n<h3>Related Topics</h3>\n<ul>\n  <li><a href="/ja/default/index.html">Documentation overview</a><ul>\n  </ul></li>\n</ul>\n</div>\n<div id="searchbox" style="display: none" role="search">\n  <h3 id="searchlabel">Quick search</h3>\n    <div class="searchformwrapper">\n    <form class="search" action="/ja/default/search.html" method="get">\n      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>\n      <input type="submit" value="Go" />\n    </form>\n    </div>\n</div>\n<script>document.getElementById(\'searchbox\').style.display = "block"</script>\n\n\n\n\n\n\n\n\n        </div>\n      </div>\n      <div class="clearer"></div>\n    </div>\n    <div class="footer">\n      &copy;.\n      \n      |\n      Powered by <a href="http://sphinx-doc.org/">Sphinx 7.1.2</a>\n      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>\n      \n    </div>\n\n    \n\n    \n  </body>\n</html>'

Reproducible: Always

Steps to Reproduce:
Tip - if you want to test locally copr repository then:

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



There have been attempts to mitigate this in the other Sphinx-related projects, eg. https://github.com/sphinx-contrib/jquery/pull/26

Comment 1 Kevin Fenzi 2023-10-03 01:01:44 UTC
1.0.0 is out... needs moving to pyproject, I'll try and do so, unless someone beats me to it.

Comment 2 Kevin Fenzi 2023-10-12 21:21:05 UTC
So, I looked at 1.0.0, and got it building, but it has a new dep for tests... 

https://src.fedoraproject.org/rpms/python-sphinx-notfound-page/pull-request/5

is the PR with tests disabled. Does this work for you? 

I realize that I don't have much interest in this package anymore these days, I only packaged it because ansible was using it with docs, but we aren't shipping those anymore, so...

Comment 3 Karolina Surma 2023-10-23 16:08:07 UTC
Hi, thank you, that should work - except I don't like the disabled tests that much and have proposed a solution in the PR.

I myself have no use for this package, but there are still some of its direct consumers in Fedora:
$ repoquery -q --repo=rawhide{,-source} --whatrequires python3-sphinx-notfound-page             
PDAL-0:2.6.0-3.fc40.src
python-scrapy-0:2.10.1-1.fc40.src
python-service-identity-0:23.1.0-3.fc39.src

Comment 4 Karolina Surma 2023-10-30 09:02:46 UTC
With Sphinx 7.2.6 there's another issue that will be mitigated by the update to 1.0.0:

+ make -C docs html
make: Entering directory '/builddir/build/BUILD/scrapy-2.10.1/docs'
mkdir -p build/html build/doctrees
sphinx-build -b html -d build/doctrees -D latex_elements.papersize=  . build/html 
Running Sphinx v7.2.6

Exception occurred:
  File "/usr/lib/python3.12/site-packages/notfound/extension.py", line 315, in setup
    from sphinx.builders.html import setup_js_tag_helper
ImportError: cannot import name 'setup_js_tag_helper' from 'sphinx.builders.html' (/usr/lib/python3.12/site-packages/sphinx/builders/html/__init__.py)

Comment 5 Kevin Fenzi 2023-11-11 19:44:29 UTC
*** Bug 2249216 has been marked as a duplicate of this bug. ***

Comment 6 Kevin Fenzi 2023-11-11 19:59:26 UTC
1.0.0 is in rawhide now.


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