From e048ae5cbbe308b01a3184dd3cdf47f7fb86146c Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Mon, 29 Jan 2024 16:27:18 -0500 Subject: [PATCH] spec: avoid coverage and tox dependencies The Fedora Python packaging guidelines exclude coverage checks as used in this package's tox.ini: https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters Furthermore, RHEL does not include tox, but even in Fedora it does not add much value relative to its dependencies. Calling %pytest directly is simpler and more conformant. --- openscap-report.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openscap-report.spec b/openscap-report.spec index 5b783da6..72665bfd 100644 --- a/openscap-report.spec +++ b/openscap-report.spec @@ -13,6 +13,7 @@ Source0: https://github.com/OpenSCAP/%{name}/releases/download/v%{version BuildArch: noarch BuildRequires: python3-devel +BuildRequires: python3-pytest BuildRequires: python3-sphinx BuildRequires: python3-sphinx_rtd_theme @@ -34,7 +35,9 @@ human-readable reports from SCAP XCCDF and ARF results.} %generate_buildrequires -%pyproject_buildrequires -t +%pyproject_buildrequires +# test requirement listed only in tox.ini +echo "%{py3_dist jsonschema}" %build @@ -50,7 +53,8 @@ install -m 0644 -Dt %{buildroot}%{_mandir}/man1 _build_docs/oscap-report.1 %check -%tox +# test_store_file fails with FileNotFoundError: [Errno 2] No such file or directory: '/tmp/oscap-report-tests_result.html' +%pytest -k "not test_store_file" %files -f %{pyproject_files} %{_mandir}/man1/oscap-report.*