From 2926db9da5562fa9e4891514b10bd22455513707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 27 Jan 2023 19:56:06 +0100 Subject: [PATCH] Convert to pyproject-rpm-macros --- python-markupsafe.spec | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/python-markupsafe.spec b/python-markupsafe.spec index 6b4fcef..a15639e 100644 --- a/python-markupsafe.spec +++ b/python-markupsafe.spec @@ -7,6 +7,11 @@ URL: https://pypi.org/project/MarkupSafe/ Source: %pypi_source MarkupSafe BuildRequires: gcc +BuildRequires: python3-devel + +# This dependency is listed in requirements/tests.in but that file is not in the sdist +# requirements/tests.txt pins exact versions of dependencies, so we rather list it manually: +BuildRequires: python3-pytest %description A library for safe markup escaping. @@ -14,10 +19,6 @@ A library for safe markup escaping. %package -n python3-markupsafe Summary: Implements a XML/HTML/XHTML Markup safe string for Python 3 -BuildRequires: python3-devel -BuildRequires: python3dist(setuptools) -# Test dependencies -BuildRequires: python3dist(pytest) %description -n python3-markupsafe A library for safe markup escaping. Python 3 version. @@ -25,27 +26,29 @@ A library for safe markup escaping. Python 3 version. %prep %autosetup -n MarkupSafe-%{version} +# Exclude C source from the package: +echo 'global-exclude *.c' >> MANIFEST.in + + +%generate_buildrequires +%pyproject_buildrequires %build -%py3_build +%pyproject_wheel %install -%py3_install -# C code errantly gets installed -rm %{buildroot}%{python3_sitearch}/markupsafe/*.c +%pyproject_install +%pyproject_save_files markupsafe %check %pytest -%files -n python3-markupsafe -%license LICENSE.rst +%files -n python3-markupsafe -f %{pyproject_files} %doc CHANGES.rst README.rst -%{python3_sitearch}/MarkupSafe-%{version}-py%{python3_version}.egg-info/ -%{python3_sitearch}/markupsafe/ %changelog