forked from pool/python-graphviz
Accepting request 1131503 from devel:languages:python
- add python312-syntax-warning.patch for python 3.12 support OBS-URL: https://build.opensuse.org/request/show/1131503 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-graphviz?expand=0&rev=15
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Dec 6 22:22:48 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- add python312-syntax-warning.patch for python 3.12 support
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 21 12:25:49 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
30
python312-syntax-warning.patch
Normal file
30
python312-syntax-warning.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
From 5ce9fc5de4f2284baa27d7a8d68ab0885d032868 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Bank <sebastian.bank@uni-leipzig.de>
|
||||
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}'
|
||||
Reference in New Issue
Block a user