File python-stackviz.spec of Package python-stackviz

#
# spec file for package python-stackviz
#
# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 https://bugs.opensuse.org/
#


%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~dev307
Release:        0
Summary:        Visualization utility
License:        Apache-2.0
URL:            http://git.openstack.org/cgit/openstack/stackviz
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
%endif
%if 0%{?with_tests}
BuildRequires:  python3-docutils
%endif

%description
%{common_desc}

%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
%endif

%description -n python3-stackviz
%{common_desc}

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

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

%prep
%autosetup -n stackviz-0.0.1.dev307
%py_req_cleanup

%build
%{py3_build}

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

%install
%{py3_install}

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

%files -n python3-stackviz
%license LICENSE
%{_bindir}/stackviz-export
%{python3_sitelib}/stackviz
%{python3_sitelib}/stackviz-*.egg-info

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

%changelog