Bug 2319721
Summary: | python-sphinxcontrib-trio fails to build with setuptools 74+ | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Miro Hrončok <mhroncok> |
Component: | python-sphinxcontrib-trio | Assignee: | Thomas Moschny <thomas.moschny> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | jcaratza, thomas.moschny |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2024-10-23 10:21:30 UTC | Type: | --- |
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: | 2319387 |
Description
Miro Hrončok
2024-10-18 10:14:25 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   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   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 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><em class="property">await </em><code class="(sig-name )?descname">foo</code> </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></em><code class="(sig-name )?descname">basic</code> </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><em class="property">await </em><code class="(sig-name )?descname">a_syncmethod</code> </pre></div> </div> <div class="highlight-none notranslate"><div class="highlight"><pre><span></span><em class="property">await </em><code class="(sig-name )?descname">b_syncmethod</code> </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><em class="property">await </em><code class="(sig-name )?descname">foo</code> </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 ========================== 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 :) 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. Similar patch applied, thx. |