File python-stackviz.spec of Package python-stackviz

# spec file for package python-stackviz
# Copyright (c) 2020 SUSE LLC
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%global common_desc \
A visualization utility to help analyze the performance of \
DevStack setup and Tempest executions
%global with_doc 1
%global with_tests 1
Name:           python-stackviz
Version:        0.0.1~dev326
Release:        0
Summary:        Visualization utility
License:        Apache-2.0
Source0:        stackviz-master.tar.gz
BuildRequires:  openstack-macros
BuildRequires:  python3-devel
BuildRequires:  python3-oslotest
BuildRequires:  python3-python-subunit
BuildRequires:  python3-stestr
BuildRequires:  python3-testrepository
BuildRequires:  python3-testtools
BuildArch:      noarch
%if 0%{?rdo}
Requires:       python3-subunit2sql
%if 0%{?with_tests}
BuildRequires:  python3-docutils


%package -n python3-stackviz
Summary:        Visualization utility
Requires:       python3-python-subunit
Requires:       python3-six
Requires:       python3-testrepository
Requires:       python3-testtools
%if 0%{?rdo}
Requires:       python3-subunit2sql

%description -n python3-stackviz

This package contains the Python 3.x module.

%if 0%{?with_doc}
%package -n python-stackviz-doc
Summary:        Documentation for stackviz
BuildRequires:  python3-Sphinx
BuildRequires:  python3-openstackdocstheme
BuildRequires:  python3-sphinxcontrib-svg2pdfconverter

%description -n python-stackviz-doc
It contains the documentation for the stackviz.

%autosetup -n stackviz-0.0.1.dev326


# Generate Docs
%if 0%{?with_doc}
export PYTHONPATH="$( pwd ):$PYTHONPATH"
PBR_VERSION=0.0.1.dev326 %sphinx_build -b html doc/source doc/build/html
# remove the sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}


%if 0%{?with_tests}
export OS_TEST_PATH=./stackviz/tests
python3 -m stestr.cli run

%files -n python3-stackviz
%license LICENSE

%if 0%{?with_doc}
%files -n python-stackviz-doc
%license LICENSE
%doc doc/build/html