From 428bc89be39a8e7594c2d45fc69d39e8c308c4d309d74488bdb30acb11adf2e1 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 13 Oct 2021 19:35:30 +0000 Subject: [PATCH] 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 --- _multibuild | 3 +++ python-tomli.changes | 5 +++++ python-tomli.spec | 21 ++++++++++++++++++--- 3 files changed, 26 insertions(+), 3 deletions(-) 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-tomli.changes b/python-tomli.changes index 462369c..15d363c 100644 --- a/python-tomli.changes +++ b/python-tomli.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Oct 13 19:20:13 UTC 2021 - Ben Greiner + +- Split build and tests in _multibuild in order to avoid depcycle + ------------------------------------------------------------------- Sun Oct 3 19:30:44 UTC 2021 - Ben Greiner diff --git a/python-tomli.spec b/python-tomli.spec index 941aee7..ce6104c 100644 --- a/python-tomli.spec +++ b/python-tomli.spec @@ -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