diff --git a/python-packaging.changes b/python-packaging.changes index 78ce345..6269cf5 100644 --- a/python-packaging.changes +++ b/python-packaging.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jul 21 11:16:04 UTC 2022 - Ben Greiner + +- Refine build and runtime requirements for primary and non-primary + builds + ------------------------------------------------------------------- Fri Jul 15 12:30:44 UTC 2022 - Ben Greiner diff --git a/python-packaging.spec b/python-packaging.spec index 4ae41f7..a0657df 100644 --- a/python-packaging.spec +++ b/python-packaging.spec @@ -17,26 +17,24 @@ %define modname packaging -# this must be hardcoded until obs can read it from a prjconf definition -%if 0%{suse_version} >= 1550 -%define primary_python python310 -%else -%define primary_python python3 -%endif +# fallback if primary_python is not available from the project configuration +%{?!primary_python:%define primary_python python3%{?!sle_version:10}} # in order to avoid rewriting for subpackage generator %define mypython python %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "primary" -# this one is built in Ring0 +# this one is goes into Ring0 %define pprefix %{primary_python} %define pythons %{primary_python} +# Avoid cycle with python-rpm-packaging requiring python3-packaging +#!BuildIgnore: %{primary_python}-packaging %endif %if "%{flavor}" == "" # The rest is in Ring1 %define pprefix python %if 0%{suse_version} >= 1550 || 0%{?sle_version} == 150500 %{expand:%%define skip_%{primary_python} 1} -BuildRequires: python3-base >= 3.6 +BuildRequires: python3-packaging %else # no non-primary python in <=15.4 ExclusiveArch: do-not-build @@ -51,6 +49,7 @@ ExclusiveArch: do-not-build %bcond_with test %endif %{?!python_module:%define python_module() python3-%{**}} +%define skip_python2 1 Name: %{pprefix}-packaging%{?psuffix} Version: 21.3 Release: 0 @@ -61,26 +60,26 @@ Source: https://files.pythonhosted.org/packages/source/p/packaging/packa # Fix testsuite on big-endian systems # see: https://github.com/pypa/packaging/pull/538 Patch2: fix-big-endian-build.patch -BuildRequires: %{python_module base} +BuildRequires: %{python_module base >= 3.6} BuildRequires: fdupes BuildRequires: python-rpm-macros #!BuildIgnore: post-build-checks-malwarescan -#!BuildIgnore: python3-packaging -# ! Do not add setuptools build dependency here, so that we can get this into Ring0 ! +# ! Do not add setuptools build dependency here, so that the primary package can be in Ring0 ! # ! Also make sure all runtime dependencies don't require setuptools. ! BuildArch: noarch %if %{with test} +BuildRequires: %{python_module packaging = %{version}} BuildRequires: %{python_module pretend} -BuildRequires: %{python_module pyparsing >= 2.0.2} BuildRequires: %{python_module pytest} %endif +%if "%{flavor}" == "primary" # See boo#1186870, we can't provide ourselves to pythondistdeps.py Provides: %{mypython}%{python_version}dist(%{modname}) = %{version}-%{release} -%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3" -Provides: %{mypython}3dist(%{modname}) = %{version}-%{release} Provides: %{mypython}3-%{modname} = %{version}-%{release} +Provides: %{mypython}3dist(%{modname}) = %{version}-%{release} Obsoletes: %{mypython}3-%{modname} < %{version}-%{release} -Requires: python3-pyparsing >= 2.0.2 +Requires: %{primary_python}-pyparsing >= 2.0.2 +Requires: %{mypython}(abi) = %{python_version} %else Requires: python-pyparsing >= 2.0.2 %endif