summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-07-12 10:33:13 +0200
committerMichał Górny <mgorny@gentoo.org>2024-07-12 11:12:48 +0200
commit14cc15400768b67db7807a3ab6990799ae8a765c (patch)
tree664f26e0378830e441e4c15426c884a8ae3fba42 /dev-python/python-json-logger
parentdev-python/hatch-jupyter-builder: Enable py3.13 (diff)
downloadgentoo-14cc15400768b67db7807a3ab6990799ae8a765c.tar.gz
gentoo-14cc15400768b67db7807a3ab6990799ae8a765c.tar.bz2
gentoo-14cc15400768b67db7807a3ab6990799ae8a765c.zip
dev-python/python-json-logger: Add a proper fix for py3.12
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/python-json-logger')
-rw-r--r--dev-python/python-json-logger/files/python-json-logger-2.0.7-py312.patch38
-rw-r--r--dev-python/python-json-logger/python-json-logger-2.0.7-r1.ebuild32
2 files changed, 70 insertions, 0 deletions
diff --git a/dev-python/python-json-logger/files/python-json-logger-2.0.7-py312.patch b/dev-python/python-json-logger/files/python-json-logger-2.0.7-py312.patch
new file mode 100644
index 000000000000..1cab3b851ff6
--- /dev/null
+++ b/dev-python/python-json-logger/files/python-json-logger-2.0.7-py312.patch
@@ -0,0 +1,38 @@
+From 0ce621a8dd9dfa708a920c0ad90df8f7593b6110 Mon Sep 17 00:00:00 2001
+From: cache-miss <cache-miss>
+Date: Sat, 9 Mar 2024 18:27:24 +0800
+Subject: [PATCH] add taskName to reserved_attrs which was added in python 3.12
+
+Closes: https://github.com/madzak/python-json-logger/pull/188
+---
+ src/pythonjsonlogger/jsonlogger.py | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/pythonjsonlogger/jsonlogger.py b/src/pythonjsonlogger/jsonlogger.py
+index e250c7e..a911478 100644
+--- a/src/pythonjsonlogger/jsonlogger.py
++++ b/src/pythonjsonlogger/jsonlogger.py
+@@ -6,6 +6,7 @@ import logging
+ import json
+ import re
+ from datetime import date, datetime, time, timezone
++import sys
+ import traceback
+ import importlib
+
+@@ -23,6 +24,12 @@ RESERVED_ATTRS: Tuple[str, ...] = (
+ 'msecs', 'message', 'msg', 'name', 'pathname', 'process',
+ 'processName', 'relativeCreated', 'stack_info', 'thread', 'threadName')
+
++if sys.version_info >= (3, 12):
++ RESERVED_ATTRS = (
++ *RESERVED_ATTRS,
++ "taskName",
++ )
++
+
+
+ def merge_record_extra(
+--
+2.45.2
+
diff --git a/dev-python/python-json-logger/python-json-logger-2.0.7-r1.ebuild b/dev-python/python-json-logger/python-json-logger-2.0.7-r1.ebuild
new file mode 100644
index 000000000000..c6a7e17d8626
--- /dev/null
+++ b/dev-python/python-json-logger/python-json-logger-2.0.7-r1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYPI_NO_NORMALIZE=1
+PYTHON_COMPAT=( python3_{10..12} pypy3 )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Standard python logging to output log data as json objects"
+HOMEPAGE="
+ https://github.com/madzak/python-json-logger/
+ https://pypi.org/project/python-json-logger/
+"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+
+distutils_enable_tests pytest
+
+PATCHES=(
+ # https://github.com/madzak/python-json-logger/pull/188
+ "${FILESDIR}/${P}-py312.patch"
+)
+
+python_test() {
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ epytest
+}