commit: 79b039b0dee6caa2ec126b239a2939530a4d5c31 Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Fri Jul 12 08:35:50 2024 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Fri Jul 12 09:12:49 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79b039b0
dev-python/python-json-logger: Enable py3.13 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> .../files/python-json-logger-2.0.7-py313.patch | 25 ++++++++++++++++++++++ .../python-json-logger-2.0.7-r1.ebuild | 4 +++- 2 files changed, 28 insertions(+), 1 deletion(-) 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 index c6a7e17d8626..f066b81d5d99 100644 --- 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 @@ -5,7 +5,7 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools PYPI_NO_NORMALIZE=1 -PYTHON_COMPAT=( python3_{10..12} pypy3 ) +PYTHON_COMPAT=( python3_{10..13} pypy3 ) inherit distutils-r1 pypi @@ -24,6 +24,8 @@ 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() {