Bug 2319721 - python-sphinxcontrib-trio fails to build with setuptools 74+
Summary: python-sphinxcontrib-trio fails to build with setuptools 74+
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-sphinxcontrib-trio
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Thomas Moschny
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: SETUPTOOLS74
TreeView+ depends on / blocked
 
Reported: 2024-10-18 10:14 UTC by Miro Hrončok
Modified: 2024-10-23 10:21 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-10-23 10:21:30 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources python-sphinxcontrib-trio pull-request 2 0 None None None 2024-10-23 10:09:18 UTC

Description Miro Hrončok 2024-10-18 10:14:25 UTC
Dear package maintainer,

this bugzilla is automated becasue the number of impacted packages it too high to go trough manually.

It appears that your package failed to build with setuptools 74.1.3 and wheel 0.44 in

  https://copr.fedorainfracloud.org/coprs/churchyard/setuptools-74/package/python-sphinxcontrib-trio/

While it succeeded with setuptools 69.2.0 and wheel 0.43 in

  https://copr.fedorainfracloud.org/coprs/churchyard/setuptools-control/package/python-sphinxcontrib-trio/

This usually means this package fails to build with setuptools 74+

We plan to update setuptools to version 74 or newer in Fedora 42. This is an approved Fedora 42 Change:

  https://fedoraproject.org/wiki/Changes/Setuptools_74+



Please analyze the failure and fix it in rawhide. Thanks.


You can use the builds from the churchyard/setuptools-74 copr for local testing.

  mock -r fedora-rawhide-x86_64 --addrepo 'https://download.copr.fedorainfracloud.org/results/churchyard/setuptools-74/fedora-rawhide-$basearch/'


One of the most common problems is that the setup.py test command cannot be used. If that is the case here, run the tests in %check differently, e.g. via %pytest, %tox, %{python3} -m unittest, etc.


If you need help, reach out to me in this bugzilla.

Comment 2 Miro Hrončok 2024-10-23 09:46:36 UTC
There are tests in the package and they can be run with %pytest.

One test fails:

+BuildRequires:  python3-cssselect
+BuildRequires:  python3-lxml
+BuildRequires:  python3-pytest
...
+%check
+%pytest

+ /usr/bin/pytest
============================= test session starts ==============================
platform linux -- Python 3.13.0, pytest-8.3.3, pluggy-1.5.0
rootdir: /builddir/build/BUILD/python-sphinxcontrib-trio-1.1.2-build/sphinxcontrib-trio-1.1.2
collected 3 items

tests/test_sphinxcontrib_trio.py .F.                                     [100%]

=================================== FAILURES ===================================
_______________________________ test_end_to_end ________________________________

tmpdir = local('/tmp/pytest-of-mockbuild/pytest-1/test_end_to_end0')

    def test_end_to_end(tmpdir):
        shutil.copytree(str(Path(__file__).parent / "test-docs-source"),
                        str(tmpdir / "test-docs-source"))
        subprocess.run(
            ["sphinx-build", "-v", "-nW", "-nb", "html",
             str(tmpdir / "test-docs-source"), str(tmpdir / "out")])
    
        tree = lxml.html.parse(str(tmpdir / "out" / "test.html")).getroot()
    
        def do_html_test(node, *, expect_match):
            original_content = node.text_content()
            print("\n-- test case --\n", lxml.html.tostring(node, encoding="unicode"))
    
            check_tags = node.cssselect(".highlight-none")
            checks = []
            for tag in check_tags:
                text = tag.text_content().strip()
                # lxml normalizes &nbsp to the unicode \xa0, so we do the same
                text = text.replace(" ", "\xa0")
                checks.append(text)
                tag.drop_tree()
    
            # make sure we removed the tests from the top-level node, to avoid
            # potential false positives matching on the tests themselves!
            assert len(node.text_content()) < len(original_content)
            assert checks
    
            test_content = lxml.html.tostring(node, encoding="unicode")
            # some versions of sphinx (>= 1.6) replace "..." with the ellipsis
            # character \u2026. Normalize back to "..." for comparison
            # purposes.
            test_content = test_content.replace("\u2026", "...")
            for check in checks:
                try:
                    if expect_match:
                        assert re.search(check, test_content) is not None
                    else:
                        assert re.search(check, test_content) is None
                except AssertionError:
                    print("failed check")
                    print()
                    print(repr(check))
                    print()
                    print("failed test_content")
                    print()
                    print(repr(test_content))
                    raise
    
        print("\n-- NEGATIVE (WARNING) TESTS --\n")
    
        for warning in tree.cssselect(".warning"):
            do_html_test(warning, expect_match=False)
    
        print("\n-- POSITIVE (NOTE) TESTS --\n")
    
        for note in tree.cssselect(".note"):
>           do_html_test(note, expect_match=True)

tests/test_sphinxcontrib_trio.py:241: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

node = <Element div at 0x7f4b3b912f80>

    def do_html_test(node, *, expect_match):
        original_content = node.text_content()
        print("\n-- test case --\n", lxml.html.tostring(node, encoding="unicode"))
    
        check_tags = node.cssselect(".highlight-none")
        checks = []
        for tag in check_tags:
            text = tag.text_content().strip()
            # lxml normalizes &nbsp to the unicode \xa0, so we do the same
            text = text.replace("&nbsp;", "\xa0")
            checks.append(text)
            tag.drop_tree()
    
        # make sure we removed the tests from the top-level node, to avoid
        # potential false positives matching on the tests themselves!
        assert len(node.text_content()) < len(original_content)
        assert checks
    
        test_content = lxml.html.tostring(node, encoding="unicode")
        # some versions of sphinx (>= 1.6) replace "..." with the ellipsis
        # character \u2026. Normalize back to "..." for comparison
        # purposes.
        test_content = test_content.replace("\u2026", "...")
        for check in checks:
            try:
                if expect_match:
>                   assert re.search(check, test_content) is not None
E                   assert None is not None
E                    +  where None = <function search at 0x7f4b3d62dd00>('<em class="property">await </em><code class="(sig-name )?descname">foo</code>', '<div class="admonition note">\n<p class="admonition-title">Note</p>\n<dl class="py function">\n<dt class="sig sig-obj... class="n"><span class="pre">bar</span></span></em><span class="sig-paren">)</span></dt>\n<dd></dd></dl>\n\n\n</div>\n')
E                    +    where <function search at 0x7f4b3d62dd00> = re.search

tests/test_sphinxcontrib_trio.py:220: AssertionError
----------------------------- Captured stdout call -----------------------------
Running Sphinx v7.3.7
making output directory... done
locale_dir /tmp/pytest-of-mockbuild/pytest-1/test_end_to_end0/test-docs-source/locales/en/LC_MESSAGES does not exist
[autosummary] generating autosummary for: test.rst
[autosummary] generating autosummary for: /tmp/pytest-of-mockbuild/pytest-1/test_end_to_end0/test-docs-source/autodoc_examples.autosummary_me.rst
locale_dir /tmp/pytest-of-mockbuild/pytest-1/test_end_to_end0/test-docs-source/locales/en/LC_MESSAGES does not exist
building [mo]: targets for 0 po files that are out of date
writing output... 
building [html]: targets for 1 source files that are out of date
updating environment: locale_dir /tmp/pytest-of-mockbuild/pytest-1/test_end_to_end0/test-docs-source/locales/en/LC_MESSAGES does not exist
[new config] 2 added, 0 changed, 0 removed
reading sources... [ 50%] autodoc_examples.autosummary_me
reading sources... [100%] test

looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
copying assets... copying static files... done
copying extra files... done
done
writing output... [ 50%] autodoc_examples.autosummary_me
writing output... [100%] test

generating indices... genindex py-modindex done
writing additional pages... search done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.

