diff options
Diffstat (limited to 'dev-python/python-json-logger')
4 files changed, 100 insertions, 0 deletions
diff --git a/dev-python/python-json-logger/Manifest b/dev-python/python-json-logger/Manifest index a8d267fc9252..1de4d24062c2 100644 --- a/dev-python/python-json-logger/Manifest +++ b/dev-python/python-json-logger/Manifest @@ -1,3 +1,6 @@ +AUX python-json-logger-2.0.7-py312.patch 1072 BLAKE2B 4b1409028046ed0b0ed41a221f8cc5957103fdb84c68037bea2b33a16e17e40814d44839b51a16bf122ed82b2ab9dce191850be8df7590a0581af270ab74a8ac SHA512 1497285bb76ec96d6d3a3316e8c03833dc78655add76f382331acfbb0a0d2b2e5a17f2bf596352dba39d3f6c44b0351144680e61e6361002a905db7e79b1c46b +AUX python-json-logger-2.0.7-py313.patch 1037 BLAKE2B 7f060bbb3ed61a7504b665c2412f46d7853729c6bd8550a5fa4c0311585e8283d58f2c1776e892af1cc6bfaa9937db7933e4c4b5d675f3b75842c618e53f5af6 SHA512 78e67dc60f7bf4c00dfbb34daf5c0eab9af8063c69872974cab62d82f0c7cd1eafe3e32424fe836cd63688d241a5c65e369f757f0690529b47e8ecabbc0214f5 DIST python-json-logger-2.0.7.tar.gz 10508 BLAKE2B 818abaa8007db2226beb7e9f9b6326c4c59e11827c740496bfde491a495b8580b74c483b4bead58525942009ae84643758b8fec4dc0ba85e2c1c2deff2445bcf SHA512 a3056f6c07386410204e65d027504df49d890b5c4577a0460077bc698c9104ab8720d6db107153766611f4f22141c0b2b57dbdacba75a7078638945937922f5e +EBUILD python-json-logger-2.0.7-r1.ebuild 822 BLAKE2B 33aca74d5619f011bb67862baf87007e4305a62c196132aece7a9c8fcb36d313bfaf0f9c505fd72b2ee909271cc16b1066c2213a02cb6dc5200274acd829f27f SHA512 7773e766784af227bf26f9f2682f4bf77cee0171ebe6f1ecba54f01cc12741b2cd1288a50f54e232af6530f53e8b174f316e8d3fc7e3c82394258e0f11729a93 EBUILD python-json-logger-2.0.7.ebuild 946 BLAKE2B 7b334ee834fff78db3f63bfd3944d974162988f3774866d4998d46b7bf626e6faddd43e5cc8e0f2e3c879e0eb8a7f3a5995eb58129fa82d5d144bbc479cd8808 SHA512 b2be4f8300f2eb6fde91116b81f859f473ae15e463b70f106eac9a73070c955d3c3c75a68e277035d811cb959d52d2acbd69d546b948609285fac53a9d0fd6a9 MISC metadata.xml 648 BLAKE2B d2c5fc2fbe82dbc6391eb8c5dd9513f5dc455abc8f8426f44eb338f0369621496d87f921b039c0e75f1684533e33058f005e41b55e4868ade9db30ed747ceb04 SHA512 a9a6d220281bf92eaee7da04710313daabda41feb00562c5ae6a016106b981c9fa6d1ba1294bd75e37a029799c235caeef91c48b404bca883a41b6988d549e64 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/files/python-json-logger-2.0.7-py313.patch b/dev-python/python-json-logger/files/python-json-logger-2.0.7-py313.patch new file mode 100644 index 000000000000..8421617783da --- /dev/null +++ b/dev-python/python-json-logger/files/python-json-logger-2.0.7-py313.patch @@ -0,0 +1,25 @@ +diff --git a/tests/test_jsonlogger.py b/tests/test_jsonlogger.py +index af369d2..068e760 100644 +--- a/tests/test_jsonlogger.py ++++ b/tests/test_jsonlogger.py +@@ -176,13 +176,17 @@ def test_json_default_encoder(self): + "1900-01-01T00:00:00") + + @unittest.mock.patch('time.time', return_value=1500000000.0) +- def test_json_default_encoder_with_timestamp(self, time_mock): ++ @unittest.mock.patch('time.time_ns', return_value=1500000000000000000) ++ def test_json_default_encoder_with_timestamp(self, time_ns_mock, time_mock): + fr = jsonlogger.JsonFormatter(timestamp=True) + self.log_handler.setFormatter(fr) + + self.log.info("Hello") +- +- self.assertTrue(time_mock.called) ++ ++ if sys.version_info < (3, 13): ++ self.assertTrue(time_mock.called) ++ else: ++ self.assertTrue(time_ns_mock.called) + log_json = json.loads(self.buffer.getvalue()) + self.assertEqual(log_json.get("timestamp"), "2017-07-14T02:40:00+00:00") + 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..f066b81d5d99 --- /dev/null +++ b/dev-python/python-json-logger/python-json-logger-2.0.7-r1.ebuild @@ -0,0 +1,34 @@ +# 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..13} 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" + # https://github.com/madzak/python-json-logger/pull/192 + "${FILESDIR}/${P}-py313.patch" +) + +python_test() { + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + epytest +} |