diff options
author | Michał Górny <mgorny@gentoo.org> | 2024-07-12 10:35:50 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2024-07-12 11:12:49 +0200 |
commit | 79b039b0dee6caa2ec126b239a2939530a4d5c31 (patch) | |
tree | 9a33411f369f9e57c637ae790a3c6312c6ec8008 /dev-python/python-json-logger | |
parent | dev-python/python-json-logger: Add a proper fix for py3.12 (diff) | |
download | gentoo-79b039b0dee6caa2ec126b239a2939530a4d5c31.tar.gz gentoo-79b039b0dee6caa2ec126b239a2939530a4d5c31.tar.bz2 gentoo-79b039b0dee6caa2ec126b239a2939530a4d5c31.zip |
dev-python/python-json-logger: Enable py3.13
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-py313.patch | 25 | ||||
-rw-r--r-- | dev-python/python-json-logger/python-json-logger-2.0.7-r1.ebuild | 4 |
2 files changed, 28 insertions, 1 deletions
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() { |