[projects/template-specs] pyproject updates
arekm
arekm at pld-linux.org
Sat Feb 8 16:39:05 CET 2025
commit da7862498aa5e69431f2f587e97c9d97fabd4203
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sat Feb 8 16:04:06 2025 +0100
pyproject updates
python3.spec | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
---
diff --git a/python3.spec b/python3.spec
index c4b2439..9f59df7 100644
--- a/python3.spec
+++ b/python3.spec
@@ -23,12 +23,18 @@ Source0: https://files.pythonhosted.org/packages/source/M/MODULE/%{module}-%{ver
#URL: https://pypi.org/project/MODULE/
URL: -
BuildRequires: python3-modules >= 1:3.2
+# if setup.py
#BuildRequires: python3-setuptools
+
+# if pyproject.toml
+#BuildRequires: python3-build
+#BuildRequires: python3-installer
+
%if %{with tests}
#BuildRequires: python3-
%endif
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.714
+BuildRequires: rpmbuild(macros) >= 2.044
# when using /usr/bin/env or other in-place substitutions
#BuildRequires: sed >= 4.0
%if %{with doc}
@@ -63,9 +69,13 @@ Dokumentacja API modułu Pythona %{module}.
#%{__sed} -i -e '1s,^#!.*python3,#!%{__python3},' %{name}.py
%build
+# if setup.py
%py3_build
# deprecated target, but sometimes still used: %{?with_tests:test}
+# if pyproject.toml
+%py3_build_pyproject
+
%if %{with tests}
# use explicit plugins list for reliable builds (delete PYTEST_PLUGINS if empty)
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
@@ -86,8 +96,12 @@ rm -rf docs/_build/html/_sources
%install
rm -rf $RPM_BUILD_ROOT
+# if setup.py
%py3_install
+# if pyproject.toml
+%py3_install_pyproject
+
%if %{with enable_if_there_are_examples_provided_in_package}
install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
@@ -104,7 +118,10 @@ rm -rf $RPM_BUILD_ROOT
%dir %{py3_sitescriptdir}/%{module}
%{py3_sitescriptdir}/%{module}/*.py
%{py3_sitescriptdir}/%{module}/__pycache__
+# if setup.py
%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
+# if pyproject.toml
+%{py3_sitescriptdir}/%{module}-%{version}.dist-info
%{_examplesdir}/%{name}-%{version}
%if %{with doc}
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/template-specs.git/commitdiff/da7862498aa5e69431f2f587e97c9d97fabd4203
More information about the pld-cvs-commit
mailing list