diff --git a/0001-doc-use-add_object_type-instead-of-deprecated-add_de.patch b/0001-doc-use-add_object_type-instead-of-deprecated-add_de.patch deleted file mode 100644 index b1df15e..0000000 --- a/0001-doc-use-add_object_type-instead-of-deprecated-add_de.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 8af04cf9a996eabdae67258e8b0590341ddc4971 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= -Date: Thu, 4 Apr 2019 16:47:47 +0200 -Subject: [PATCH] doc: use add_object_type() instead of deprecated - add_description_unit() - -This is necessary to build the docs with sphinx-2.x. - -sphinx-2.0 removed the deprecated function. -See https://bugs.python.org/issue34967 for similar changes in cpython. ---- - doc/source/conf.py | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/doc/source/conf.py b/doc/source/conf.py -index 07e67378c0..230bbdcbef 100644 ---- a/doc/source/conf.py -+++ b/doc/source/conf.py -@@ -190,7 +190,7 @@ def parse_event(env, sig, signode): - def setup(app): - from sphinx.ext.autodoc import cut_lines - app.connect('autodoc-process-docstring', cut_lines(4, what=['module'])) -- app.add_description_unit('directive', 'dir', 'pair: %s; directive', parse_directive) -- app.add_description_unit('role', 'role', 'pair: %s; role', parse_role) -- app.add_description_unit('confval', 'confval', 'pair: %s; configuration value') -- app.add_description_unit('event', 'event', 'pair: %s; event', parse_event) -+ app.add_object_type('directive', 'dir', 'pair: %s; directive', parse_directive) -+ app.add_object_type('role', 'role', 'pair: %s; role', parse_role) -+ app.add_object_type('confval', 'confval', 'pair: %s; configuration value') -+ app.add_object_type('event', 'event', 'pair: %s; event', parse_event) diff --git a/027d11ddba.patch b/027d11ddba.patch new file mode 100644 index 0000000..5311c30 --- /dev/null +++ b/027d11ddba.patch @@ -0,0 +1,22 @@ +From 027d11ddbad14c1ed41b2661f47ca76e39723d45 Mon Sep 17 00:00:00 2001 +From: Shaun Jackman +Date: Thu, 1 Nov 2018 16:29:26 -0700 +Subject: [PATCH] Fix graphviz_wrap.c _wrap_agwrite for Pypy3 + +--- + pygraphviz/graphviz_wrap.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pygraphviz/graphviz_wrap.c b/pygraphviz/graphviz_wrap.c +index 3b0b75d..adf0411 100644 +--- a/pygraphviz/graphviz_wrap.c ++++ b/pygraphviz/graphviz_wrap.c +@@ -3537,7 +3537,7 @@ SWIGINTERN PyObject *_wrap_agwrite(PyObject *SWIGUNUSEDPARM(self), PyObject *arg + } + #endif + mode_obj2 = PyObject_GetAttrString(obj1, "mode"); +-#if !defined(PYPY_VERSION) ++#if PY_VERSION_HEX >= 0x03000000 + mode_byte_obj2 = PyUnicode_AsUTF8String(mode_obj2); + #else + mode_byte_obj2 = mode_obj2; diff --git a/5ea579e2bc.patch b/5ea579e2bc.patch new file mode 100644 index 0000000..bfdb9cd --- /dev/null +++ b/5ea579e2bc.patch @@ -0,0 +1,38 @@ +From 5ea579e2bce2c97563ff778a9b3336c7b9051f3d Mon Sep 17 00:00:00 2001 +From: Sindre Hansen +Date: Thu, 21 Feb 2019 10:12:44 +0100 +Subject: [PATCH] Fix deprecation warnings + +Fixes the following deprecation warnings: + +DeprecationWarning: Using or importing the ABCs from 'collections' +instead of from 'collections.abc' is deprecated, and in 3.8 it will +stop working + +DeprecationWarning: invalid escape sequence \s +--- + pygraphviz/agraph.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pygraphviz/agraph.py b/pygraphviz/agraph.py +index 8f72024..35c9d58 100644 +--- a/pygraphviz/agraph.py ++++ b/pygraphviz/agraph.py +@@ -17,7 +17,7 @@ + import sys + import threading + import warnings +-from collections import MutableMapping ++from collections.abc import MutableMapping + + from . import graphviz as gv + +@@ -141,7 +141,7 @@ def __init__(self, thing=None, + elif hasattr(thing, 'own'): # a Swig pointer - graph handle + handle = thing + elif is_string_like(thing): +- pattern = re.compile('(strict)?\s*(graph|digraph).*{.*}\s*', ++ pattern = re.compile(r'(strict)?\s*(graph|digraph).*{.*}\s*', + re.DOTALL) + if pattern.match(thing): + string = thing # this is a dot format graph in a string diff --git a/8af04cf9a9.patch b/8af04cf9a9.patch new file mode 100644 index 0000000..e0ed95e --- /dev/null +++ b/8af04cf9a9.patch @@ -0,0 +1,30 @@ +From 8af04cf9a996eabdae67258e8b0590341ddc4971 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Thu, 4 Apr 2019 16:47:47 +0200 +Subject: [PATCH] doc: use add_object_type() instead of deprecated + add_description_unit() + +This is necessary to build the docs with sphinx-2.x. + +sphinx-2.0 removed the deprecated function. +See https://bugs.python.org/issue34967 for similar changes in cpython. +--- + doc/source/conf.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/doc/source/conf.py b/doc/source/conf.py +index 07e6737..230bbdc 100644 +--- a/doc/source/conf.py ++++ b/doc/source/conf.py +@@ -190,7 +190,7 @@ def parse_event(env, sig, signode): + def setup(app): + from sphinx.ext.autodoc import cut_lines + app.connect('autodoc-process-docstring', cut_lines(4, what=['module'])) +- app.add_description_unit('directive', 'dir', 'pair: %s; directive', parse_directive) +- app.add_description_unit('role', 'role', 'pair: %s; role', parse_role) +- app.add_description_unit('confval', 'confval', 'pair: %s; configuration value') +- app.add_description_unit('event', 'event', 'pair: %s; event', parse_event) ++ app.add_object_type('directive', 'dir', 'pair: %s; directive', parse_directive) ++ app.add_object_type('role', 'role', 'pair: %s; role', parse_role) ++ app.add_object_type('confval', 'confval', 'pair: %s; configuration value') ++ app.add_object_type('event', 'event', 'pair: %s; event', parse_event) diff --git a/bb61823fdf.patch b/bb61823fdf.patch new file mode 100644 index 0000000..593bd70 --- /dev/null +++ b/bb61823fdf.patch @@ -0,0 +1,29 @@ +From bb61823fdfe3c7ab67b2db6c04b2ba66a856c091 Mon Sep 17 00:00:00 2001 +From: Sindre Hansen +Date: Thu, 21 Feb 2019 10:27:00 +0100 +Subject: [PATCH] Add special import case for python 2.7 + +Python 2.7 still needs to import directly from collections and not +from collections.abc as Python 3.* should. +--- + pygraphviz/agraph.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/pygraphviz/agraph.py b/pygraphviz/agraph.py +index 35c9d58..d468aa4 100644 +--- a/pygraphviz/agraph.py ++++ b/pygraphviz/agraph.py +@@ -17,7 +17,12 @@ + import sys + import threading + import warnings +-from collections.abc import MutableMapping ++try: ++ # Python 3 ++ from collections.abc import MutableMapping ++except ImportError: ++ # Python 2.7 ++ from collections import MutableMapping + + from . import graphviz as gv + diff --git a/python-pygraphviz.spec b/python-pygraphviz.spec index 04eea64..1b56f56 100644 --- a/python-pygraphviz.spec +++ b/python-pygraphviz.spec @@ -1,6 +1,6 @@ Name: python-pygraphviz Version: 1.5 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Create and Manipulate Graphs and Networks License: BSD URL: http://networkx.lanl.gov/pygraphviz/ @@ -9,8 +9,10 @@ Source0: https://github.com/pygraphviz/pygraphviz/archive/pygraphviz-%{ve # https://github.com/pygraphviz/pygraphviz Patch0: pygraphviz-swig.patch -# https://github.com/pygraphviz/pygraphviz/pull/191 -Patch0001: 0001-doc-use-add_object_type-instead-of-deprecated-add_de.patch +Patch0001: https://github.com/pygraphviz/pygraphviz/commit/027d11ddba.patch +Patch0002: https://github.com/pygraphviz/pygraphviz/commit/5ea579e2bc.patch +Patch0003: https://github.com/pygraphviz/pygraphviz/commit/bb61823fdf.patch +Patch0004: https://github.com/pygraphviz/pygraphviz/commit/8af04cf9a9.patch BuildRequires: gcc BuildRequires: python3-devel @@ -86,6 +88,9 @@ chmod g-w %{buildroot}%{python3_sitearch}/pygraphviz/_graphviz.*.so %license LICENSE %changelog +* Wed Jan 22 2020 Zbigniew Jędrzejewski-Szmek - 1.5-8 +- Fix build under python3.9 (#1792949) and pypy + * Thu Oct 03 2019 Miro Hrončok - 1.5-7 - Rebuilt for Python 3.8.0rc1 (#1748018)