14
0
Files
python-pygraphviz/python-pygraphviz.spec
Steve Kowalik cd5ebf99f0 - Update to 1.13:
* Remove outdated pystrings.swg (#508).
  * Fix segfault from repr attempting to access attrs on uninitialized
    instance (#520).
  * Add Python 3.12 support (#486).
  * Copy edges keys when copying a graph 
  * Drop Python 3.8 support per SPEC 0 (#465).
  * Drop Python 3.9 support (#487).
  * Update documentation building requirements (#488).
  * Add pyproject.toml (#471).
  * Stop building pdf of the docs (#503).
- Drop patch docdir.patch, no longer needed.
- Build the documentation by hand, since now we need to.
- Switch to pyproject macros.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pygraphviz?expand=0&rev=29
2024-05-22 02:07:23 +00:00

105 lines
3.3 KiB
RPMSpec

#
# spec file for package python-pygraphviz
#
# Copyright (c) 2024 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 https://bugs.opensuse.org/
#
%bcond_without tests
%{?sle15_python_module_pythons}
Name: python-pygraphviz
Version: 1.13
Release: 0
Summary: Python interface to Graphviz
License: BSD-3-Clause
URL: https://pygraphviz.github.io/
Source: https://files.pythonhosted.org/packages/source/p/pygraphviz/pygraphviz-%{version}.tar.gz
# https://github.com/pygraphviz/pygraphviz/issues/532
Source1: https://raw.githubusercontent.com/pygraphviz/pygraphviz/main/examples/README.txt
BuildRequires: %{python_module devel >= 3.10}
# Needed even without tests
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: graphviz-devel >= 2.42
BuildRequires: graphviz-gd
BuildRequires: libpng-devel
BuildRequires: python-rpm-macros
# For building the docs
BuildRequires: python3-Sphinx
BuildRequires: python3-matplotlib
BuildRequires: python3-numpydoc
BuildRequires: python3-pydata-sphinx-theme
BuildRequires: python3-sphinx-gallery
BuildRequires: swig
Requires: graphviz >= 2.42
%if 0%{?suse_version} >= 1550
BuildRequires: pkgconf-pkg-config
%endif
%python_subpackages
%description
A Python wrapper for the Graphviz Agraph data structure.
PyGraphviz can be used to create and draw networks and graphs with Graphviz.
%package -n %{name}-doc
Summary: Documentation for %{name}
Provides: %{python_module pygraphviz-doc = %{version}}
%description -n %{name}-doc
This package provides documentation and help files for %{name}
%prep
%autosetup -p1 -n pygraphviz-%{version}
cp %SOURCE1 examples
%build
export CFLAGS="%{optflags}"
%pyproject_wheel
%install
export CFLAGS="%{optflags}"
%pyproject_install
PYTHONPATH=%{buildroot}%{python3_sitearch} make -C doc html
mkdir -p %{buildroot}%{_docdir}/pygraphviz-%{version}
cp -ar doc/build/html/* %{buildroot}%{_docdir}/pygraphviz-%{version}
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%if %{with tests}
%check
# We don't want to run the tests from the topdir
tmpdir=$(mktemp -d)
cp pygraphviz/tests/* $tmpdir
pushd $tmpdir
# skip tests because of gh#pygraphviz/pygraphviz#366
donttest="test_drawing_makes_file or test_drawing_makes_file1 or test_drawing_makes_file or test_drawing_png_output_with_NULL_smoketest"
%pytest_arch -k "not ($donttest)"
%endif
popd
rm -rf $tmpdir
%files %{python_files}
%license LICENSE
%doc README.rst
%{python_sitearch}/pygraphviz
%{python_sitearch}/pygraphviz-%{version}.dist-info
%files -n %{name}-doc
%license LICENSE
%{_docdir}/pygraphviz-%{version}
%changelog