# # spec file for package python-pygraphviz # # Copyright (c) 2025 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/ # %global flavor %{nil} %if "%{flavor}" == "doc" %define psuffix -doc %bcond_without doc %else %define psuffix %{nil} %bcond_with doc %endif %{?sle15_python_module_pythons} Name: python-pygraphviz%{psuffix} Version: 1.14 Release: 2.3 Summary: Python interface to Graphviz License: BSD-3-Clause URL: https://github.com/pygraphviz/pygraphviz 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} BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} 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 %if %{with doc} BuildRequires: %{python_module Sphinx} BuildRequires: %{python_module matplotlib} BuildRequires: %{python_module numpydoc} BuildRequires: %{python_module pydata-sphinx-theme} BuildRequires: %{python_module pygraphviz = %{version}} BuildRequires: %{python_module sphinx-gallery} BuildArch: noarch %endif 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}" %if ! %{with doc} %pyproject_wheel %else make -C doc html %endif %install export CFLAGS="%{optflags}" %if ! %{with doc} %pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitearch} # Don't ship swig source %python_expand rm %{buildroot}%{$python_sitearch}/pygraphviz/graphviz_wrap.c %else mkdir -p %{buildroot}%{_docdir}/pygraphviz-%{version} cp -ar doc/build/html/* %{buildroot}%{_docdir}/pygraphviz-%{version} %endif %if ! %{with doc} %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)" popd rm -rf $tmpdir %endif %if ! %{with doc} %files %{python_files} %license LICENSE %doc README.rst %{python_sitearch}/pygraphviz %{python_sitearch}/pygraphviz-%{version}.dist-info %endif %if %{with doc} %files -n %{name} %license LICENSE %{_docdir}/pygraphviz-%{version} %endif %changelog * Thu Feb 27 2025 ecsos - Make it compatible wirh %%{?sle15_python_module_pythons}. * Tue Oct 1 2024 Dirk Müller - update 1.14: * Avoid subprocess window creation with agraph.AGraph._run_prog (#514). * Support Python 3.13 (#542). * AGraph.draw(): close filehandle for pathlib.Path (#535). * Fix formatting (#538). * Test on Python 3.13 (#539). * Use ruff and update pre-commit config (#540). * Thu May 23 2024 Steve Kowalik - 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, and do so in its own flavor. - Switch to pyproject macros. * Thu Jun 29 2023 Andreas Schneider - Update to version 1.11 * Update to SWIG 4.1.1 * Require Graphviz 2.46+ * Fix passthrough of graph attributes when copying * Update install instructions * Tue Jun 13 2023 ecsos - Add %%{?sle15_python_module_pythons} * Thu Feb 23 2023 Daniel Garcia - Add test_drawing_png_output_with_NULL_smoketest to the list of tests to skip because missing png support. gh#pygraphviz/pygraphviz#366 * Fri Feb 17 2023 Dirk Müller - fix dependencies for distros older than tumbleweed * Sun Aug 14 2022 Arun Persaud - specfile: * update copyright year - update to version 1.9: * Drop Python 3.7 support * Add Python 3.10 support * Add osage and patchwork to progs list * Add IPython rich display hook to AGraph class * Add contributor guide * Fixed directed nature of AGraph.copy() * Minor documentation and code fixes * Tue Oct 19 2021 Matej Cepl - Update to 1.7: - Drop Python 3.6 support - Add Python 3.9 support - Require Graphviz 2.42+, (Graphviz 2.46+ recommended) - Improve installation process and documentation - Switch from nose to pytest - Remove old Python 2 code - AGraph.eq includes attribute comparison (PR #246) * Mon Sep 28 2020 Dirk Mueller - update to 1.6: - Add Python 3.8 support - Drop Python 2.7 support - Update to SWIG 4.0.1 * Tue May 14 2019 Marketa Calabkova - Update to 1.5 * Python 3.7 support * Sun Aug 6 2017 toddrme2178@gmail.com - Fix shebangs * Wed May 17 2017 toddrme2178@gmail.com - Implement single-spec version - Fix source URL - Update to version 1.4rc1 * No upstream changelog * Wed Jun 15 2016 toddrme2178@gmail.com - Update to 1.3.1 - Update manifest to include missing files - Update to 1.3 - Python 3 support - Encoding bugfixes - Rebase docdir.patch * Fri Mar 28 2014 speilicke@suse.com - Set license to BSD-3-Clause according to legal * Fri Dec 6 2013 toddrme2178@gmail.com - Update to 1.2 * Quote Graphviz program names to work with space (Windows fix) * Keep name in reverse() - Require graphviz-python * Wed May 23 2012 toddrme2178@gmail.com - Clean up spec file - Update to version 1.1 * Added unicode support for handling non-ASCII characters * Better handling of user data on initialization of AGraph() object to guess input type (AGraph object, file, dict-of-dicts, file) * Add sfdp to layout options - Update to version 1..0.0 * Added to_string() and from_string methods * Interface to graphviz “acyclic” and “tred” * Better handling of user data on initialization of AGraph() object to guess input type (AGraph object, file, dict-of-dicts, file) * Add handling of default attributes for subgraphs * Improved error handling when using non-string data * Fix bug in default attribute handling * Make sure file handles are closed correctly * Sat Mar 26 2011 alexandre@exatati.com.br - Regenerate spec file with py2pack; - Bzip2 source code; - Add docdir.patch to fix documentation path. * Fri Oct 9 2009 alexandre@exatati.com.br - Initial package (0.99.1) for openSUSE.