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

- Split build and tests in _multibuild in order to avoid depcycle

OBS-URL: https://build.opensuse.org/request/show/925175
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-tomli?expand=0&rev=4
This commit is contained in:
Matej Cepl 2021-10-13 19:35:30 +00:00 committed by Git OBS Bridge
parent f14a60c5d4
commit 428bc89be3
3 changed files with 26 additions and 3 deletions

3
_multibuild Normal file
View File

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

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Oct 13 19:20:13 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Split build and tests in _multibuild in order to avoid depcycle
-------------------------------------------------------------------
Sun Oct 3 19:30:44 UTC 2021 - Ben Greiner <code@bnavigator.de>

View File

@ -16,6 +16,14 @@
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%{?!python_module:%define python_module() python3-%{**}}
%define skip_python2 1
Name: python-tomli
@ -26,11 +34,14 @@ License: MIT
URL: https://github.com/hukkin/tomli
# prefer github archive over pypi sdist for pacakged tests
Source: https://github.com/hukkin/tomli/archive/refs/tags/%{version}.tar.gz#/tomli-%{version}-gh.tar.gz
%if !%{with test}
BuildRequires: %{python_module flit-core}
BuildRequires: %{python_module pip}
%else
BuildRequires: %{python_module pytest-randomly}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module python-dateutil}
%endif
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildArch: noarch
@ -42,6 +53,7 @@ Tomli is a Python library for parsing TOML
%prep
%setup -q -n tomli-%{version}
%if ! %{with test}
%build
%pyproject_wheel
@ -49,13 +61,16 @@ Tomli is a Python library for parsing TOML
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pytest
%files %{python_files}
%license LICENSE
%doc README.md
%{python_sitelib}/tomli
%{python_sitelib}/tomli-%{version}*-info
%else
%check
%pytest
%endif
%changelog