15
0

- Switch to multibuild to not cycle during testing

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-opencensus?expand=0&rev=3
This commit is contained in:
Tomáš Chvátal
2020-03-10 11:27:36 +00:00
committed by Git OBS Bridge
parent 106cbdd7c9
commit f0df136a87
3 changed files with 31 additions and 6 deletions

View File

@@ -17,19 +17,22 @@
%{?!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
%bcond_without python2
Name: python-opencensus
Name: python-opencensus%{psuffix}
Version: 0.7.7
Release: 0
Summary: A stats collection and distributed tracing framework
License: Apache-2.0
URL: https://github.com/census-instrumentation/opencensus-python
Source: https://github.com/census-instrumentation/opencensus-python/archive/v%{version}.tar.gz
BuildRequires: %{python_module google-api-core >= 1.0.0}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module opencensus-context >= 0.1.1}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module retrying}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@@ -37,6 +40,14 @@ Requires: python-google-api-core < 2.0.0
Requires: python-google-api-core >= 1.0.0
Requires: python-opencensus-context >= 0.1.1
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module google-api-core >= 1.0.0}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module opencensus >= %{version}}
BuildRequires: %{python_module opencensus-context >= 0.1.1}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module retrying}
%endif
%if %{with python2}
BuildRequires: python-unittest2
%endif
@@ -58,15 +69,21 @@ sed -i -e 's:==:>=:g' setup.py
%python_build
%install
%if !%{with test}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%check
%if %{with test}
%pytest tests/unit
%endif
%if !%{with test}
%files %{python_files}
%doc CHANGELOG.md README.rst
%license LICENSE
%{python_sitelib}/*
%endif
%changelog