The HTML pages are in ../../../../../tmp/pytest-of-mockbuild/pytest-1/test_end_to_end0/out.

-- NEGATIVE (WARNING) TESTS --


-- test case --
 <div class="admonition warning">
<p class="admonition-title">Warning</p>
<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">foo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bar</span></span></em><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&lt;em class="property"&gt;await &lt;/em&gt;&lt;code class="(sig-name )?descname"&gt;foo&lt;/code&gt;
</pre></div>
</div>
</div>


-- test case --
 <div class="admonition warning">
<p class="admonition-title">Warning</p>
<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-prename descclassname"><span class="pre">autodoc_examples.</span></span><span class="sig-name descname"><span class="pre">basic</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&lt;/em&gt;&lt;code class="(sig-name )?descname"&gt;basic&lt;/code&gt;
</pre></div>
</div>
</div>


-- test case --
 <div class="admonition warning">
<p class="admonition-title">Warning</p>
<dl class="py class">
<dt class="sig sig-object py">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">autodoc_examples.</span></span><span class="sig-name descname"><span class="pre">ExampleInheritedSubclass</span></span></dt>
<dd><dl class="py method">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">a_syncmethod</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">b_syncmethod</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py">
<em class="property"><span class="pre">await</span> </em><span class="sig-name descname"><span class="pre">c_asyncmethod</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py">
<em class="property"><span class="pre">await</span> </em><span class="sig-name descname"><span class="pre">d_asyncmethod</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span></dt>
<dd></dd></dl>

</dd></dl>

<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&lt;em class="property"&gt;await &lt;/em&gt;&lt;code class="(sig-name )?descname"&gt;a_syncmethod&lt;/code&gt;
</pre></div>
</div>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&lt;em class="property"&gt;await &lt;/em&gt;&lt;code class="(sig-name )?descname"&gt;b_syncmethod&lt;/code&gt;
</pre></div>
</div>
</div>


-- test case --
 <div class="admonition warning">
<p class="admonition-title">Warning</p>
<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-prename descclassname"><span class="pre">autodoc_examples.</span></span><span class="sig-name descname"><span class="pre">gen</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>for
</pre></div>
</div>
</div>


-- POSITIVE (NOTE) TESTS --


-- test case --
 <div class="admonition note">
<p class="admonition-title">Note</p>
<dl class="py function">
<dt class="sig sig-object py">
<em class="property"><span class="pre">await</span> </em><span class="sig-name descname"><span class="pre">foo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bar</span></span></em><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&lt;em class="property"&gt;await &lt;/em&gt;&lt;code class="(sig-name )?descname"&gt;foo&lt;/code&gt;
</pre></div>
</div>
</div>

failed check

'<em class="property">await </em><code class="(sig-name )?descname">foo</code>'

failed test_content

'<div class="admonition note">\n<p class="admonition-title">Note</p>\n<dl class="py function">\n<dt class="sig sig-object py">\n<em class="property"><span class="pre">await</span> </em><span class="sig-name descname"><span class="pre">foo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bar</span></span></em><span class="sig-paren">)</span></dt>\n<dd></dd></dl>\n\n\n</div>\n'
=========================== short test summary info ============================
FAILED tests/test_sphinxcontrib_trio.py::test_end_to_end - assert None is not...
========================= 1 failed, 2 passed in 1.68s ==========================

Comment 3 Thomas Moschny 2024-10-23 09:49:35 UTC
Ok, thanks for checking that.

However, the tests have not really been run before, so that's an enhancement.

Wanted to get the "fix" out first :)

Comment 5 Miro Hrončok 2024-10-23 10:09:18 UTC
Looks like that failure has been well-known for ages.

I propose https://src.fedoraproject.org/rpms/python-sphinxcontrib-trio/pull-request/2 which runs 2 of the 3 tests.

Comment 6 Thomas Moschny 2024-10-23 10:21:30 UTC
Similar patch applied, thx.


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