Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unblock Sphinx 5.0.0 #162

Closed
rikardn opened this issue May 30, 2022 · 4 comments · Fixed by #164
Closed

Unblock Sphinx 5.0.0 #162

rikardn opened this issue May 30, 2022 · 4 comments · Fixed by #164

Comments

@rikardn
Copy link

rikardn commented May 30, 2022

Context

Sphinx 5.0.0 was recently released, but because sphinx-tabs requires a version of Sphinx lower than 5 the latest Sphinx version cannot be used with sphinx-tabs.

Proposal

Let sphinx-tabs support the latest version of Sphinx

Tasks and updates

No response

@welcome
Copy link

welcome bot commented May 30, 2022

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@kloczek
Copy link
Contributor

kloczek commented Jun 7, 2022

After relaxing install_requires with patch

--- a/setup.py
+++ b/setup.py
@@ -25,7 +25,7 @@
     url="https://github.com/executablebooks/sphinx-tabs",
     license="MIT",
     python_requires="~=3.6",
-    install_requires=["sphinx>=2,<5", "pygments", "docutils~=0.17.0"],
+    install_requires=["sphinx>=4", "pygments", "docutils>=0.17.0"],
     extras_require={
         "testing": [
             "coverage",

pytest is failing on sphinx 5.0.1

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphinx-tabs-3.3.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinx-tabs-3.3.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra --deselect tests/test_build.py::test_rinohtype_pdf
==================================================================== test session starts =====================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/sphinx-tabs-3.3.1
plugins: datadir-1.3.1, regressions-2.3.1, cov-3.0.0
collected 15 items / 1 deselected / 14 selected

tests/test_build.py ..EEEFFFs.E...                                                                                                                     [100%]

=========================================================================== ERRORS ===========================================================================
______________________________________________________ ERROR at setup of test_conditional_assets[index] ______________________________________________________

app = <SphinxTestApp buildername='html'>, status = <_io.StringIO object at 0x7fe64a4ff1f0>, warning = <_io.StringIO object at 0x7fe64a4ff310>
check_build_success = <function check_build_success.<locals>.check at 0x7fe64a372700>
get_sphinx_app_doctree = <function get_sphinx_app_doctree.<locals>.read at 0x7fe64a372af0>
regress_sphinx_app_output = <function regress_sphinx_app_output.<locals>.read at 0x7fe64a372d30>
request = <SubRequest 'auto_build_and_check' for <Function test_conditional_assets[index]>>

    @pytest.fixture(autouse=True)
    def auto_build_and_check(
        app,
        status,
        warning,
        check_build_success,
        get_sphinx_app_doctree,
        regress_sphinx_app_output,
        request,
    ):
        """
        Build and check build success and output regressions.
        Currently all tests start with this.
        Disable using a `noautobuild` mark.
        """
        if "noautobuild" in request.keywords:
            return
        app.build()
        check_build_success(status, warning)
        get_sphinx_app_doctree(app, regress=True)
>       regress_sphinx_app_output(app)

tests/conftest.py:38:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

app = <SphinxTestApp buildername='html'>, buildername = 'html', filename = 'index.html', encoding = 'utf-8'

    def read(app, buildername="html", filename="index.html", encoding="utf-8"):
        content = get_sphinx_app_output(app, buildername, filename, encoding)

        if buildername == "html":
            soup = BeautifulSoup(content, "html.parser")

            # Remove output from ``pygments``, so that test only compares HTML of surrounding tabs
            for div in soup.find_all("div", {"class": "highlight"}):
                div.decompose()

            doc_div = soup.findAll("div", {"class": "documentwrapper"})[0]
            doc = doc_div.prettify()

        else:
            doc = content
>       file_regression.check(
            doc, extension="." + filename.split(".")[-1], encoding="utf8"
        )
E       AssertionError: FILES DIFFER:
E       /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_index_0/test_build/test_conditional_assets_index_.html
E       /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_index_0/test_build/test_conditional_assets_index_.obtained.html
E       HTML DIFF: /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_index_0/test_build/test_conditional_assets_index_.obtained.diff.html
E       ---
E       +++
E       @@ -18,7 +18,7 @@
E           <section id="fruits">
E            <h1>
E             Fruits
E       -     <a class="headerlink" href="#fruits" title="Permalink to this headline">
E       +     <a class="headerlink" href="#fruits" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -54,7 +54,7 @@
E           <section id="luminaries">
E            <h1>
E             Luminaries
E       -     <a class="headerlink" href="#luminaries" title="Permalink to this headline">
E       +     <a class="headerlink" href="#luminaries" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -82,7 +82,7 @@
E           <section id="code-tabs">
E            <h1>
E             Code Tabs
E       -     <a class="headerlink" href="#code-tabs" title="Permalink to this headline">
E       +     <a class="headerlink" href="#code-tabs" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -182,7 +182,7 @@
E           <section id="group-tabs">
E            <h1>
E             Group Tabs
E       -     <a class="headerlink" href="#group-tabs" title="Permalink to this headline">
E       +     <a class="headerlink" href="#group-tabs" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>

tests/conftest.py:93: AssertionError
____________________________________________________ ERROR at setup of test_conditional_assets[no_tabs1] _____________________________________________________

app = <SphinxTestApp buildername='html'>, status = <_io.StringIO object at 0x7fe64a56d940>, warning = <_io.StringIO object at 0x7fe64b5baaf0>
check_build_success = <function check_build_success.<locals>.check at 0x7fe64a0f78b0>
get_sphinx_app_doctree = <function get_sphinx_app_doctree.<locals>.read at 0x7fe64a0f7dc0>
regress_sphinx_app_output = <function regress_sphinx_app_output.<locals>.read at 0x7fe64a0e1040>
request = <SubRequest 'auto_build_and_check' for <Function test_conditional_assets[no_tabs1]>>

    @pytest.fixture(autouse=True)
    def auto_build_and_check(
        app,
        status,
        warning,
        check_build_success,
        get_sphinx_app_doctree,
        regress_sphinx_app_output,
        request,
    ):
        """
        Build and check build success and output regressions.
        Currently all tests start with this.
        Disable using a `noautobuild` mark.
        """
        if "noautobuild" in request.keywords:
            return
        app.build()
        check_build_success(status, warning)
        get_sphinx_app_doctree(app, regress=True)
>       regress_sphinx_app_output(app)

tests/conftest.py:38:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

app = <SphinxTestApp buildername='html'>, buildername = 'html', filename = 'index.html', encoding = 'utf-8'

    def read(app, buildername="html", filename="index.html", encoding="utf-8"):
        content = get_sphinx_app_output(app, buildername, filename, encoding)

        if buildername == "html":
            soup = BeautifulSoup(content, "html.parser")

            # Remove output from ``pygments``, so that test only compares HTML of surrounding tabs
            for div in soup.find_all("div", {"class": "highlight"}):
                div.decompose()

            doc_div = soup.findAll("div", {"class": "documentwrapper"})[0]
            doc = doc_div.prettify()

        else:
            doc = content
>       file_regression.check(
            doc, extension="." + filename.split(".")[-1], encoding="utf8"
        )
E       AssertionError: FILES DIFFER:
E       /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_no_tab0/test_build/test_conditional_assets_no_tabs1_.html
E       /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_no_tab0/test_build/test_conditional_assets_no_tabs1_.obtained.html
E       HTML DIFF: /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_no_tab0/test_build/test_conditional_assets_no_tabs1_.obtained.diff.html
E       ---
E       +++
E       @@ -18,7 +18,7 @@
E           <section id="fruits">
E            <h1>
E             Fruits
E       -     <a class="headerlink" href="#fruits" title="Permalink to this headline">
E       +     <a class="headerlink" href="#fruits" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -54,7 +54,7 @@
E           <section id="luminaries">
E            <h1>
E             Luminaries
E       -     <a class="headerlink" href="#luminaries" title="Permalink to this headline">
E       +     <a class="headerlink" href="#luminaries" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -82,7 +82,7 @@
E           <section id="code-tabs">
E            <h1>
E             Code Tabs
E       -     <a class="headerlink" href="#code-tabs" title="Permalink to this headline">
E       +     <a class="headerlink" href="#code-tabs" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -182,7 +182,7 @@
E           <section id="group-tabs">
E            <h1>
E             Group Tabs
E       -     <a class="headerlink" href="#group-tabs" title="Permalink to this headline">
E       +     <a class="headerlink" href="#group-tabs" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>

tests/conftest.py:93: AssertionError
____________________________________________________ ERROR at setup of test_conditional_assets[no_tabs2] _____________________________________________________

app = <SphinxTestApp buildername='html'>, status = <_io.StringIO object at 0x7fe64a372ca0>, warning = <_io.StringIO object at 0x7fe64a372700>
check_build_success = <function check_build_success.<locals>.check at 0x7fe64a110280>
get_sphinx_app_doctree = <function get_sphinx_app_doctree.<locals>.read at 0x7fe64a110790>
regress_sphinx_app_output = <function regress_sphinx_app_output.<locals>.read at 0x7fe64a1109d0>
request = <SubRequest 'auto_build_and_check' for <Function test_conditional_assets[no_tabs2]>>

    @pytest.fixture(autouse=True)
    def auto_build_and_check(
        app,
        status,
        warning,
        check_build_success,
        get_sphinx_app_doctree,
        regress_sphinx_app_output,
        request,
    ):
        """
        Build and check build success and output regressions.
        Currently all tests start with this.
        Disable using a `noautobuild` mark.
        """
        if "noautobuild" in request.keywords:
            return
        app.build()
        check_build_success(status, warning)
        get_sphinx_app_doctree(app, regress=True)
>       regress_sphinx_app_output(app)

tests/conftest.py:38:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

app = <SphinxTestApp buildername='html'>, buildername = 'html', filename = 'index.html', encoding = 'utf-8'

    def read(app, buildername="html", filename="index.html", encoding="utf-8"):
        content = get_sphinx_app_output(app, buildername, filename, encoding)

        if buildername == "html":
            soup = BeautifulSoup(content, "html.parser")

            # Remove output from ``pygments``, so that test only compares HTML of surrounding tabs
            for div in soup.find_all("div", {"class": "highlight"}):
                div.decompose()

            doc_div = soup.findAll("div", {"class": "documentwrapper"})[0]
            doc = doc_div.prettify()

        else:
            doc = content
>       file_regression.check(
            doc, extension="." + filename.split(".")[-1], encoding="utf8"
        )
E       AssertionError: FILES DIFFER:
E       /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_no_tab1/test_build/test_conditional_assets_no_tabs2_.html
E       /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_no_tab1/test_build/test_conditional_assets_no_tabs2_.obtained.html
E       HTML DIFF: /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_no_tab1/test_build/test_conditional_assets_no_tabs2_.obtained.diff.html
E       ---
E       +++
E       @@ -18,7 +18,7 @@
E           <section id="fruits">
E            <h1>
E             Fruits
E       -     <a class="headerlink" href="#fruits" title="Permalink to this headline">
E       +     <a class="headerlink" href="#fruits" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -54,7 +54,7 @@
E           <section id="luminaries">
E            <h1>
E             Luminaries
E       -     <a class="headerlink" href="#luminaries" title="Permalink to this headline">
E       +     <a class="headerlink" href="#luminaries" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -82,7 +82,7 @@
E           <section id="code-tabs">
E            <h1>
E             Code Tabs
E       -     <a class="headerlink" href="#code-tabs" title="Permalink to this headline">
E       +     <a class="headerlink" href="#code-tabs" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -182,7 +182,7 @@
E           <section id="group-tabs">
E            <h1>
E             Group Tabs
E       -     <a class="headerlink" href="#group-tabs" title="Permalink to this headline">
E       +     <a class="headerlink" href="#group-tabs" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>

tests/conftest.py:93: AssertionError
____________________________________________________________ ERROR at setup of test_nested_markup ____________________________________________________________

app = <SphinxTestApp buildername='html'>, status = <_io.StringIO object at 0x7fe649edcee0>, warning = <_io.StringIO object at 0x7fe649edcdc0>
check_build_success = <function check_build_success.<locals>.check at 0x7fe64a4aeca0>
get_sphinx_app_doctree = <function get_sphinx_app_doctree.<locals>.read at 0x7fe64a0f7670>
regress_sphinx_app_output = <function regress_sphinx_app_output.<locals>.read at 0x7fe64a372700>
request = <SubRequest 'auto_build_and_check' for <Function test_nested_markup>>

    @pytest.fixture(autouse=True)
    def auto_build_and_check(
        app,
        status,
        warning,
        check_build_success,
        get_sphinx_app_doctree,
        regress_sphinx_app_output,
        request,
    ):
        """
        Build and check build success and output regressions.
        Currently all tests start with this.
        Disable using a `noautobuild` mark.
        """
        if "noautobuild" in request.keywords:
            return
        app.build()
        check_build_success(status, warning)
        get_sphinx_app_doctree(app, regress=True)
>       regress_sphinx_app_output(app)

tests/conftest.py:38:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

app = <SphinxTestApp buildername='html'>, buildername = 'html', filename = 'index.html', encoding = 'utf-8'

    def read(app, buildername="html", filename="index.html", encoding="utf-8"):
        content = get_sphinx_app_output(app, buildername, filename, encoding)

        if buildername == "html":
            soup = BeautifulSoup(content, "html.parser")

            # Remove output from ``pygments``, so that test only compares HTML of surrounding tabs
            for div in soup.find_all("div", {"class": "highlight"}):
                div.decompose()

            doc_div = soup.findAll("div", {"class": "documentwrapper"})[0]
            doc = doc_div.prettify()

        else:
            doc = content
>       file_regression.check(
            doc, extension="." + filename.split(".")[-1], encoding="utf8"
        )
E       AssertionError: FILES DIFFER:
E       /tmp/pytest-of-tkloczko/pytest-11/test_nested_markup0/test_build/test_nested_markup.html
E       /tmp/pytest-of-tkloczko/pytest-11/test_nested_markup0/test_build/test_nested_markup.obtained.html
E       HTML DIFF: /tmp/pytest-of-tkloczko/pytest-11/test_nested_markup0/test_build/test_nested_markup.obtained.diff.html
E       ---
E       +++
E       @@ -4,7 +4,7 @@
E           <section id="markup-in-tab-titles">
E            <h1>
E             Markup in Tab Titles
E       -     <a class="headerlink" href="#markup-in-tab-titles" title="Permalink to this headline">
E       +     <a class="headerlink" href="#markup-in-tab-titles" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>

tests/conftest.py:93: AssertionError
========================================================================== FAILURES ==========================================================================
_____________________________________________________ test_conditional_assets_html_assets_policy[index] ______________________________________________________

app = <SphinxTestApp buildername='html'>, docname = 'index', status = <_io.StringIO object at 0x7fe64a257700>
warning = <_io.StringIO object at 0x7fe64a2579d0>, check_build_success = <function check_build_success.<locals>.check at 0x7fe64a236790>
get_sphinx_app_doctree = <function get_sphinx_app_doctree.<locals>.read at 0x7fe64a236ca0>
regress_sphinx_app_output = <function regress_sphinx_app_output.<locals>.read at 0x7fe64a236ee0>
check_asset_links = <function check_asset_links.<locals>.check at 0x7fe64a22e0d0>

    @pytest.mark.noautobuild
    @pytest.mark.parametrize("docname", ["index", "no_tabs1", "no_tabs2"])
    @pytest.mark.sphinx(testroot="conditionalassets-policy")
    @pytest.mark.skipif(
        sphinx.version_info[:2] < (4, 1), reason="Test uses Sphinx 4.1 config"
    )
    def test_conditional_assets_html_assets_policy(
        app,
        docname,
        status,
        warning,
        check_build_success,
        get_sphinx_app_doctree,
        regress_sphinx_app_output,
        check_asset_links,
    ):
        app.set_html_assets_policy("always")

        # Following lines are copied from ``auto_build_and_check`` since we need to
        # set a config in the build object before auto build. Because of this, we
        # need to use ``noautobuild``.
        app.build()
        check_build_success(status, warning)
        get_sphinx_app_doctree(app, regress=True)
>       regress_sphinx_app_output(app)

tests/test_build.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

app = <SphinxTestApp buildername='html'>, buildername = 'html', filename = 'index.html', encoding = 'utf-8'

    def read(app, buildername="html", filename="index.html", encoding="utf-8"):
        content = get_sphinx_app_output(app, buildername, filename, encoding)

        if buildername == "html":
            soup = BeautifulSoup(content, "html.parser")

            # Remove output from ``pygments``, so that test only compares HTML of surrounding tabs
            for div in soup.find_all("div", {"class": "highlight"}):
                div.decompose()

            doc_div = soup.findAll("div", {"class": "documentwrapper"})[0]
            doc = doc_div.prettify()

        else:
            doc = content
>       file_regression.check(
            doc, extension="." + filename.split(".")[-1], encoding="utf8"
        )
E       AssertionError: FILES DIFFER:
E       /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_html_a0/test_build/test_conditional_assets_html_assets_policy_index_.html
E       /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_html_a0/test_build/test_conditional_assets_html_assets_policy_index_.obtained.html
E       HTML DIFF: /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_html_a0/test_build/test_conditional_assets_html_assets_policy_index_.obtained.diff.html
E       ---
E       +++
E       @@ -18,7 +18,7 @@
E           <section id="fruits">
E            <h1>
E             Fruits
E       -     <a class="headerlink" href="#fruits" title="Permalink to this headline">
E       +     <a class="headerlink" href="#fruits" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -54,7 +54,7 @@
E           <section id="luminaries">
E            <h1>
E             Luminaries
E       -     <a class="headerlink" href="#luminaries" title="Permalink to this headline">
E       +     <a class="headerlink" href="#luminaries" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -82,7 +82,7 @@
E           <section id="code-tabs">
E            <h1>
E             Code Tabs
E       -     <a class="headerlink" href="#code-tabs" title="Permalink to this headline">
E       +     <a class="headerlink" href="#code-tabs" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -182,7 +182,7 @@
E           <section id="group-tabs">
E            <h1>
E             Group Tabs
E       -     <a class="headerlink" href="#group-tabs" title="Permalink to this headline">
E       +     <a class="headerlink" href="#group-tabs" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>

tests/conftest.py:93: AssertionError
------------------------------------------------------------------ Captured stdout teardown ------------------------------------------------------------------
# testroot: root
# builder: html
# srcdir: /tmp/pytest-of-tkloczko/pytest-11/conditionalassets-policy
# outdir: /tmp/pytest-of-tkloczko/pytest-11/conditionalassets-policy/_build/html
# status:
Running Sphinx v5.0.1
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 3 source files that are out of date
updating environment: [new config] 3 added, 0 changed, 0 removed
reading sources... [100%] no_tabs2
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] no_tabs2
generating indices... genindex done
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.

The HTML pages are in ../../../../../tmp/pytest-of-tkloczko/pytest-11/conditionalassets-policy/_build/html.

# warning:

____________________________________________________ test_conditional_assets_html_assets_policy[no_tabs1] ____________________________________________________

app = <SphinxTestApp buildername='html'>, docname = 'no_tabs1', status = <_io.StringIO object at 0x7fe64a22e040>
warning = <_io.StringIO object at 0x7fe64a22e160>, check_build_success = <function check_build_success.<locals>.check at 0x7fe64a195790>
get_sphinx_app_doctree = <function get_sphinx_app_doctree.<locals>.read at 0x7fe64a1951f0>
regress_sphinx_app_output = <function regress_sphinx_app_output.<locals>.read at 0x7fe64a1954c0>
check_asset_links = <function check_asset_links.<locals>.check at 0x7fe64a1958b0>

    @pytest.mark.noautobuild
    @pytest.mark.parametrize("docname", ["index", "no_tabs1", "no_tabs2"])
    @pytest.mark.sphinx(testroot="conditionalassets-policy")
    @pytest.mark.skipif(
        sphinx.version_info[:2] < (4, 1), reason="Test uses Sphinx 4.1 config"
    )
    def test_conditional_assets_html_assets_policy(
        app,
        docname,
        status,
        warning,
        check_build_success,
        get_sphinx_app_doctree,
        regress_sphinx_app_output,
        check_asset_links,
    ):
        app.set_html_assets_policy("always")

        # Following lines are copied from ``auto_build_and_check`` since we need to
        # set a config in the build object before auto build. Because of this, we
        # need to use ``noautobuild``.
        app.build()
        check_build_success(status, warning)
        get_sphinx_app_doctree(app, regress=True)
>       regress_sphinx_app_output(app)

tests/test_build.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

app = <SphinxTestApp buildername='html'>, buildername = 'html', filename = 'index.html', encoding = 'utf-8'

    def read(app, buildername="html", filename="index.html", encoding="utf-8"):
        content = get_sphinx_app_output(app, buildername, filename, encoding)

        if buildername == "html":
            soup = BeautifulSoup(content, "html.parser")

            # Remove output from ``pygments``, so that test only compares HTML of surrounding tabs
            for div in soup.find_all("div", {"class": "highlight"}):
                div.decompose()

            doc_div = soup.findAll("div", {"class": "documentwrapper"})[0]
            doc = doc_div.prettify()

        else:
            doc = content
>       file_regression.check(
            doc, extension="." + filename.split(".")[-1], encoding="utf8"
        )
E       AssertionError: FILES DIFFER:
E       /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_html_a1/test_build/test_conditional_assets_html_assets_policy_no_tabs1_.html
E       /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_html_a1/test_build/test_conditional_assets_html_assets_policy_no_tabs1_.obtained.html
E       HTML DIFF: /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_html_a1/test_build/test_conditional_assets_html_assets_policy_no_tabs1_.obtained.diff.html
E       ---
E       +++
E       @@ -18,7 +18,7 @@
E           <section id="fruits">
E            <h1>
E             Fruits
E       -     <a class="headerlink" href="#fruits" title="Permalink to this headline">
E       +     <a class="headerlink" href="#fruits" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -54,7 +54,7 @@
E           <section id="luminaries">
E            <h1>
E             Luminaries
E       -     <a class="headerlink" href="#luminaries" title="Permalink to this headline">
E       +     <a class="headerlink" href="#luminaries" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -82,7 +82,7 @@
E           <section id="code-tabs">
E            <h1>
E             Code Tabs
E       -     <a class="headerlink" href="#code-tabs" title="Permalink to this headline">
E       +     <a class="headerlink" href="#code-tabs" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -182,7 +182,7 @@
E           <section id="group-tabs">
E            <h1>
E             Group Tabs
E       -     <a class="headerlink" href="#group-tabs" title="Permalink to this headline">
E       +     <a class="headerlink" href="#group-tabs" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>

tests/conftest.py:93: AssertionError
------------------------------------------------------------------ Captured stdout teardown ------------------------------------------------------------------
# testroot: root
# builder: html
# srcdir: /tmp/pytest-of-tkloczko/pytest-11/conditionalassets-policy
# outdir: /tmp/pytest-of-tkloczko/pytest-11/conditionalassets-policy/_build/html
# status:
Running Sphinx v5.0.1
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
no targets are out of date.
build succeeded.

The HTML pages are in ../../../../../tmp/pytest-of-tkloczko/pytest-11/conditionalassets-policy/_build/html.

# warning:

____________________________________________________ test_conditional_assets_html_assets_policy[no_tabs2] ____________________________________________________

app = <SphinxTestApp buildername='html'>, docname = 'no_tabs2', status = <_io.StringIO object at 0x7fe64a195c10>
warning = <_io.StringIO object at 0x7fe64a195940>, check_build_success = <function check_build_success.<locals>.check at 0x7fe649edcd30>
get_sphinx_app_doctree = <function get_sphinx_app_doctree.<locals>.read at 0x7fe64a1e1280>
regress_sphinx_app_output = <function regress_sphinx_app_output.<locals>.read at 0x7fe64a1e14c0>
check_asset_links = <function check_asset_links.<locals>.check at 0x7fe64a1e1670>

    @pytest.mark.noautobuild
    @pytest.mark.parametrize("docname", ["index", "no_tabs1", "no_tabs2"])
    @pytest.mark.sphinx(testroot="conditionalassets-policy")
    @pytest.mark.skipif(
        sphinx.version_info[:2] < (4, 1), reason="Test uses Sphinx 4.1 config"
    )
    def test_conditional_assets_html_assets_policy(
        app,
        docname,
        status,
        warning,
        check_build_success,
        get_sphinx_app_doctree,
        regress_sphinx_app_output,
        check_asset_links,
    ):
        app.set_html_assets_policy("always")

        # Following lines are copied from ``auto_build_and_check`` since we need to
        # set a config in the build object before auto build. Because of this, we
        # need to use ``noautobuild``.
        app.build()
        check_build_success(status, warning)
        get_sphinx_app_doctree(app, regress=True)
>       regress_sphinx_app_output(app)

tests/test_build.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

app = <SphinxTestApp buildername='html'>, buildername = 'html', filename = 'index.html', encoding = 'utf-8'

    def read(app, buildername="html", filename="index.html", encoding="utf-8"):
        content = get_sphinx_app_output(app, buildername, filename, encoding)

        if buildername == "html":
            soup = BeautifulSoup(content, "html.parser")

            # Remove output from ``pygments``, so that test only compares HTML of surrounding tabs
            for div in soup.find_all("div", {"class": "highlight"}):
                div.decompose()

            doc_div = soup.findAll("div", {"class": "documentwrapper"})[0]
            doc = doc_div.prettify()

        else:
            doc = content
>       file_regression.check(
            doc, extension="." + filename.split(".")[-1], encoding="utf8"
        )
E       AssertionError: FILES DIFFER:
E       /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_html_a2/test_build/test_conditional_assets_html_assets_policy_no_tabs2_.html
E       /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_html_a2/test_build/test_conditional_assets_html_assets_policy_no_tabs2_.obtained.html
E       HTML DIFF: /tmp/pytest-of-tkloczko/pytest-11/test_conditional_assets_html_a2/test_build/test_conditional_assets_html_assets_policy_no_tabs2_.obtained.diff.html
E       ---
E       +++
E       @@ -18,7 +18,7 @@
E           <section id="fruits">
E            <h1>
E             Fruits
E       -     <a class="headerlink" href="#fruits" title="Permalink to this headline">
E       +     <a class="headerlink" href="#fruits" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -54,7 +54,7 @@
E           <section id="luminaries">
E            <h1>
E             Luminaries
E       -     <a class="headerlink" href="#luminaries" title="Permalink to this headline">
E       +     <a class="headerlink" href="#luminaries" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -82,7 +82,7 @@
E           <section id="code-tabs">
E            <h1>
E             Code Tabs
E       -     <a class="headerlink" href="#code-tabs" title="Permalink to this headline">
E       +     <a class="headerlink" href="#code-tabs" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>
E       @@ -182,7 +182,7 @@
E           <section id="group-tabs">
E            <h1>
E             Group Tabs
E       -     <a class="headerlink" href="#group-tabs" title="Permalink to this headline">
E       +     <a class="headerlink" href="#group-tabs" title="Permalink to this heading">
E              ¶
E             </a>
E            </h1>

tests/conftest.py:93: AssertionError
------------------------------------------------------------------ Captured stdout teardown ------------------------------------------------------------------
# testroot: root
# builder: html
# srcdir: /tmp/pytest-of-tkloczko/pytest-11/conditionalassets-policy
# outdir: /tmp/pytest-of-tkloczko/pytest-11/conditionalassets-policy/_build/html
# status:
Running Sphinx v5.0.1
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
no targets are out of date.
build succeeded.

The HTML pages are in ../../../../../tmp/pytest-of-tkloczko/pytest-11/conditionalassets-policy/_build/html.

# warning:

====================================================================== warnings summary ======================================================================
tests/test_build.py:28
  /home/tkloczko/rpmbuild/BUILD/sphinx-tabs-3.3.1/tests/test_build.py:28: PytestUnknownMarkWarning: Unknown pytest.mark.noautobuild - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.noautobuild

tests/test_build.py:83
  /home/tkloczko/rpmbuild/BUILD/sphinx-tabs-3.3.1/tests/test_build.py:83: PytestUnknownMarkWarning: Unknown pytest.mark.noautobuild - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.noautobuild

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================== short test summary info ===================================================================
SKIPPED [1] tests/test_build.py:57: Test uses Sphinx 3 code blocks
ERROR tests/test_build.py::test_conditional_assets[index] - AssertionError: FILES DIFFER:
ERROR tests/test_build.py::test_conditional_assets[no_tabs1] - AssertionError: FILES DIFFER:
ERROR tests/test_build.py::test_conditional_assets[no_tabs2] - AssertionError: FILES DIFFER:
ERROR tests/test_build.py::test_nested_markup - AssertionError: FILES DIFFER:
FAILED tests/test_build.py::test_conditional_assets_html_assets_policy[index] - AssertionError: FILES DIFFER:
FAILED tests/test_build.py::test_conditional_assets_html_assets_policy[no_tabs1] - AssertionError: FILES DIFFER:
FAILED tests/test_build.py::test_conditional_assets_html_assets_policy[no_tabs2] - AssertionError: FILES DIFFER:
========================================= 3 failed, 6 passed, 1 skipped, 1 deselected, 2 warnings, 4 errors in 2.70s =========================================

So definitelly few tweaks needs to be added.

@foster999
Copy link
Collaborator

foster999 commented Jun 25, 2022

Thanks for your patience on this one @rikardn and others 😄 Sphinx 5 is now properly supported in version 3.4.0

@rikardn
Copy link
Author

rikardn commented Jun 27, 2022

It is me who should thank you @foster999 for fixing the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants