diff --git a/python-graphviz.changes b/python-graphviz.changes index c50c6c7..86489d7 100644 --- a/python-graphviz.changes +++ b/python-graphviz.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Dec 6 22:22:48 UTC 2023 - Dirk Müller + +- add python312-syntax-warning.patch for python 3.12 support + ------------------------------------------------------------------- Fri Apr 21 12:25:49 UTC 2023 - Dirk Müller diff --git a/python-graphviz.spec b/python-graphviz.spec index 7884e1a..0aad545 100644 --- a/python-graphviz.spec +++ b/python-graphviz.spec @@ -25,6 +25,7 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/xflr6/graphviz Source: https://files.pythonhosted.org/packages/source/g/graphviz/graphviz-%{version}.zip +Patch1: python312-syntax-warning.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module pytest >= 6} BuildRequires: %{python_module pytest-mock >= 3} @@ -56,7 +57,7 @@ inspected with its default application. Graphs can also be rendered and displayed within IPython notebooks. %prep -%autosetup -n graphviz-%{version} +%autosetup -p1 -n graphviz-%{version} sed -i '/--cov/d' setup.cfg sed -i '/^mock_use_standalone_module/d' setup.cfg diff --git a/python312-syntax-warning.patch b/python312-syntax-warning.patch new file mode 100644 index 0000000..efc1d4c --- /dev/null +++ b/python312-syntax-warning.patch @@ -0,0 +1,30 @@ +From 5ce9fc5de4f2284baa27d7a8d68ab0885d032868 Mon Sep 17 00:00:00 2001 +From: Sebastian Bank +Date: Tue, 24 Oct 2023 20:39:52 +0200 +Subject: [PATCH] expect SyntaxWarning in test_deprecated_escape() under Python + 3.12 + +https://docs.python.org/3.12/whatsnew/3.12.html#other-language-changes +--- + tests/test_quoting.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +Index: graphviz-0.20.1/tests/test_quoting.py +=================================================================== +--- graphviz-0.20.1.orig/tests/test_quoting.py ++++ graphviz-0.20.1/tests/test_quoting.py +@@ -1,3 +1,4 @@ ++import sys + import warnings + + import pytest +@@ -14,7 +15,8 @@ def test_deprecated_escape(recwarn, char + escape = eval(rf'"\{char}"') + + assert len(recwarn) == 1 +- w = recwarn.pop(DeprecationWarning) ++ w = recwarn.pop(DeprecationWarning if sys.version_info < (3, 12) ++ else SyntaxWarning) + assert str(w.message).startswith('invalid escape sequence') + + assert escape == f'\\{char}'