# Created by pyp2rpm-3.3.0
%global pypi_name graphviz
%global common_description %{expand:
This package facilitates the creation and rendering of graph descriptions in
the DOT language of the Graphviz graph drawing software (master repo) from
Python.
Create a graph object, assemble the graph by adding nodes and edges, and
retrieve its DOT source code string. Save the source code to a file and
render it with the Graphviz installation of your system.}
Name: python-%{pypi_name}
Version: 0.17
Release: %autorelease
# Set Epoch to avoid being obsoleted by graphviz-python
Epoch: 1
Summary: Simple Python interface for Graphviz
License: MIT
URL: https://github.com/xflr6/graphviz
Source0: %{pypi_source %{pypi_name} %{version} zip}
BuildRequires: python3-devel
BuildArch: noarch
%description %{common_description}
%package -n python3-%{pypi_name}
Summary: %{summary}
Requires: graphviz
%description -n python3-%{pypi_name} %{common_description}
%package -n python-%{pypi_name}-doc
Summary: Documentation for %{name}
%description -n python-%{pypi_name}-doc
%{common_description}
This is the documentation package.
%prep
%autosetup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
sed -i 's/\r//' docs/*.rst
sed -i 's/\r//' README.rst
%generate_buildrequires
%pyproject_buildrequires -t -x docs
echo "graphviz"
%build
%pyproject_wheel
# generate html docs
PYTHONPATH=${PWD} sphinx-build-3 docs html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}
%install
%pyproject_install
%pyproject_save_files graphviz
%check
%pytest
%files -n python3-%{pypi_name} -f %{pyproject_files}
%license LICENSE.txt
%doc README.rst
%files -n python-%{pypi_name}-doc
%doc html
%license LICENSE.txt
%changelog
%autochangelog