commit:     b56e983bb5e2ac6565938332d27c865dfc75b8e3
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 20 14:49:07 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Oct 20 14:49:07 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b56e983b

dev-python/zconfig: Enable py3.12

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/zconfig/files/zconfig-4.0-py312.patch | 37 ++++++++++++++++++++++++
 dev-python/zconfig/zconfig-4.0.ebuild            | 12 ++++++--
 2 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/dev-python/zconfig/files/zconfig-4.0-py312.patch 
b/dev-python/zconfig/files/zconfig-4.0-py312.patch
new file mode 100644
index 000000000000..6f8c53ed18a0
--- /dev/null
+++ b/dev-python/zconfig/files/zconfig-4.0-py312.patch
@@ -0,0 +1,37 @@
+From 390ce89cfd4bf1a60d8d67ee20106288cbfa0e51 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20Van=C4=9Bk?= <[email protected]>
+Date: Fri, 23 Jun 2023 08:10:09 +0200
+Subject: [PATCH] Fix tests for Python 3.12 (#91)
+
+In the tests, remove the assertRaisesRegexp method, deprecated since
+Python 3.2, to prevent test failures following the method's removal in
+Python 3.12.
+---
+ src/ZConfig/tests/support.py | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/src/ZConfig/tests/support.py b/src/ZConfig/tests/support.py
+index 959f2b9..559c015 100644
+--- a/src/ZConfig/tests/support.py
++++ b/src/ZConfig/tests/support.py
+@@ -17,7 +17,6 @@
+ import contextlib
+ import os
+ import sys
+-import unittest
+ from io import StringIO
+ from urllib.request import pathname2url
+ 
+@@ -79,12 +78,6 @@ def f2(self):
+ class TestHelper:
+     """Utility methods which can be used with the schema support."""
+ 
+-    # Not derived from unittest.TestCase; some test runners seem to
+-    # think that means this class contains tests.
+-
+-    assertRaisesRegex = getattr(unittest.TestCase, 'assertRaisesRegex',
+-                                unittest.TestCase.assertRaisesRegexp)
+-
+     def load_both(self, schema_url, conf_url):
+         schema = self.load_schema(schema_url)
+         conf = self.load_config(schema, conf_url)

diff --git a/dev-python/zconfig/zconfig-4.0.ebuild 
b/dev-python/zconfig/zconfig-4.0.ebuild
index d015ceef4469..297324eb085e 100644
--- a/dev-python/zconfig/zconfig-4.0.ebuild
+++ b/dev-python/zconfig/zconfig-4.0.ebuild
@@ -6,12 +6,15 @@ EAPI=8
 DISTUTILS_USE_PEP517=setuptools
 PYPI_NO_NORMALIZE=1
 PYPI_PN="ZConfig"
-PYTHON_COMPAT=( python3_{10..11} )
+PYTHON_COMPAT=( python3_{10..12} )
 
 inherit distutils-r1 pypi
 
 DESCRIPTION="Configuration library supporting a hierarchical schema-driven 
model"
-HOMEPAGE="https://pypi.org/project/ZConfig/";
+HOMEPAGE="
+       https://github.com/zopefoundation/ZConfig/
+       https://pypi.org/project/ZConfig/
+"
 
 LICENSE="ZPL"
 SLOT="0"
@@ -32,6 +35,11 @@ distutils_enable_tests unittest
 distutils_enable_sphinx docs \
        dev-python/sphinxcontrib-programoutput
 
+PATCHES=(
+       # 
https://github.com/zopefoundation/ZConfig/commit/390ce89cfd4bf1a60d8d67ee20106288cbfa0e51
+       "${FILESDIR}/${P}-py312.patch"
+)
+
 python_test() {
        eunittest -s src/ZConfig/tests
 }

Reply via email to