diff options
author | Michał Górny <mgorny@gentoo.org> | 2024-06-14 17:29:36 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2024-06-14 17:54:49 +0200 |
commit | b5a730b27d9b4619f0e1ec958533de7049dc2a78 (patch) | |
tree | ab5d7b58f47dfcb18e317b1360e62ea35ca289bc | |
parent | dev-python/daemonize: Enable py3.13 (diff) | |
download | gentoo-b5a730b27d9b4619f0e1ec958533de7049dc2a78.tar.gz gentoo-b5a730b27d9b4619f0e1ec958533de7049dc2a78.tar.bz2 gentoo-b5a730b27d9b4619f0e1ec958533de7049dc2a78.zip |
dev-python/colorlog: Enable py3.13
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r-- | dev-python/colorlog/colorlog-6.8.2.ebuild | 7 | ||||
-rw-r--r-- | dev-python/colorlog/files/colorlog-6.8.2-py313.patch | 51 |
2 files changed, 57 insertions, 1 deletions
diff --git a/dev-python/colorlog/colorlog-6.8.2.ebuild b/dev-python/colorlog/colorlog-6.8.2.ebuild index 1bb20db7b6a8..d75db15a6ab3 100644 --- a/dev-python/colorlog/colorlog-6.8.2.ebuild +++ b/dev-python/colorlog/colorlog-6.8.2.ebuild @@ -4,7 +4,7 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( pypy3 python3_{10..12} ) +PYTHON_COMPAT=( pypy3 python3_{10..13} ) inherit distutils-r1 pypi @@ -19,3 +19,8 @@ SLOT="0" KEYWORDS="amd64 arm64 ~loong ~riscv x86" distutils_enable_tests pytest + +PATCHES=( + # https://github.com/borntyping/python-colorlog/commit/607485def2d60b60c40c0d682574324b47fc30ba + "${FILESDIR}/${P}-py313.patch" +) diff --git a/dev-python/colorlog/files/colorlog-6.8.2-py313.patch b/dev-python/colorlog/files/colorlog-6.8.2-py313.patch new file mode 100644 index 000000000000..dc47fe2ee534 --- /dev/null +++ b/dev-python/colorlog/files/colorlog-6.8.2-py313.patch @@ -0,0 +1,51 @@ +From 607485def2d60b60c40c0d682574324b47fc30ba Mon Sep 17 00:00:00 2001 +From: Sam Clements <sam@borntyping.co.uk> +Date: Fri, 26 Jan 2024 14:06:47 +0000 +Subject: [PATCH] Support Python 3.13 + +--- + colorlog/wrappers.py | 17 +++++++++++++---- + 4 files changed, 17 insertions(+), 6 deletions(-) + +diff --git a/colorlog/wrappers.py b/colorlog/wrappers.py +index 20e3042..63b201a 100644 +--- a/colorlog/wrappers.py ++++ b/colorlog/wrappers.py +@@ -2,6 +2,7 @@ + + import functools + import logging ++import sys + import typing + from logging import ( + CRITICAL, +@@ -53,8 +54,8 @@ def basicConfig( + ) -> None: + """Call ``logging.basicConfig`` and override the formatter it creates.""" + logging.basicConfig(**kwargs) +- logging._acquireLock() # type: ignore +- try: ++ ++ def _basicConfig(): + handler = logging.root.handlers[0] + handler.setFormatter( + colorlog.formatter.ColoredFormatter( +@@ -67,8 +68,16 @@ def basicConfig( + stream=kwargs.get("stream", None), + ) + ) +- finally: +- logging._releaseLock() # type: ignore ++ ++ if sys.version_info >= (3, 13): ++ with logging._lock: ++ _basicConfig() ++ else: ++ logging._acquireLock() # type: ignore ++ try: ++ _basicConfig() ++ finally: ++ logging._releaseLock() # type: ignore + + + def ensure_configured(func): |