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>
run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
I'm not 100% sure but those fails may indicate that sphinx-packaging test suite needs to be adjusted for sphinx 5.1.1.
Here is pytest output:
```console
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphinx-packaging-0.1.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinx-packaging-0.1.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
Test session started at 04:18:32
rootdir: /home/tkloczko/rpmbuild/BUILD/sphinx-packaging-0.1.1, configfile: tox.ini
plugins: datadir-1.3.1, regressions-2.3.1, timeout-2.1.0
timeout: 300.0s
timeout method: signal
timeout func_only: False
collected 3 items
tests/test_output.py .FF [100%]
================================================================================= FAILURES =================================================================================
_____________________________________________________________________________ test_html_output _____________________________________________________________________________
app = , html_regression =
@pytest.mark.usefixtures("doc_root")
@pytest.mark.sphinx("html", testroot="test-packaging")
def test_html_output(app: Sphinx, html_regression: HTMLRegressionFixture):
app.build()
# capout = app._warning.getvalue()
#
# for string in {
# "WARNING: invalid PEP number abc",
# "WARNING: more than one target found for cross-reference 'name': project.name, tool.something.name"
# }:
# assert string in capout
output_file = PathPlus(app.outdir) / "index.html"
page = BeautifulSoup(output_file.read_text(), "html5lib")
# Make sure the page title is what you expect
title = page.find("h1").contents[0].strip()
assert "sphinx-packaging demo" == title
code: bs4.element.Tag
for code in page.find_all("code", attrs={"class": "sig-prename descclassname"}):
first_child = code.contents[0]
if isinstance(first_child, bs4.element.Tag):
code.contents = [first_child.contents[0]]
for code in page.find_all("code", attrs={"class": "sig-name descname"}):
first_child = code.contents[0]
if isinstance(first_child, bs4.element.Tag):
code.contents = [first_child.contents[0]]
> html_regression.check(page)
E AssertionError: FILES DIFFER:
E /tmp/pytest-of-tkloczko/pytest-18/test_html_output0/test_output_/test_html_output.html
E /tmp/pytest-of-tkloczko/pytest-18/test_html_output0/test_output_/test_html_output.obtained.html
E HTML DIFF: /tmp/pytest-of-tkloczko/pytest-18/test_html_output0/test_output_/test_html_output.obtained.diff.html
E ---
E +++
E @@ -1,8 +1,9 @@
E
E -
E +
E
E
E
E +
E
E sphinx-packaging demo — Python documentation
E
E @@ -11,6 +12,8 @@
E
E
E +
E
E @@ -21,10 +24,10 @@
E
E +
E +
E + project.
E +
E +
E +
E +
E + name
E +
E +
E
E ¶
E
E @@ -562,13 +569,17 @@
E
E
E
E -
E -
E - project.
E -
E -
E - version
E -
E +
E +
E +
E + project.
E +
E +
E +
E +
E + version
E +
E +
E
E ¶
E
E @@ -612,10 +623,12 @@
E
E
E
E -
E -
E - description
E -
E +
E +
E +
E + description
E +
E +
E
E ¶
E
E @@ -718,10 +731,12 @@
E .
E
E
E -
E -
E - description
E -
E +
E +
E +
E + description
E +
E +
E
E
E
E @@ -779,13 +794,17 @@
E
E
E
E -
E -
E - tool.something.
E -
E -
E - name
E -
E +
E +
E +
E + tool.something.
E +
E +
E +
E +
E + name
E +
E +
E
E ¶
E
E @@ -846,7 +865,7 @@
E
E directives, which is ambiguous.
E
E -
E +
E
E
E
tests/test_output.py:67: AssertionError
------------------------------------------------------------------------- Captured stdout teardown -------------------------------------------------------------------------
# testroot: root
# builder: html
# srcdir: /tmp/pytest-of-tkloczko/pytest-18/test-packaging
# outdir: /tmp/pytest-of-tkloczko/pytest-18/test-packaging/_build/html
# status:
Running Sphinx v5.1.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-18/test-packaging/_build/html.
# warning:
____________________________________________________________________________ test_latex_output _____________________________________________________________________________
app = , advanced_file_regression =
@pytest.mark.usefixtures("doc_root")
@pytest.mark.sphinx("latex", testroot="test-packaging")
def test_latex_output(app: Sphinx, advanced_file_regression: AdvancedFileRegressionFixture):
assert app.builder.name.lower() == "latex"
app.build()
output_file = PathPlus(app.outdir) / "python.tex"
content = StringList(output_file.read_lines())
> advanced_file_regression.check(
re.sub(r"\\date{.*}", r"\\date{Mar 11, 2021}", str(content).replace("\\sphinxAtStartPar\n", '')),
extension=".tex",
)
E AssertionError: FILES DIFFER:
E /tmp/pytest-of-tkloczko/pytest-18/test_latex_output0/test_output_/test_latex_output.tex
E /tmp/pytest-of-tkloczko/pytest-18/test_latex_output0/test_output_/test_latex_output.obtained.tex
E HTML DIFF: /tmp/pytest-of-tkloczko/pytest-18/test_latex_output0/test_output_/test_latex_output.obtained.diff.html
E ---
E +++
E @@ -4,6 +4,11 @@
E \ifdefined\pdfpxdimen
E \let\sphinxpxdimen\pdfpxdimen\else\newdimen\sphinxpxdimen
E \fi \sphinxpxdimen=.75bp\relax
E +\ifdefined\pdfimageresolution
E + \pdfimageresolution= \numexpr \dimexpr1in\relax/\sphinxpxdimen\relax
E +\fi
E +%% let collapsible pdf bookmarks panel have high depth per default
E +\PassOptionsToPackage{bookmarksdepth=5}{hyperref}
E
E \PassOptionsToPackage{warn}{textcomp}
E \usepackage[utf8]{inputenc}
E @@ -28,34 +33,16 @@
E
E
E
E -\usepackage{times}
E -\expandafter\ifx\csname T@LGR\endcsname\relax
E -\else
E -% LGR was declared as font encoding
E - \substitutefont{LGR}{\rmdefault}{cmr}
E - \substitutefont{LGR}{\sfdefault}{cmss}
E - \substitutefont{LGR}{\ttdefault}{cmtt}
E -\fi
E -\expandafter\ifx\csname T@X2\endcsname\relax
E - \expandafter\ifx\csname T@T2A\endcsname\relax
E - \else
E - % T2A was declared as font encoding
E - \substitutefont{T2A}{\rmdefault}{cmr}
E - \substitutefont{T2A}{\sfdefault}{cmss}
E - \substitutefont{T2A}{\ttdefault}{cmtt}
E - \fi
E -\else
E -% X2 was declared as font encoding
E - \substitutefont{X2}{\rmdefault}{cmr}
E - \substitutefont{X2}{\sfdefault}{cmss}
E - \substitutefont{X2}{\ttdefault}{cmtt}
E -\fi
E +\usepackage{tgtermes}
E +\usepackage{tgheros}
E +\renewcommand{\ttdefault}{txtt}
E +
E
E
E \usepackage[Bjarne]{fncychap}
E \usepackage{sphinx}
E
E -\fvset{fontsize=\small}
E +\fvset{fontsize=auto}
E \usepackage{geometry}
E
E
E @@ -81,6 +68,11 @@
E \makeindex
E \begin{document}
E
E +\ifdefined\shorthandoff
E + \ifnum\catcode`\=\string=\active\shorthandoff{=}\fi
E + \ifnum\catcode`\"=\active\shorthandoff{"}\fi
E +\fi
E +
E \pagestyle{empty}
E \sphinxmaketitle
E \pagestyle{plain}
E @@ -206,7 +198,10 @@
E \index{project.name@\spxentry{project.name}!TOML configuration field@\spxentry{TOML configuration field}}\index{TOML configuration field@\spxentry{TOML configuration field}!project.name@\spxentry{project.name}}
E
E \begin{fulllineitems}
E -\phantomsection\label{\detokenize{index:tconf-project.name}}\pysigline{\sphinxcode{\sphinxupquote{project.}}\sphinxbfcode{\sphinxupquote{name}}}~
E +\phantomsection\label{\detokenize{index:tconf-project.name}}
E +\pysigstartsignatures
E +\pysigline{\sphinxcode{\sphinxupquote{project.}}\sphinxbfcode{\sphinxupquote{name}}}
E +\pysigstopsignatures
E \vspace{-45px}
E
E \begin{DUlineblock}{0em}
E @@ -223,7 +218,10 @@
E \index{project.version@\spxentry{project.version}!TOML configuration field@\spxentry{TOML configuration field}}\index{TOML configuration field@\spxentry{TOML configuration field}!project.version@\spxentry{project.version}}
E
E \begin{fulllineitems}
E -\phantomsection\label{\detokenize{index:tconf-project.version}}\pysigline{\sphinxcode{\sphinxupquote{project.}}\sphinxbfcode{\sphinxupquote{version}}}~
E +\phantomsection\label{\detokenize{index:tconf-project.version}}
E +\pysigstartsignatures
E +\pysigline{\sphinxcode{\sphinxupquote{project.}}\sphinxbfcode{\sphinxupquote{version}}}
E +\pysigstopsignatures
E \vspace{-45px}
E
E \begin{DUlineblock}{0em}
E @@ -240,7 +238,10 @@
E \index{description@\spxentry{description}!TOML configuration field@\spxentry{TOML configuration field}}\index{TOML configuration field@\spxentry{TOML configuration field}!description@\spxentry{description}}
E
E \begin{fulllineitems}
E -\phantomsection\label{\detokenize{index:tconf-description}}\pysigline{\sphinxbfcode{\sphinxupquote{description}}}~
E +\phantomsection\label{\detokenize{index:tconf-description}}
E +\pysigstartsignatures
E +\pysigline{\sphinxbfcode{\sphinxupquote{description}}}
E +\pysigstopsignatures
E \vspace{-45px}
E
E \begin{DUlineblock}{0em}
E @@ -265,7 +266,10 @@
E
E
E \begin{fulllineitems}
E -\pysigline{\sphinxbfcode{\sphinxupquote{description}}}~
E +
E +\pysigstartsignatures
E +\pysigline{\sphinxbfcode{\sphinxupquote{description}}}
E +\pysigstopsignatures
E \vspace{-45px}
E
E \begin{DUlineblock}{0em}
E @@ -283,7 +287,10 @@
E \index{tool.something.name@\spxentry{tool.something.name}!TOML configuration field@\spxentry{TOML configuration field}}\index{TOML configuration field@\spxentry{TOML configuration field}!tool.something.name@\spxentry{tool.something.name}}
E
E \begin{fulllineitems}
E -\phantomsection\label{\detokenize{index:tconf-tool.something.name}}\pysigline{\sphinxcode{\sphinxupquote{tool.something.}}\sphinxbfcode{\sphinxupquote{name}}}~
E +\phantomsection\label{\detokenize{index:tconf-tool.something.name}}
E +\pysigstartsignatures
E +\pysigline{\sphinxcode{\sphinxupquote{tool.something.}}\sphinxbfcode{\sphinxupquote{name}}}
E +\pysigstopsignatures
E \vspace{-45px}
E
E \begin{DUlineblock}{0em}
tests/test_output.py:80: AssertionError
------------------------------------------------------------------------- Captured stdout teardown -------------------------------------------------------------------------
# testroot: root
# builder: latex
# srcdir: /tmp/pytest-of-tkloczko/pytest-18/test-packaging
# outdir: /tmp/pytest-of-tkloczko/pytest-18/test-packaging/_build/latex
# status:
Running Sphinx v5.1.1
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [latex]: all documents
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
processing python.tex... index
resolving references...
done
writing... done
copying TeX support files... copying TeX support files...
done
build succeeded, 2 warnings.
The LaTeX files are in ../../../../../tmp/pytest-of-tkloczko/pytest-18/test-packaging/_build/latex.
Run 'make' in that directory to run these through (pdf)latex
(use `make latexpdf' here to do that automatically).
# warning:
/tmp/pytest-of-tkloczko/pytest-18/test-packaging/index.rst:93: WARNING: more than one target found for cross-reference 'name': project.name, tool.something.name
/tmp/pytest-of-tkloczko/pytest-18/test-packaging/index.rst:113: WARNING: more than one target found for cross-reference 'name': project.name, tool.something.name
=========================================================================== slowest 25 durations ===========================================================================
0.26s call tests/test_output.py::test_build_example
0.15s setup tests/test_output.py::test_build_example
0.11s call tests/test_output.py::test_latex_output
0.10s call tests/test_output.py::test_html_output
0.03s setup tests/test_output.py::test_latex_output
0.02s setup tests/test_output.py::test_html_output
(3 durations < 0.005s hidden. Use -vv to show these durations.)
========================================================================= short test summary info ==========================================================================
FAILED tests/test_output.py::test_html_output - AssertionError: FILES DIFFER:
FAILED tests/test_output.py::test_latex_output - AssertionError: FILES DIFFER:
======================================================================= 2 failed, 1 passed in 0.80s ========================================================================
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-4909b291-4e9b-4aee-91d3-62bc34055538/test_rmtree_errorhandler_rerai0
: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-4909b291-4e9b-4aee-91d3-62bc34055538/test_rmtree_errorhandler_reado0
: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-4909b291-4e9b-4aee-91d3-62bc34055538/test_safe_set_no_perms0
: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-4909b291-4e9b-4aee-91d3-62bc34055538/test_safe_delete_no_perms0
: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-4909b291-4e9b-4aee-91d3-62bc34055538/test_safe_get_no_perms0
: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-4909b291-4e9b-4aee-91d3-62bc34055538
: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-4909b291-4e9b-4aee-91d3-62bc34055538'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-80e1ca15-be43-42f8-9055-56c8cc70f7f5/test_rmtree_errorhandler_reado0
: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-80e1ca15-be43-42f8-9055-56c8cc70f7f5/test_rmtree_errorhandler_rerai0
: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-80e1ca15-be43-42f8-9055-56c8cc70f7f5/test_safe_delete_no_perms0
: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-80e1ca15-be43-42f8-9055-56c8cc70f7f5/test_safe_get_no_perms0
: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-80e1ca15-be43-42f8-9055-56c8cc70f7f5/test_safe_set_no_perms0
: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-80e1ca15-be43-42f8-9055-56c8cc70f7f5
: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-80e1ca15-be43-42f8-9055-56c8cc70f7f5'
warnings.warn(
```
Description
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 modulesI'm not 100% sure but those fails may indicate that
sphinx-packaging
test suite needs to be adjusted for sphinx 5.1.1. Here is pytest output:E sphinx-packaging demo E - E + E ¶ E E
E @@ -520,13 +523,17 @@ E E EE --
E -
-
E +
E +
E + project.
E +
E +
E +
E +
E + name
E +
E +
E
E ¶
E
E @@ -562,13 +569,17 @@
E
E
EE - project. E -
E -E - name E -
E +E --
E -
-
E +
E +
E + project.
E +
E +
E +
E +
E + version
E +
E +
E
E ¶
E
E @@ -612,10 +623,12 @@
E
E
EE - project. E -
E -E - version E -
E +E --
E -
-
E +
E +
E + description
E +
E +
E
E ¶
E
E @@ -718,10 +731,12 @@
E .
E
E
E - description E -
E +E --
E -
-
E +
E +
E + description
E +
E +
E
E -
E
E @@ -779,13 +794,17 @@
E
E
E
E +
E - description E -
E +E --
E -
-
E +
E +
E + tool.something.
E +
E +
E +
E +
E + name
E +
E +
E
E ¶
E
E @@ -846,7 +865,7 @@
E
E directives, which is ambiguous.
E
E -
E - tool.something. E -
E -E - name E -
E +Here is list of installed modules in build env
I have now all three units failing. Here is pytest output:
Here is updated list of installed modules in build env