I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
install .whl file in </install/prefix> using 'installer` module
run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
build is performed in env which is cut off from access to the public network (pytest is executed with -m "not network")
Here is pytest output:
```console
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-trio-1.1.2-15.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-trio-1.1.2-15.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.18, pytest-7.4.4, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/sphinxcontrib-trio-1.1.2
plugins: datadir-1.5.0, regressions-2.5.0
collected 3 items
tests/test_sphinxcontrib_trio.py .F. [100%]
========================================================================================= FAILURES ==========================================================================================
______________________________________________________________________________________ test_end_to_end ______________________________________________________________________________________
tmpdir = local('/tmp/pytest-of-tkloczko/pytest-69/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 =
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 = ('await foo', '
\n
Note
\n
\n
bar)
\n
\n\n\n
\n')
E + where = re.search
tests/test_sphinxcontrib_trio.py:220: AssertionError
----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
Running Sphinx v7.1.2
making output directory... done
locale_dir /tmp/pytest-of-tkloczko/pytest-69/test_end_to_end0/test-docs-source/locales/en/LC_MESSAGES does not exists
[autosummary] generating autosummary for: test.rst
[autosummary] generating autosummary for: /tmp/pytest-of-tkloczko/pytest-69/test_end_to_end0/test-docs-source/autodoc_examples.autosummary_me.rst
locale_dir /tmp/pytest-of-tkloczko/pytest-69/test_end_to_end0/test-docs-source/locales/en/LC_MESSAGES does not exists
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-tkloczko/pytest-69/test_end_to_end0/test-docs-source/locales/en/LC_MESSAGES does not exists
[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-tkloczko/pytest-69/test_end_to_end0/out.
-- NEGATIVE (WARNING) TESTS --
-- test case --
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulescut off from access to the public network
(pytest is executed with-m "not network"
)Here is pytest output:
```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-trio-1.1.2-15.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-trio-1.1.2-15.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' ==================================================================================== test session starts ==================================================================================== platform linux -- Python 3.8.18, pytest-7.4.4, pluggy-1.3.0 rootdir: /home/tkloczko/rpmbuild/BUILD/sphinxcontrib-trio-1.1.2 plugins: datadir-1.5.0, regressions-2.5.0 collected 3 items tests/test_sphinxcontrib_trio.py .F. [100%] ========================================================================================= FAILURES ========================================================================================== ______________________________________________________________________________________ test_end_to_end ______________________________________________________________________________________ tmpdir = local('/tmp/pytest-of-tkloczko/pytest-69/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 =foo
', 'Note
\n\n- bar)
\n
\n\n\nWarning
Warning
Warning
Warning
Note
foo
' failed test_content 'Note
\n\n- \nawait foo(bar)
\n
\n\n\nList of installed modules in build env:
```console Package Version ----------------------------- ------- alabaster 0.7.16 Babel 2.14.0 build 1.0.3 charset-normalizer 3.3.2 cppclean 0.13 cssselect 1.2.0 distro 1.9.0 dnf 4.18.2 docutils 0.20.1 exceptiongroup 1.1.3 gpg 1.23.2 idna 3.6 imagesize 1.4.1 importlib-metadata 7.0.1 iniconfig 2.0.0 installer 0.7.0 Jinja2 3.1.3 libdnf 0.72.0 lxml 5.0.0 MarkupSafe 2.1.3 packaging 23.2 pluggy 1.3.0 Pygments 2.17.2 pyproject_hooks 1.0.0 pytest 7.4.4 python-dateutil 2.8.2 pytz 2023.3 requests 2.31.0 setuptools 69.0.3 six 1.16.0 snowballstemmer 2.2.0 Sphinx 7.1.2 sphinxcontrib-applehelp 1.0.4 sphinxcontrib-devhelp 1.0.5 sphinxcontrib-htmlhelp 2.0.5 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.7 sphinxcontrib-serializinghtml 1.1.10 tomli 2.0.1 urllib3 1.26.18 wheel 0.42.0 zipp 3.17.0 ```Please let me know if you need more details or want me to perform some diagnostics.