SHA256
1
0
forked from pool/python-wheel

- 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
This commit is contained in:
Tomáš Chvátal 2019-06-17 10:41:51 +00:00 committed by Git OBS Bridge
parent 576c33df63
commit d756796177
3 changed files with 27 additions and 1 deletions

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jun 17 10:35:46 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- 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 <tchvatal@suse.com>

View File

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