Accepting request 990584 from home:bnavigator:branches:devel:languages:python

- Refine build and runtime requirements for primary and non-primary
  builds

OBS-URL: https://build.opensuse.org/request/show/990584
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-packaging?expand=0&rev=61
This commit is contained in:
Dirk Mueller 2022-07-22 11:26:10 +00:00 committed by Git OBS Bridge
parent f67e5a7180
commit df900253f3
2 changed files with 20 additions and 15 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jul 21 11:16:04 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Refine build and runtime requirements for primary and non-primary
builds
-------------------------------------------------------------------
Fri Jul 15 12:30:44 UTC 2022 - Ben Greiner <code@bnavigator.de>

View File

@ -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