diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-11-14 04:26:46 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-11-14 04:26:46 +0000 |
commit | 62ce4dfbf01c603a668dabde87ccc5b4ca4069af (patch) | |
tree | 7b3cda13b94b1830f816c9e0e0d728d4af37d1d4 /dev-python | |
parent | 48b1a38e1711d2eec2733c3cd4b1b8ae49fbc47a (diff) |
gentoo auto-resync : 14:11:2023 - 04:26:45
Diffstat (limited to 'dev-python')
-rw-r--r-- | dev-python/Manifest.gz | bin | 270022 -> 270036 bytes | |||
-rw-r--r-- | dev-python/hatch-jupyter-builder/Manifest | 2 | ||||
-rw-r--r-- | dev-python/hatch-jupyter-builder/hatch-jupyter-builder-0.8.3.ebuild | 2 | ||||
-rw-r--r-- | dev-python/jupyter-server/Manifest | 1 | ||||
-rw-r--r-- | dev-python/jupyter-server/jupyter-server-2.10.0-r1.ebuild | 75 | ||||
-rw-r--r-- | dev-python/time-machine/Manifest | 3 | ||||
-rw-r--r-- | dev-python/time-machine/files/time-machine-2.13.0-backport-pr400.patch | 252 | ||||
-rw-r--r-- | dev-python/time-machine/time-machine-2.13.0.ebuild | 2 |
8 files changed, 334 insertions, 3 deletions
diff --git a/dev-python/Manifest.gz b/dev-python/Manifest.gz Binary files differindex cd000a3e5d0b..06665bc920e1 100644 --- a/dev-python/Manifest.gz +++ b/dev-python/Manifest.gz diff --git a/dev-python/hatch-jupyter-builder/Manifest b/dev-python/hatch-jupyter-builder/Manifest index e4bff48c310d..e039f9da95dc 100644 --- a/dev-python/hatch-jupyter-builder/Manifest +++ b/dev-python/hatch-jupyter-builder/Manifest @@ -1,3 +1,3 @@ DIST hatch_jupyter_builder-0.8.3.tar.gz 54754 BLAKE2B d64a90ba0e06dbbcfa3f2d27d88185f68bc6cadd885fd3691e01d129cb1d73d62efd2d230fe80dd2d8d1323b5efa4d3208f099663b2ed082a196a1b8fc39412e SHA512 c4dc0605338bafeeba21cc7260005815654d3e4646296d91af6fb3199be8645a06b2226608e6b0558ee01c7eed682162eefcf686a7e20636031b95c3a11ae265 -EBUILD hatch-jupyter-builder-0.8.3.ebuild 777 BLAKE2B d34876dc0c0056decf534718a367c493e1af66e8792b8e9a42b4999eb16829b099021e8d6312a1b742f514ff32f9c0b97f4732e0e7bbfd991caea4207d33627d SHA512 5de77817fd7c7f785fa53f6fb222b31109834309f29fc9588354780ac613ac90b36b3d4e0f5a8dd2b20d1475d6823c418ec9cdb47df54b263e9496ba815a0c5e +EBUILD hatch-jupyter-builder-0.8.3.ebuild 784 BLAKE2B 0e4b4d4fb9be244c194e7ac209a4fbfb500421cd09f5fe1cc6edde61b77012f519e408dfe20f8981983c800d26d4d3f1940ed50cec5975b33abb3f65d6156b0f SHA512 fc148afce93f354cc304a286f5d0b2ce184b945e2484add627b155a62f2f7310b6469010f045f3343fe76f3e4a43e7c406318a18d3ccd9659bfab95ea9c91626 MISC metadata.xml 434 BLAKE2B 4891ed3bf24cb6255d2edb5a9ea9203ea43c807cda50963e25cc6527caa20e1308271f1b5cbb246582491814db6e1743e083871ac044511eb5a5fd269288b623 SHA512 a9b103c28eac7767473c2499b9eeefb8796206b2d913bbd35ceb5ff30fbc16881b018d851381400bb0d544e9c9b710907ff52e17deb63a08440eec926c6633e0 diff --git a/dev-python/hatch-jupyter-builder/hatch-jupyter-builder-0.8.3.ebuild b/dev-python/hatch-jupyter-builder/hatch-jupyter-builder-0.8.3.ebuild index b70e0878bb9e..8c834692d498 100644 --- a/dev-python/hatch-jupyter-builder/hatch-jupyter-builder-0.8.3.ebuild +++ b/dev-python/hatch-jupyter-builder/hatch-jupyter-builder-0.8.3.ebuild @@ -16,7 +16,7 @@ HOMEPAGE=" LICENSE="BSD" SLOT="0" -KEYWORDS="amd64 arm arm64 ~loong ppc64 ~riscv x86" +KEYWORDS="amd64 arm arm64 ~loong ppc64 ~riscv ~sparc x86" RDEPEND=" dev-python/hatchling[${PYTHON_USEDEP}] diff --git a/dev-python/jupyter-server/Manifest b/dev-python/jupyter-server/Manifest index 0e218d904cbe..62d2caded2cf 100644 --- a/dev-python/jupyter-server/Manifest +++ b/dev-python/jupyter-server/Manifest @@ -4,6 +4,7 @@ DIST jupyter_server-2.7.3.tar.gz 705798 BLAKE2B d5655968f17b2a553653985876912465 DIST jupyter_server-2.8.0.tar.gz 708394 BLAKE2B 2beaba510b0e841203c58316db8507c8c503fdeacfbe7de1287d1ecf0740334c02b430ad7111043e21da45669cc1bd13bb313b5cd45f999490fa07c9057b1bea SHA512 e2ec60994737a9979545aaba3de1f846eb68c809cb952bfba6ce22c061f1e644a712f4b7b069ebfc393e8dd7a7bf723b2c3530a7a1b103eb1dbf42a60a59e6e6 DIST jupyter_server-2.9.0.tar.gz 709038 BLAKE2B 68569f323087c55427d2d0b5fe7df55082809a76b25102cf08f62393c1c943bf5527ed461e392f45751f6c4182fd6423056d3719aed6681cd85ca2f4e7fca0b7 SHA512 5d695f72cc02c73345a811739e2a7006313d37b5c05894b5da7792b0174537bfe962456d996605abc4f8ec2a4e1337b1d5817b667b4b5708c599e1a96452d597 DIST jupyter_server-2.9.1.tar.gz 709013 BLAKE2B dee0de771bb8488cccaecb49e2b4a2003f2530243013cafa7f170384380423a7c190504baabf458c59ffece28c4f60662c0530f55535dae25699be269f159743 SHA512 148c3eaa4b6ca1147961c1188e0016a634e5adae350e762903bdde000acde7ab62507e71dbe1278c2b9358ce2cf1c28c17ea8b184f3d4a2d59277910b5b44965 +EBUILD jupyter-server-2.10.0-r1.ebuild 2324 BLAKE2B ba843169dde4001d48300661fa691e995f3e4ac887eba1e9a98734686712a69acdeabb6d0ede6b82bb9dca42ad3b3a30453e016835048bf526bc4d169a69b66f SHA512 473eb729adde17a935bad53b4d274e650fafaf817763071c7c49b50355508429639e8e12fb9e314da0f81db152240d6e1f25a72dbe866522bf6fd5e11b9fa67d EBUILD jupyter-server-2.10.0.ebuild 2283 BLAKE2B 5afcf8963b57cfc20af18e86996ecae9705d3dabac12bfda578350a8e4ef75d73c7f50f6f6a96c0a4d80a6abb33c502218714ca510ebb4564f65b38c53487c20 SHA512 eaa1d47e875d9a6c5d100d16311a1101414f07b2255018e91eb89542865f0c8af3f5cfa49298b30338f044725b0247e728a93a5317a932ae769af6286f020a31 EBUILD jupyter-server-2.7.3.ebuild 2317 BLAKE2B 32c1085409c0172ceff2a210da809c96fa29e6ed7dc0c1d9141666a30faf7671098d9448f828ed3b2ccd29e0df1d537ea839dccd8c2e97ce73ec768ab4b6e270 SHA512 748b53191f6d6701e2a8b079bb0a8bd9ae5a3bc4ca9149fcb3275a4d75d38720e55a6edc3f5d62e8c482cc32c7283de6500ae1c0d49950ded90a8f86a1fe06db EBUILD jupyter-server-2.8.0.ebuild 2324 BLAKE2B b83528b323b9efdc76deff7eebee2521c2423b3fdfe3a9eb96f5258958d1feaeed95a7fa229269c68023568470de789c6627f1655d3a671b2c495fe2a2f80298 SHA512 1d35ef6246aee40d9f2f174a465c781984f6393394348e6d531ffd9a622a9cd74ad79967ab40e7222de5764eb2339c335f2dc1647853adbd17bcde141361d33a diff --git a/dev-python/jupyter-server/jupyter-server-2.10.0-r1.ebuild b/dev-python/jupyter-server/jupyter-server-2.10.0-r1.ebuild new file mode 100644 index 000000000000..fd452a9d0242 --- /dev/null +++ b/dev-python/jupyter-server/jupyter-server-2.10.0-r1.ebuild @@ -0,0 +1,75 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=hatchling +PYTHON_COMPAT=( python3_{10..12} ) + +inherit distutils-r1 pypi + +DESCRIPTION="Core services, APIs, and REST endpoints to Jupyter web applications" +HOMEPAGE=" + https://jupyter.org/ + https://github.com/jupyter-server/jupyter_server/ + https://pypi.org/project/jupyter-server/ +" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~sparc ~x86" + +RDEPEND=" + >=dev-python/anyio-3.1.0[${PYTHON_USEDEP}] + dev-python/argon2-cffi[${PYTHON_USEDEP}] + dev-python/jinja[${PYTHON_USEDEP}] + >=dev-python/jupyter-client-7.4.4[${PYTHON_USEDEP}] + >=dev-python/jupyter-core-5.1.0[${PYTHON_USEDEP}] + dev-python/jupyter-server-terminals[${PYTHON_USEDEP}] + >=dev-python/jupyter-events-0.6.0[${PYTHON_USEDEP}] + >=dev-python/nbconvert-6.4.4[${PYTHON_USEDEP}] + >=dev-python/nbformat-5.3.0[${PYTHON_USEDEP}] + dev-python/overrides[${PYTHON_USEDEP}] + dev-python/packaging[${PYTHON_USEDEP}] + dev-python/prometheus-client[${PYTHON_USEDEP}] + >=dev-python/pyzmq-24[${PYTHON_USEDEP}] + >=dev-python/send2trash-1.8.2[${PYTHON_USEDEP}] + >=dev-python/terminado-0.8.3[${PYTHON_USEDEP}] + >=dev-python/tornado-6.2[${PYTHON_USEDEP}] + >=dev-python/traitlets-5.6.0[${PYTHON_USEDEP}] + dev-python/websocket-client[${PYTHON_USEDEP}] + +" +BDEPEND=" + dev-python/hatch-jupyter-builder[${PYTHON_USEDEP}] + test? ( + dev-python/ipykernel[${PYTHON_USEDEP}] + dev-python/flaky[${PYTHON_USEDEP}] + dev-python/pytest-console-scripts[${PYTHON_USEDEP}] + dev-python/pytest-jupyter[${PYTHON_USEDEP}] + dev-python/pytest-timeout[${PYTHON_USEDEP}] + dev-python/pytest-tornasync[${PYTHON_USEDEP}] + dev-python/requests[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests pytest + +python_test() { + local EPYTEST_DESELECT=( + # This fails if your terminal is zsh (and maybe other non-bash as well?) + tests/test_terminal.py + # Fails because above is ignored + tests/auth/test_authorizer.py + # Fails with additional extensions installed + tests/extension/test_app.py::test_stop_extension + ) + + # FIXME: tests seem to be affected by previously installed version + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + epytest \ + -p pytest_tornasync.plugin \ + -p jupyter_server.pytest_plugin \ + -p pytest_console_scripts \ + -p pytest_timeout +} diff --git a/dev-python/time-machine/Manifest b/dev-python/time-machine/Manifest index e207e2976e36..3aa8b90faeb1 100644 --- a/dev-python/time-machine/Manifest +++ b/dev-python/time-machine/Manifest @@ -1,5 +1,6 @@ +AUX time-machine-2.13.0-backport-pr400.patch 10411 BLAKE2B 85b9937d44e8d669672af1c0c00852ad52a9ac69fed348d42ed665b1ff1711d2cc2d04cbe9ee36413aee325ea28a99f4a562aac33273374ada5bf221347ce949 SHA512 efa8858d8a5cc2f60e8a125188c9dd0404d331e7ae98d46793241aa9f1a70b857265c6119549c1ce3e90df1b1dfefc00a6fbdb0323586e6f8e2eac6f2b08b405 DIST time-machine-2.12.0.gh.tar.gz 27743 BLAKE2B 4ed0c9901edb9c698b8bbba6df80d12b06f344ad6ee8f9e89577264da1f0211774c2d227d02dc1ab0ceb5b905094168d19cdebc00a91a955d216729082ecbc28 SHA512 4708cdc3aa0ec06907d0ee1219ceb074947fc962ab6f0d3606e5273f3d64ca278bb43254d924c04364b967301cf69229ced70d7b1db92b0b6dff1523cccb2f82 DIST time-machine-2.13.0.gh.tar.gz 28747 BLAKE2B 88836d2b9ad34c8d256b576ab6b2bfe263232fb50d2e95f13049f84dbc838283811ebc54c5bb68493ef966e64777983ab6bcb7fafccda6dc74e00d3bb6a2108f SHA512 26a852d93633e037585ec8fcd563c86af8d977a87633dbeb66cf23c9ca49ca0ae536bdcdcdf809ee2ab423c197610c630d506bc3bf4f13c373d806cee2d8c598 EBUILD time-machine-2.12.0.ebuild 666 BLAKE2B 31b2cc19c14d0a6265e9f232e3473912a9597530acd7ec92df6d768eb96c85d1aa404212ad0b3a8a16a96006f4db94bdf70ec532f1dd3ae49ec0540b2b52b2a9 SHA512 f39aadc323edc83a608048cf5557846ce4b5f45d30f8188e19d086715dfd9bec5c9d5f3fe229b5e3882a0fc2dca0870e50bcc158417f0078a2d32cb6749281ed -EBUILD time-machine-2.13.0.ebuild 668 BLAKE2B 119d12d63d445e437a3454b6045bd5e1307e8d48599e788ae44bce2051b1ece19d2d5ead6035a3f4dab3b8660cd90dd88f77704cdce1b55d5d68d50ec112bc13 SHA512 5479b10d3011478b08899217d97b684d530ae12d0d62d94f7911e9e53d1ebca53e1b7348238312d6241f155e7c09f7f9c56f89dc06c1c0d10daaa246cf89225c +EBUILD time-machine-2.13.0.ebuild 729 BLAKE2B 70d1254b1a6cc1611eea6bc9bdfcc36111b4e27ba6065a13f96a5a89ed6686d3bd74ef3ef0b33d0f376df231076cef3a079609decfc526d4d3a2d405cdef6d3e SHA512 38c8ee766ccf388581a5f6e9249c98f70f85a54d50723998021d38272d0baa5dd1c4f8af15f44fcad4298209dfd169fd4f6a52f7100b901de0166ab6764eefc8 MISC metadata.xml 379 BLAKE2B 98883d810d13745555166c9901f0ac15bd1ace4754e67ddb090983d97808a8362f61d91e82e7c903920cf42037c3df2655b211caaff904fb3ac4d2494ebf2fd3 SHA512 74d7de420c0bc5c03a3524bfe9b888fec8e5ec353d89b8a8e5d5d2dbd736ef8d34c45f026fe493dfe87ebcc7754c30d9b3ef7fda1abea91cbf9599bdeb4ed3c9 diff --git a/dev-python/time-machine/files/time-machine-2.13.0-backport-pr400.patch b/dev-python/time-machine/files/time-machine-2.13.0-backport-pr400.patch new file mode 100644 index 000000000000..b7fa55c2e267 --- /dev/null +++ b/dev-python/time-machine/files/time-machine-2.13.0-backport-pr400.patch @@ -0,0 +1,252 @@ +https://bugs.gentoo.org/show_bug.cgi?id=912709 +https://github.com/adamchainz/time-machine/pull/400 + +From b489a478193982c17cf7847d32cae2b53a904222 Mon Sep 17 00:00:00 2001 +From: matoro <matoro@users.noreply.github.com> +Date: Thu, 9 Nov 2023 13:03:49 -0500 +Subject: [PATCH 1/2] Fix tests on platforms with low clock resolution + +On platforms without a high-resolution clock, such as Alpha and PA-RISC +is is likely that two sequential calls to time.time() will return the +same value if the execution time is not sufficient to allow one full +clock resolution cycle to pass. This adds sleeps of one cycle to +enforce that the minimum amount of time to guarantee a clock change has +passed. + +On systems with high-resolution clocks, clock_getres() will return 1ns; +in reality the sleep will take longer than 1ns to execute but should +still be a negligible amount of time. +--- + tests/test_time_machine.py | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/tests/test_time_machine.py b/tests/test_time_machine.py +index fe98fb7..7b5abbe 100644 +--- a/tests/test_time_machine.py ++++ b/tests/test_time_machine.py +@@ -155,8 +155,10 @@ def test_time_clock_gettime_realtime(): + @py_have_clock_gettime + def test_time_clock_gettime_monotonic_unaffected(): + start = time.clock_gettime(time.CLOCK_MONOTONIC) ++ time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) + with time_machine.travel(EPOCH + 180.0): + frozen = time.clock_gettime(time.CLOCK_MONOTONIC) ++ time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) + assert isinstance(frozen, float) + assert frozen > start + +@@ -169,6 +171,7 @@ def test_time_clock_gettime_monotonic_unaffected(): + def test_time_clock_gettime_ns_realtime(): + with time_machine.travel(EPOCH + 190.0): + first = time.clock_gettime_ns(time.CLOCK_REALTIME) ++ time.sleep(time.clock_getres(time.CLOCK_REALTIME)) + assert isinstance(first, int) + assert first == int((EPOCH + 190.0) * NANOSECONDS_PER_SECOND) + second = time.clock_gettime_ns(time.CLOCK_REALTIME) +@@ -182,8 +185,10 @@ def test_time_clock_gettime_ns_realtime(): + @py_have_clock_gettime + def test_time_clock_gettime_ns_monotonic_unaffected(): + start = time.clock_gettime_ns(time.CLOCK_MONOTONIC) ++ time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) + with time_machine.travel(EPOCH + 190.0): + frozen = time.clock_gettime_ns(time.CLOCK_MONOTONIC) ++ time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) + assert isinstance(frozen, int) + assert frozen > start + +@@ -279,6 +284,7 @@ def test_time_strftime_format_t(): + def test_time_time(): + with time_machine.travel(EPOCH): + first = time.time() ++ time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) + assert isinstance(first, float) + assert first == EPOCH + second = time.time() +@@ -300,6 +306,7 @@ def test_time_time(): + def test_time_time_windows(): + with time_machine.travel(EPOCH): + first = time.time() ++ time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) + assert isinstance(first, float) + assert first == windows_epoch_in_posix + +@@ -316,6 +323,7 @@ def test_time_time_no_tick(): + def test_time_time_ns(): + with time_machine.travel(EPOCH + 150.0): + first = time.time_ns() ++ time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) + assert isinstance(first, int) + assert first == int((EPOCH + 150.0) * NANOSECONDS_PER_SECOND) + second = time.time_ns() +@@ -561,6 +569,7 @@ def test_method_decorator(self): + @time_machine.travel(EPOCH + 95.0) + class UnitTestClassTests(TestCase): + def test_class_decorator(self): ++ time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) + assert EPOCH + 95.0 < time.time() < EPOCH + 96.0 + + @time_machine.travel(EPOCH + 25.0) +@@ -578,6 +587,7 @@ def setUpClass(cls): + cls.custom_setupclass_ran = True + + def test_class_decorator(self): ++ time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) + assert EPOCH + 95.0 < time.time() < EPOCH + 96.0 + assert self.custom_setupclass_ran + +@@ -639,6 +649,7 @@ def test_move_to_datetime(): + traveller.move_to(EPOCH_PLUS_ONE_YEAR_DATETIME) + + first = time.time() ++ time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) + assert first == EPOCH_PLUS_ONE_YEAR + + second = time.time() +@@ -706,6 +717,7 @@ def test_move_to_datetime_change_tick_on(): + with time_machine.travel(EPOCH, tick=False) as traveller: + traveller.move_to(EPOCH_PLUS_ONE_YEAR_DATETIME, tick=True) + assert time.time() == EPOCH_PLUS_ONE_YEAR ++ time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) + assert time.time() > EPOCH_PLUS_ONE_YEAR + + +@@ -756,6 +768,7 @@ def test_fixture_used_tick_false(time_machine): + def test_fixture_used_tick_true(time_machine): + time_machine.move_to(EPOCH, tick=True) + original = time.time() ++ time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) + assert original == EPOCH + assert original < time.time() < EPOCH + 10.0 + + +From 9e84584325ec06eb997716b6a0f42e9ca6540994 Mon Sep 17 00:00:00 2001 +From: matoro <matoro@users.noreply.github.com> +Date: Fri, 10 Nov 2023 11:06:23 -0500 +Subject: [PATCH 2/2] Wrap sleep calls in "sleep_one_cycle" function + +--- + tests/test_time_machine.py | 30 +++++++++++++++++------------- + 1 file changed, 17 insertions(+), 13 deletions(-) + +diff --git a/tests/test_time_machine.py b/tests/test_time_machine.py +index 7b5abbe..163ec2b 100644 +--- a/tests/test_time_machine.py ++++ b/tests/test_time_machine.py +@@ -38,6 +38,10 @@ + ) + + ++def sleep_one_cycle(clock: int) -> None: ++ time.sleep(time.clock_getres(clock)) ++ ++ + @contextmanager + def change_local_timezone(local_tz: str | None) -> typing.Iterator[None]: + orig_tz = os.environ["TZ"] +@@ -155,10 +159,10 @@ def test_time_clock_gettime_realtime(): + @py_have_clock_gettime + def test_time_clock_gettime_monotonic_unaffected(): + start = time.clock_gettime(time.CLOCK_MONOTONIC) +- time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) ++ sleep_one_cycle(time.CLOCK_MONOTONIC) + with time_machine.travel(EPOCH + 180.0): + frozen = time.clock_gettime(time.CLOCK_MONOTONIC) +- time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) ++ sleep_one_cycle(time.CLOCK_MONOTONIC) + assert isinstance(frozen, float) + assert frozen > start + +@@ -171,7 +175,7 @@ def test_time_clock_gettime_monotonic_unaffected(): + def test_time_clock_gettime_ns_realtime(): + with time_machine.travel(EPOCH + 190.0): + first = time.clock_gettime_ns(time.CLOCK_REALTIME) +- time.sleep(time.clock_getres(time.CLOCK_REALTIME)) ++ sleep_one_cycle(time.CLOCK_REALTIME) + assert isinstance(first, int) + assert first == int((EPOCH + 190.0) * NANOSECONDS_PER_SECOND) + second = time.clock_gettime_ns(time.CLOCK_REALTIME) +@@ -185,10 +189,10 @@ def test_time_clock_gettime_ns_realtime(): + @py_have_clock_gettime + def test_time_clock_gettime_ns_monotonic_unaffected(): + start = time.clock_gettime_ns(time.CLOCK_MONOTONIC) +- time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) ++ sleep_one_cycle(time.CLOCK_MONOTONIC) + with time_machine.travel(EPOCH + 190.0): + frozen = time.clock_gettime_ns(time.CLOCK_MONOTONIC) +- time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) ++ sleep_one_cycle(time.CLOCK_MONOTONIC) + assert isinstance(frozen, int) + assert frozen > start + +@@ -284,7 +288,7 @@ def test_time_strftime_format_t(): + def test_time_time(): + with time_machine.travel(EPOCH): + first = time.time() +- time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) ++ sleep_one_cycle(time.CLOCK_MONOTONIC) + assert isinstance(first, float) + assert first == EPOCH + second = time.time() +@@ -306,7 +310,7 @@ def test_time_time(): + def test_time_time_windows(): + with time_machine.travel(EPOCH): + first = time.time() +- time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) ++ sleep_one_cycle(time.CLOCK_MONOTONIC) + assert isinstance(first, float) + assert first == windows_epoch_in_posix + +@@ -323,7 +327,7 @@ def test_time_time_no_tick(): + def test_time_time_ns(): + with time_machine.travel(EPOCH + 150.0): + first = time.time_ns() +- time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) ++ sleep_one_cycle(time.CLOCK_MONOTONIC) + assert isinstance(first, int) + assert first == int((EPOCH + 150.0) * NANOSECONDS_PER_SECOND) + second = time.time_ns() +@@ -569,7 +573,7 @@ def test_method_decorator(self): + @time_machine.travel(EPOCH + 95.0) + class UnitTestClassTests(TestCase): + def test_class_decorator(self): +- time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) ++ sleep_one_cycle(time.CLOCK_MONOTONIC) + assert EPOCH + 95.0 < time.time() < EPOCH + 96.0 + + @time_machine.travel(EPOCH + 25.0) +@@ -587,7 +591,7 @@ def setUpClass(cls): + cls.custom_setupclass_ran = True + + def test_class_decorator(self): +- time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) ++ sleep_one_cycle(time.CLOCK_MONOTONIC) + assert EPOCH + 95.0 < time.time() < EPOCH + 96.0 + assert self.custom_setupclass_ran + +@@ -649,7 +653,7 @@ def test_move_to_datetime(): + traveller.move_to(EPOCH_PLUS_ONE_YEAR_DATETIME) + + first = time.time() +- time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) ++ sleep_one_cycle(time.CLOCK_MONOTONIC) + assert first == EPOCH_PLUS_ONE_YEAR + + second = time.time() +@@ -717,7 +721,7 @@ def test_move_to_datetime_change_tick_on(): + with time_machine.travel(EPOCH, tick=False) as traveller: + traveller.move_to(EPOCH_PLUS_ONE_YEAR_DATETIME, tick=True) + assert time.time() == EPOCH_PLUS_ONE_YEAR +- time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) ++ sleep_one_cycle(time.CLOCK_MONOTONIC) + assert time.time() > EPOCH_PLUS_ONE_YEAR + + +@@ -768,7 +772,7 @@ def test_fixture_used_tick_false(time_machine): + def test_fixture_used_tick_true(time_machine): + time_machine.move_to(EPOCH, tick=True) + original = time.time() +- time.sleep(time.clock_getres(time.CLOCK_MONOTONIC)) ++ sleep_one_cycle(time.CLOCK_MONOTONIC) + assert original == EPOCH + assert original < time.time() < EPOCH + 10.0 + diff --git a/dev-python/time-machine/time-machine-2.13.0.ebuild b/dev-python/time-machine/time-machine-2.13.0.ebuild index b759fd9cf9d8..6b03b3926bee 100644 --- a/dev-python/time-machine/time-machine-2.13.0.ebuild +++ b/dev-python/time-machine/time-machine-2.13.0.ebuild @@ -27,4 +27,6 @@ RDEPEND=" dev-python/python-dateutil[${PYTHON_USEDEP}] " +PATCHES=( "${FILESDIR}/${PN}-2.13.0-backport-pr400.patch" ) + distutils_enable_tests pytest |