From 576c33df636c7929a5883ebccafd010838deb58799540294ec9e04f765b4c6ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Fri, 14 Jun 2019 08:59:53 +0000 Subject: [PATCH 1/3] - Reduce build requires and recommends to what is really needed (hint: almost nothing) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-wheel?expand=0&rev=41 --- python-wheel.changes | 6 ++++++ python-wheel.spec | 34 ++++------------------------------ 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/python-wheel.changes b/python-wheel.changes index 5a9681d..1e8dde7 100644 --- a/python-wheel.changes +++ b/python-wheel.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jun 14 08:59:02 UTC 2019 - Tomáš Chvátal + +- Reduce build requires and recommends to what is really needed + (hint: almost nothing) + ------------------------------------------------------------------- Wed May 15 20:46:24 UTC 2019 - Jonathan Harker diff --git a/python-wheel.spec b/python-wheel.spec index 0aa81b3..169322f 100644 --- a/python-wheel.spec +++ b/python-wheel.spec @@ -25,25 +25,14 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/pypa/wheel Source: https://github.com/pypa/wheel/archive/%{version}.tar.gz#/wheel-%{version}.tar.gz +BuildRequires: %{python_module pytest >= 3.0.0} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-setuptools Requires(post): update-alternatives Requires(postun): update-alternatives -Recommends: python-dirspec -Recommends: python-ed25519ll -Recommends: python-keyring -Recommends: python-keyrings.alt -Recommends: python-pyxdg BuildArch: noarch -# SECTION test -# Not compatible currently, see https://github.com/jaraco/keyrings.alt/issues/20 -#BuildRequires: %%{python_module keyrings.alt} -BuildRequires: %{python_module keyring} -BuildRequires: %{python_module pytest} -BuildRequires: %{python_module pyxdg} -# /SECTION %python_subpackages %description @@ -57,23 +46,9 @@ step (simply extracting the file onto sys.path), and the unpacked archive preserves enough information to "Spread" (copy data and scripts to their final locations) at any later time. -The wheel project provides a bdist_wheel command for setuptools -(requires distribute >= 0.6.34). Wheel files can be -installed with a newer pip from https://github.com/pypa/pip -or with wheel's own command line utility. - -The wheel documentation is at http://wheel.rtfd.org/. The -file format is documented in PEP 427 -(http://www.python.org/dev/peps/pep-0427/). - -The reference implementation is at http://bitbucket.org/dholth/wheel/ - %prep %setup -q -n wheel-%{version} -# Remove addopts as it requires pytest-cov. The reported coverage is not -# nearly near 100%, and setup.cfg doesnt provide a minimum acceptable -# coverage percentage, so coverage is not a metric which can be used -# by automated QA to determine acceptance of the package. +# Remove addopts as it requires pytest-cov sed -i '/addopts = /d' setup.cfg %build @@ -86,9 +61,8 @@ sed -i '/addopts = /d' setup.cfg %check export LC_ALL=en_US.utf8 -%{python_expand rm -rf _build.python2 _build.python3 -PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_version} -rm -rf %{buildroot}%{$python_sitelib}/wheel/test/headers.dist} +export PYTHONDONTWRITEBYTECODE=1 +%pytest %post %python_install_alternative wheel From d756796177699361db5cb5dd56357fd98d1d2146754f9e5c4039d9b0994d1691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 17 Jun 2019 10:41:51 +0000 Subject: [PATCH 2/3] - Switch to mulitbuild to avoid dep on pytest by default (As pytest needs wheel to build itself) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-wheel?expand=0&rev=42 --- _multibuild | 3 +++ python-wheel.changes | 6 ++++++ python-wheel.spec | 19 ++++++++++++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 _multibuild diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/python-wheel.changes b/python-wheel.changes index 1e8dde7..81e673e 100644 --- a/python-wheel.changes +++ b/python-wheel.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jun 17 10:35:46 UTC 2019 - Tomáš Chvátal + +- Switch to mulitbuild to avoid dep on pytest by default + (As pytest needs wheel to build itself) + ------------------------------------------------------------------- Fri Jun 14 08:59:02 UTC 2019 - Tomáš Chvátal diff --git a/python-wheel.spec b/python-wheel.spec index 169322f..f9b6877 100644 --- a/python-wheel.spec +++ b/python-wheel.spec @@ -17,6 +17,14 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%else +%define psuffix %{nil} +%bcond_with test +%endif Name: python-wheel Version: 0.33.4 Release: 0 @@ -25,7 +33,6 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/pypa/wheel Source: https://github.com/pypa/wheel/archive/%{version}.tar.gz#/wheel-%{version}.tar.gz -BuildRequires: %{python_module pytest >= 3.0.0} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -33,6 +40,10 @@ Requires: python-setuptools Requires(post): update-alternatives Requires(postun): update-alternatives BuildArch: noarch +%if %{with test} +BuildRequires: %{python_module pytest >= 3.0.0} +BuildRequires: %{python_module wheel >= %{version}} +%endif %python_subpackages %description @@ -55,15 +66,20 @@ sed -i '/addopts = /d' setup.cfg %python_build %install +%if !%{with test} %python_install %python_clone -a %{buildroot}%{_bindir}/wheel %python_expand %fdupes %{buildroot}%{$python_sitelib} +%endif %check +%if %{with test} export LC_ALL=en_US.utf8 export PYTHONDONTWRITEBYTECODE=1 %pytest +%endif +%if !%{with test} %post %python_install_alternative wheel @@ -76,5 +92,6 @@ export PYTHONDONTWRITEBYTECODE=1 %python_alternative %{_bindir}/wheel %{python_sitelib}/wheel-%{version}-py%{python_version}.egg-info %{python_sitelib}/wheel/ +%endif %changelog From ad1432b299557c451ca824262e315d1e10236a032410266e126084eac2e46c58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 17 Jun 2019 11:09:29 +0000 Subject: [PATCH 3/3] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-wheel?expand=0&rev=43 --- python-wheel.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-wheel.spec b/python-wheel.spec index f9b6877..54fa8c8 100644 --- a/python-wheel.spec +++ b/python-wheel.spec @@ -25,7 +25,7 @@ %define psuffix %{nil} %bcond_with test %endif -Name: python-wheel +Name: python-wheel%{psuffix} Version: 0.33.4 Release: 0 Summary: A built-package format for Python