From 63cec5f99b2e073c6a64ded9a54ec1b9461c1e15 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 29 Dec 2023 12:09:11 -0500 Subject: [PATCH] Port to pyproject-rpm-macros and run the tests --- python-wrapt.spec | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/python-wrapt.spec b/python-wrapt.spec index 1e70d60..98e9729 100644 --- a/python-wrapt.spec +++ b/python-wrapt.spec @@ -16,7 +16,11 @@ Source: %{url}/archive/%{version}/wrapt-%{version}.tar.gz BuildRequires: gcc BuildRequires: python3-devel -BuildRequires: %{py3_dist setuptools} + +# We bypass tox and instead BR and use pytest directly; this is simpler and +# avoids the need to patch out coverage analysis +# (https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters). +BuildRequires: %{py3_dist pytest} %global _description %{expand: The aim of the wrapt module is to provide a transparent object proxy for @@ -48,13 +52,13 @@ BuildRequires: %{py3_dist sphinx_rtd_theme} %endif %prep -%setup -q -n wrapt-%{version} +%autosetup -n wrapt-%{version} -# Remove bundled egg-info in case it exists -rm -rf wrapt.egg-info +%generate_buildrequires +%pyproject_buildrequires %build -%py3_build +%pyproject_wheel %if %{with docs} PYTHONPATH="${PWD}" %make_build -C docs latex \ @@ -63,7 +67,11 @@ PYTHONPATH="${PWD}" %make_build -C docs latex \ %endif %install -%py3_install +%pyproject_install +%pyproject_save_files -l wrapt + +%check +%pytest -v %if %{with docs} %files doc @@ -71,11 +79,8 @@ PYTHONPATH="${PWD}" %make_build -C docs latex \ %doc docs/_build/latex/wrapt.pdf %endif -%files -n python3-wrapt +%files -n python3-wrapt -f %{pyproject_files} %doc README.rst -%license LICENSE -%{python3_sitearch}/wrapt -%{python3_sitearch}/wrapt-%{version}-py%{python3_version}.egg-info %changelog %autochangelog