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-semantic_version.changes b/python-semantic_version.changes index 04e925f..a6fa982 100644 --- a/python-semantic_version.changes +++ b/python-semantic_version.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Dec 6 07:58:52 UTC 2021 - Dirk Müller + +- split tests into flavor to avoid build cycle with djang + ------------------------------------------------------------------- Wed Jul 29 13:46:19 UTC 2020 - Marketa Calabkova diff --git a/python-semantic_version.spec b/python-semantic_version.spec index 3a2fdd2..97189fc 100644 --- a/python-semantic_version.spec +++ b/python-semantic_version.spec @@ -1,7 +1,7 @@ # # spec file for package python-semantic_version # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -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-semantic_version Version: 2.8.5 Release: 0 @@ -25,8 +33,10 @@ License: BSD-2-Clause Group: Development/Languages/Python URL: https://github.com/rbarrois/python-semanticversion Source: https://files.pythonhosted.org/packages/source/s/semantic_version/semantic_version-%{version}.tar.gz +%if %{with test} BuildRequires: %{python_module Django >= 1.11} BuildRequires: %{python_module pytest} +%endif BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -44,15 +54,21 @@ It follows strictly the 2.0.0 version of the SemVer scheme. %python_build %install +%if !%{with test} %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} +%endif +%if %{with test} %check %pytest +%else + %files %{python_files} %license LICENSE %doc README.rst ChangeLog %{python_sitelib}/* +%endif %changelog