From f434ab2916f6ca35b4388912a2a64655726fcd0393824ccd1fc58a8a554bf852 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 15 Jul 2022 11:00:25 +0000 Subject: [PATCH 1/4] Accepting request 989214 from home:bnavigator:branches:devel:languages:python - Setuptools itself does not depend on packaging anymore, only for pythondistdeps.py, That dependency will move to python-rpm-packaging soon. -- boo#1178257 - Use "setuptools" for building again. * Python 3.12 will drop the distutils fallback * Use the python-base vendored pip in a venv * Drop no-legacyversion-warning.patch - Remove nonsensical python362 flavor check. OBS-URL: https://build.opensuse.org/request/show/989214 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-packaging?expand=0&rev=59 --- no-legacyversion-warning.patch | 34 -------------------- python-packaging.changes | 12 +++++++ python-packaging.spec | 59 ++++++++++++++++------------------ 3 files changed, 40 insertions(+), 65 deletions(-) delete mode 100644 no-legacyversion-warning.patch diff --git a/no-legacyversion-warning.patch b/no-legacyversion-warning.patch deleted file mode 100644 index 709c384..0000000 --- a/no-legacyversion-warning.patch +++ /dev/null @@ -1,34 +0,0 @@ -Index: packaging-21.2/packaging/specifiers.py -=================================================================== ---- packaging-21.2.orig/packaging/specifiers.py -+++ packaging-21.2/packaging/specifiers.py -@@ -270,12 +270,6 @@ class LegacySpecifier(_IndividualSpecifi - def __init__(self, spec: str = "", prereleases: Optional[bool] = None) -> None: - super().__init__(spec, prereleases) - -- warnings.warn( -- "Creating a LegacyVersion has been deprecated and will be " -- "removed in the next major release", -- DeprecationWarning, -- ) -- - def _coerce_version(self, version: UnparsedVersion) -> LegacyVersion: - if not isinstance(version, LegacyVersion): - version = LegacyVersion(str(version)) -Index: packaging-21.2/packaging/version.py -=================================================================== ---- packaging-21.2.orig/packaging/version.py -+++ packaging-21.2/packaging/version.py -@@ -108,12 +108,6 @@ class LegacyVersion(_BaseVersion): - self._version = str(version) - self._key = _legacy_cmpkey(self._version) - -- warnings.warn( -- "Creating a LegacyVersion has been deprecated and will be " -- "removed in the next major release", -- DeprecationWarning, -- ) -- - def __str__(self) -> str: - return self._version - diff --git a/python-packaging.changes b/python-packaging.changes index 6219fbc..3726171 100644 --- a/python-packaging.changes +++ b/python-packaging.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Thu Jul 14 13:13:54 UTC 2022 - Ben Greiner + +- Setuptools itself does not depend on packaging anymore, only for + pythondistdeps.py, That dependency will move to + python-rpm-packaging soon. -- boo#1178257 +- Use "setuptools" for building again. + * Python 3.12 will drop the distutils fallback + * Use the python-base vendored pip in a venv + * Drop no-legacyversion-warning.patch +- Remove nonsensical python362 flavor check. + ------------------------------------------------------------------- Sun May 29 09:22:42 UTC 2022 - John Paul Adrian Glaubitz diff --git a/python-packaging.spec b/python-packaging.spec index 08b66b2..951da53 100644 --- a/python-packaging.spec +++ b/python-packaging.spec @@ -16,7 +16,7 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%{?!python_module:%define python_module() python3-%{**}} %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" %define psuffix -test @@ -27,35 +27,31 @@ %endif # in order to avoid rewriting for subpackage generator %define mypython python -%global skip_python2 1 +%define skip_python2 1 Name: python-packaging%{psuffix} Version: 21.3 Release: 0 Summary: Core utilities for Python packages -License: Apache-2.0 +License: Apache-2.0 AND BSD-2-Clause URL: https://github.com/pypa/packaging Source: https://files.pythonhosted.org/packages/source/p/packaging/packaging-%{version}.tar.gz -# Restore compatibility with 20.4 for setuptools -Patch1: no-legacyversion-warning.patch # Fix testsuite on big-endian systems # see: https://github.com/pypa/packaging/pull/538 Patch2: fix-big-endian-build.patch -BuildRequires: %{python_module devel} +BuildRequires: %{python_module base} BuildRequires: fdupes BuildRequires: python-rpm-macros #!BuildIgnore: post-build-checks-malwarescan +# ! Do not add setuptools build dependency here, so that we can get this into Ring0 ! +# ! Also make sure all runtime dependencies don't require setuptools. ! Requires: python-pyparsing >= 2.0.2 BuildArch: noarch -# do not add setuptools dependency, this is now a dependency -# of setuptools. Ensure that all dependencies also don't depend -# on setuptools -# (at the moment, six and pyparsing are ok) %if %{with test} BuildRequires: %{python_module pretend} BuildRequires: %{python_module pyparsing >= 2.0.2} BuildRequires: %{python_module pytest} %endif -# work around boo#1186870 +# See boo#1186870, we can't provide ourselves to pythondistdeps.py Provides: %{mypython}%{python_version}dist(packaging) = %{version}-%{release} %if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3" Provides: %{mypython}3dist(packaging) = %{version}-%{release} @@ -67,37 +63,38 @@ Core utilities for Python packages %prep %autosetup -p1 -n packaging-%{version} -# sdist must provide a packaging.egg-info, used below in install phase -test -d packaging.egg-info +%if !%{with test} %build -%python_build - -%if %{with test} -%check -%if "%{python_flavor}" >= "python362" -# no-legacyversion-warning.patch causes these to fail -%pytest -k "not (test_legacy_specifier_is_deprecated or test_legacy_version_is_deprecated)" +%{python_expand # build using pythonXX-base bundled setuptools +$python -m venv venv-%{$python_bin_suffix} +venv-%{$python_bin_suffix}/bin/python setup.py build +} %endif -%endif # %%{with_test} %if !%{with test} %install -%python_install -# Replace distutils generated egg-info, which varies in metadata version and -# structure (single file vs directory) based on distutils, with the egg-info -# which is provided in the sdist and uses same metadata version as setuptools. -%{python_expand rm -r %{buildroot}%{$python_sitelib}/*.egg-info -cp -r packaging.egg-info %{buildroot}%{$python_sitelib}/packaging-%{version}-py%{$python_version}.egg-info +%{python_expand # install using pythonXX-base bundled setuptools. +# This will work until deprecated support of setup.py install is removed from the bundled setuptools. +# Hopefully upstream packaging comes up with a better bootstrapping process by then. +# (https://github.com/pypa/packaging/pull/536, https://github.com/pypa/packaging/pull/546) +venv-%{$python_bin_suffix}/bin/python setup.py install \ + -O1 --skip-build --force --root %{buildroot} --prefix %{_prefix} +%fdupes %{buildroot}%{$python_sitelib} } -%python_expand %fdupes %{buildroot}%{$python_sitelib} +%endif +%if %{with test} +%check +%pytest +%endif + +%if !%{with test} %files %{python_files} %license LICENSE LICENSE.APACHE LICENSE.BSD %doc CHANGELOG.rst README.rst %{python_sitelib}/packaging -%{python_sitelib}/packaging-%{version}-py*.egg-info/ - -%endif # !%%{with_test} +%{python_sitelib}/packaging-%{version}*-info +%endif %changelog From f67e5a7180b671ac28f9ee485e7b1048ef7bcd547cd23d325f18d5e61d7f8a26 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 15 Jul 2022 20:45:45 +0000 Subject: [PATCH 2/4] Accepting request 989455 from home:bnavigator:branches:devel:languages:python - Split primary flavor in multibuild for possible inclusion into Ring0 OBS-URL: https://build.opensuse.org/request/show/989455 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-packaging?expand=0&rev=60 --- _multibuild | 1 + python-packaging.changes | 6 +++++ python-packaging.spec | 52 ++++++++++++++++++++++++++++++---------- 3 files changed, 47 insertions(+), 12 deletions(-) diff --git a/_multibuild b/_multibuild index fcc7b97..d0dc7ba 100644 --- a/_multibuild +++ b/_multibuild @@ -1,3 +1,4 @@ test + primary diff --git a/python-packaging.changes b/python-packaging.changes index 3726171..78ce345 100644 --- a/python-packaging.changes +++ b/python-packaging.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jul 15 12:30:44 UTC 2022 - Ben Greiner + +- Split primary flavor in multibuild for possible inclusion into + Ring0 + ------------------------------------------------------------------- Thu Jul 14 13:13:54 UTC 2022 - Ben Greiner diff --git a/python-packaging.spec b/python-packaging.spec index 951da53..4ae41f7 100644 --- a/python-packaging.spec +++ b/python-packaging.spec @@ -16,19 +16,42 @@ # -%{?!python_module:%define python_module() python3-%{**}} -%global flavor @BUILD_FLAVOR@%{nil} -%if "%{flavor}" == "test" -%define psuffix -test -%bcond_without test +%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 psuffix %{nil} -%bcond_with test +%define primary_python python3 %endif # in order to avoid rewriting for subpackage generator %define mypython python -%define skip_python2 1 -Name: python-packaging%{psuffix} +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "primary" +# this one is built in Ring0 +%define pprefix %{primary_python} +%define pythons %{primary_python} +%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 +%else +# no non-primary python in <=15.4 +ExclusiveArch: do-not-build +%define python_module() no-build-without-multibuild-flavor +%endif +%endif +%if "%{flavor}" == "test" +%define pprefix python +%define psuffix -test +%bcond_without test +%else +%bcond_with test +%endif +%{?!python_module:%define python_module() python3-%{**}} +Name: %{pprefix}-packaging%{?psuffix} Version: 21.3 Release: 0 Summary: Core utilities for Python packages @@ -42,9 +65,9 @@ BuildRequires: %{python_module base} 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 ! # ! Also make sure all runtime dependencies don't require setuptools. ! -Requires: python-pyparsing >= 2.0.2 BuildArch: noarch %if %{with test} BuildRequires: %{python_module pretend} @@ -52,9 +75,14 @@ BuildRequires: %{python_module pyparsing >= 2.0.2} BuildRequires: %{python_module pytest} %endif # See boo#1186870, we can't provide ourselves to pythondistdeps.py -Provides: %{mypython}%{python_version}dist(packaging) = %{version}-%{release} +Provides: %{mypython}%{python_version}dist(%{modname}) = %{version}-%{release} %if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3" -Provides: %{mypython}3dist(packaging) = %{version}-%{release} +Provides: %{mypython}3dist(%{modname}) = %{version}-%{release} +Provides: %{mypython}3-%{modname} = %{version}-%{release} +Obsoletes: %{mypython}3-%{modname} < %{version}-%{release} +Requires: python3-pyparsing >= 2.0.2 +%else +Requires: python-pyparsing >= 2.0.2 %endif %python_subpackages From df900253f39c00bec11a8abe30e184c70913491368d4714dee682708f35e51c4 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 22 Jul 2022 11:26:10 +0000 Subject: [PATCH 3/4] 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 --- python-packaging.changes | 6 ++++++ python-packaging.spec | 29 ++++++++++++++--------------- 2 files changed, 20 insertions(+), 15 deletions(-) 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 From 2150e53d9720ae18d82ad04f2251dfc21fe507f09d6b0f2bfa093de87e6507ca Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 1 Aug 2022 08:38:10 +0000 Subject: [PATCH 4/4] Accepting request 991949 from home:bnavigator:branches:devel:languages:python - BuildIgnore python3-packaging for primary bootstrap. OBS-URL: https://build.opensuse.org/request/show/991949 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-packaging?expand=0&rev=62 --- python-packaging.changes | 5 +++++ python-packaging.spec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/python-packaging.changes b/python-packaging.changes index 6269cf5..1c8ba72 100644 --- a/python-packaging.changes +++ b/python-packaging.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 1 07:44:59 UTC 2022 - Ben Greiner + +- BuildIgnore python3-packaging for primary bootstrap. + ------------------------------------------------------------------- Thu Jul 21 11:16:04 UTC 2022 - Ben Greiner diff --git a/python-packaging.spec b/python-packaging.spec index a0657df..37d357a 100644 --- a/python-packaging.spec +++ b/python-packaging.spec @@ -27,7 +27,7 @@ %define pprefix %{primary_python} %define pythons %{primary_python} # Avoid cycle with python-rpm-packaging requiring python3-packaging -#!BuildIgnore: %{primary_python}-packaging +#!BuildIgnore: python3-packaging %endif %if "%{flavor}" == "" # The rest is in Ring1