public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/python-json-logger/files/, dev-python/python-json-logger/
@ 2024-07-12  9:12 Michał Górny
  0 siblings, 0 replies; only message in thread
From: Michał Górny @ 2024-07-12  9:12 UTC (permalink / raw
  To: gentoo-commits

commit:     14cc15400768b67db7807a3ab6990799ae8a765c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 12 08:33:13 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul 12 09:12:48 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=14cc1540

dev-python/python-json-logger: Add a proper fix for py3.12

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

 .../files/python-json-logger-2.0.7-py312.patch     | 38 ++++++++++++++++++++++
 .../python-json-logger-2.0.7-r1.ebuild             | 32 ++++++++++++++++++
 2 files changed, 70 insertions(+)

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
+}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-07-12  9:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-12  9:12 [gentoo-commits] repo/gentoo:master commit in: dev-python/python-json-logger/files/, dev-python/python-json-logger/ Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox