From cd821b8dc39c5dc11aa3036e6169eb48f4f3aac939aa62f56db231bda53561ab Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 10 Nov 2020 12:57:57 +0000 Subject: [PATCH 1/7] Accepting request 847489 from home:mcepl:branches:devel:languages:python - Add wheel subpackage with the generated wheel for this package. OBS-URL: https://build.opensuse.org/request/show/847489 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=201 --- python-setuptools.changes | 5 +++++ python-setuptools.spec | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/python-setuptools.changes b/python-setuptools.changes index 9c36e5c..db0a5c3 100644 --- a/python-setuptools.changes +++ b/python-setuptools.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 10 09:21:02 UTC 2020 - Matej Cepl + +- Add wheel subpackage with the generated wheel for this package. + ------------------------------------------------------------------- Thu Aug 13 11:03:41 UTC 2020 - Ondřej Súkup diff --git a/python-setuptools.spec b/python-setuptools.spec index 70168b2..e14d8f4 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -22,9 +22,11 @@ %if "%{flavor}" == "test" %define psuffix -test %bcond_without test +%bcond_with wheel %else %define psuffix %{nil} %bcond_with test +%bcond_without wheel %endif %bcond_without python2 Name: python-setuptools%{psuffix} @@ -32,6 +34,7 @@ Version: 44.1.1 Release: 0 Summary: Enhancements to distutils for building and distributing Python packages License: MIT +Group: Development/Languages/Python URL: https://github.com/pypa/setuptools Source: https://files.pythonhosted.org/packages/source/s/setuptools/setuptools-%{version}.zip Source3: testdata.tar.gz @@ -80,6 +83,9 @@ Recommends: ca-certificates-mozilla Provides: %{oldpython}-distribute = %{version} Obsoletes: %{oldpython}-distribute < %{version} %endif +%if %{with wheel} +BuildRequires: %{python_module wheel} +%endif %python_subpackages %description @@ -87,6 +93,16 @@ setuptools is a collection of enhancements to the Python distutils that allow you to build and distribute Python packages, especially ones that have dependencies on other packages. +%if %{with wheel} +%package wheel +Summary: Wheels for %{name} +Group: Development/Languages/Python +BuildArch: noarch + +%description wheel +Generated wheels for %{name}. +%endif + %prep %setup -q -n setuptools-%{version} tar -xzvf %{SOURCE3} @@ -122,11 +138,19 @@ find ./ -type f -name \*.py -exec sed -i \ %build %python_build +%if %{with wheel} +%python_exec setup.py bdist_wheel --universal +%endif %install %if !%{with test} %python_install %prepare_alternative easy_install + +%if %{with wheel} +%python_expand install -D -m 0644 -t %{buildroot}%{$python_sitelib}/../wheels dist/*.whl +%endif + %python_expand %fdupes %{buildroot}%{$python_sitelib} %endif @@ -159,4 +183,10 @@ export PYTHONPATH=$(pwd) %{python_sitelib}/pkg_resources/* %endif +%if %{with wheel} +%files %{python_files wheel} +%dir %{python_sitelib}/../wheels +%{python_sitelib}/../wheels/* +%endif + %changelog From d736a7a77c49e5ae3058de68a344dbf8f8329d155e23168e831077cd276a2182 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 12 Nov 2020 16:09:42 +0000 Subject: [PATCH 2/7] - Make wheel a separate build run to avoid the setuptools/wheel build cycle. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=202 --- _multibuild | 1 + python-setuptools.changes | 6 ++++++ python-setuptools.spec | 18 ++++++++++++------ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/_multibuild b/_multibuild index fcc7b97..6222fa7 100644 --- a/_multibuild +++ b/_multibuild @@ -1,3 +1,4 @@ test + wheel diff --git a/python-setuptools.changes b/python-setuptools.changes index db0a5c3..ee95dd9 100644 --- a/python-setuptools.changes +++ b/python-setuptools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Nov 12 16:09:08 UTC 2020 - Matej Cepl + +- Make wheel a separate build run to avoid the setuptools/wheel build + cycle. + ------------------------------------------------------------------- Tue Nov 10 09:21:02 UTC 2020 - Matej Cepl diff --git a/python-setuptools.spec b/python-setuptools.spec index e14d8f4..a93f0ff 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -24,10 +24,15 @@ %bcond_without test %bcond_with wheel %else +%if "%{flavor}" == "wheel" +%define psuffix -wheel +%bcond_without wheel +%else %define psuffix %{nil} %bcond_with test %bcond_without wheel %endif +%endif %bcond_without python2 Name: python-setuptools%{psuffix} Version: 44.1.1 @@ -137,21 +142,22 @@ find ./ -type f -name \*.py -exec sed -i \ {} \; %build +%if ! %{with wheel} %python_build -%if %{with wheel} +%else %python_exec setup.py bdist_wheel --universal %endif %install -%if !%{with test} +%if !%{with test} && !%{with wheel} %python_install %prepare_alternative easy_install -%if %{with wheel} -%python_expand install -D -m 0644 -t %{buildroot}%{$python_sitelib}/../wheels dist/*.whl +%python_expand %fdupes %{buildroot}%{$python_sitelib} %endif -%python_expand %fdupes %{buildroot}%{$python_sitelib} +%if %{with wheel} +%python_expand install -D -m 0644 -t %{buildroot}%{$python_sitelib}/../wheels dist/*.whl %endif %check @@ -164,7 +170,7 @@ export PYTHONPATH=$(pwd) %pytest -k 'not (test_clean_env_install or test_pip_upgrade_from_source or test_test_command_install_requirements or test_no_missing_dependencies)' %endif -%if !%{with test} +%if !%{with test} && !%{with wheel} %post %python_install_alternative easy_install From 309a0e84ee04cd21f53ce2134e92fc00932fac1a45b980c9fd5fa3b1751e98bb Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 12 Nov 2020 16:15:14 +0000 Subject: [PATCH 3/7] Clean up OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=203 --- python-setuptools.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python-setuptools.spec b/python-setuptools.spec index a93f0ff..3a6fc21 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -39,7 +39,6 @@ Version: 44.1.1 Release: 0 Summary: Enhancements to distutils for building and distributing Python packages License: MIT -Group: Development/Languages/Python URL: https://github.com/pypa/setuptools Source: https://files.pythonhosted.org/packages/source/s/setuptools/setuptools-%{version}.zip Source3: testdata.tar.gz @@ -101,7 +100,7 @@ especially ones that have dependencies on other packages. %if %{with wheel} %package wheel Summary: Wheels for %{name} -Group: Development/Languages/Python +BuildRequires: %{python_module setuptools = %{version}-%{release}} BuildArch: noarch %description wheel From 971e8341f5c5b2b55555d6336a29b67f9e0881c40d7be16ec6b40608d64766fe Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 12 Nov 2020 16:18:24 +0000 Subject: [PATCH 4/7] Fix SPEC OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=204 --- python-setuptools.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-setuptools.spec b/python-setuptools.spec index 3a6fc21..4369371 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -100,7 +100,7 @@ especially ones that have dependencies on other packages. %if %{with wheel} %package wheel Summary: Wheels for %{name} -BuildRequires: %{python_module setuptools = %{version}-%{release}} +Requires: %{python_module setuptools = %{version}-%{release}} BuildArch: noarch %description wheel From ed29718a36ff9650926c1e166cc968cc6f715dde8ae1e658cb20ef27d082cc20 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 12 Nov 2020 16:18:43 +0000 Subject: [PATCH 5/7] Fix SPEC OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=205 --- python-setuptools.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/python-setuptools.spec b/python-setuptools.spec index 4369371..8f687c4 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -100,7 +100,6 @@ especially ones that have dependencies on other packages. %if %{with wheel} %package wheel Summary: Wheels for %{name} -Requires: %{python_module setuptools = %{version}-%{release}} BuildArch: noarch %description wheel From 6e0b8f18663f53e2e5e2ca64b93c96e10d18efe98f63984dd168881c3c124ea1 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 13 Nov 2020 18:53:22 +0000 Subject: [PATCH 6/7] Fix changes OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=206 --- python-setuptools.changes | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python-setuptools.changes b/python-setuptools.changes index ee95dd9..1baff30 100644 --- a/python-setuptools.changes +++ b/python-setuptools.changes @@ -7,7 +7,8 @@ Thu Nov 12 16:09:08 UTC 2020 - Matej Cepl ------------------------------------------------------------------- Tue Nov 10 09:21:02 UTC 2020 - Matej Cepl -- Add wheel subpackage with the generated wheel for this package. +- Add wheel subpackage with the generated wheel for this package + (bsc#1176262, CVE-2019-20916). ------------------------------------------------------------------- Thu Aug 13 11:03:41 UTC 2020 - Ondřej Súkup From 3195338bfe91500f1bef5352b0f48897f8a2644dc09d916296bc482eef014d46 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 16 Nov 2020 14:03:11 +0000 Subject: [PATCH 7/7] - Avoid duplicite wheel name in the generated package, and we actually don't need a subpackage at all. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=207 --- python-setuptools.changes | 6 ++++++ python-setuptools.spec | 14 +++----------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/python-setuptools.changes b/python-setuptools.changes index 1baff30..18fb506 100644 --- a/python-setuptools.changes +++ b/python-setuptools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Nov 16 14:02:34 UTC 2020 - Matej Cepl + +- Avoid duplicite wheel name in the generated package, and we actually + don't need a subpackage at all. + ------------------------------------------------------------------- Thu Nov 12 16:09:08 UTC 2020 - Matej Cepl diff --git a/python-setuptools.spec b/python-setuptools.spec index 8f687c4..95f4812 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -30,7 +30,7 @@ %else %define psuffix %{nil} %bcond_with test -%bcond_without wheel +%bcond_with wheel %endif %endif %bcond_without python2 @@ -97,15 +97,6 @@ setuptools is a collection of enhancements to the Python distutils that allow you to build and distribute Python packages, especially ones that have dependencies on other packages. -%if %{with wheel} -%package wheel -Summary: Wheels for %{name} -BuildArch: noarch - -%description wheel -Generated wheels for %{name}. -%endif - %prep %setup -q -n setuptools-%{version} tar -xzvf %{SOURCE3} @@ -174,8 +165,10 @@ export PYTHONPATH=$(pwd) %postun %python_uninstall_alternative easy_install +%endif %files %{python_files} +%if !%{with test} && !%{with wheel} %license LICENSE %doc CHANGES.rst README.rst %python_alternative %{_bindir}/easy_install @@ -188,7 +181,6 @@ export PYTHONPATH=$(pwd) %endif %if %{with wheel} -%files %{python_files wheel} %dir %{python_sitelib}/../wheels %{python_sitelib}/../wheels/* %endif