summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Torokhov <torokhov-s-a@yandex.ru>2023-10-25 00:15:26 +0300
committerSam James <sam@gentoo.org>2023-10-27 03:30:51 +0100
commit317ab4e8bb5ba745bd0f3748c8d0094b71eccc3f (patch)
tree7ab24ca2cbefb4f5de6d9465c7f81bec5de47d52 /dev-python/graphviz
parentdev-python/graphviz: 0.20.1-r1, fix setup.cfg 'license_file' warning (diff)
downloadgentoo-317ab4e8bb5ba745bd0f3748c8d0094b71eccc3f.tar.gz
gentoo-317ab4e8bb5ba745bd0f3748c8d0094b71eccc3f.tar.bz2
gentoo-317ab4e8bb5ba745bd0f3748c8d0094b71eccc3f.zip
dev-python/graphviz: add PYTHON3_12 and upstream py3.12 patch for tests
Signed-off-by: Sergey Torokhov <torokhov-s-a@yandex.ru> Closes: https://github.com/gentoo/gentoo/pull/33502 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-python/graphviz')
-rw-r--r--dev-python/graphviz/files/graphviz-0.20.1_fix_python3_12_test_deprecated_escape.patch30
-rw-r--r--dev-python/graphviz/graphviz-0.20.1-r1.ebuild6
2 files changed, 35 insertions, 1 deletions
diff --git a/dev-python/graphviz/files/graphviz-0.20.1_fix_python3_12_test_deprecated_escape.patch b/dev-python/graphviz/files/graphviz-0.20.1_fix_python3_12_test_deprecated_escape.patch
new file mode 100644
index 000000000000..0193ef928775
--- /dev/null
+++ b/dev-python/graphviz/files/graphviz-0.20.1_fix_python3_12_test_deprecated_escape.patch
@@ -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(-)
+
+diff --git a/tests/test_quoting.py b/tests/test_quoting.py
+index e4ece573bd..3692d38a12 100644
+--- a/tests/test_quoting.py
++++ b/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}'
diff --git a/dev-python/graphviz/graphviz-0.20.1-r1.ebuild b/dev-python/graphviz/graphviz-0.20.1-r1.ebuild
index 8a9f297fb539..8757908d0fc5 100644
--- a/dev-python/graphviz/graphviz-0.20.1-r1.ebuild
+++ b/dev-python/graphviz/graphviz-0.20.1-r1.ebuild
@@ -4,7 +4,7 @@
EAPI=8
DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..11} )
+PYTHON_COMPAT=( python3_{10..12} )
inherit distutils-r1
@@ -34,6 +34,10 @@ BDEPEND="
)
"
+PATCHES="
+ ${FILESDIR}/${P}_fix_python3_12_test_deprecated_escape.patch
+"
+
distutils_enable_tests pytest
src_prepare() {