Skip to content

Commit 021e780

Browse files
build(deps-dev): bump time-machine from 2.19.0 to 3.2.0 (#241)
Bumps [time-machine](https://github.com/adamchainz/time-machine) from 2.19.0 to 3.2.0. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/adamchainz/time-machine/blob/main/docs/changelog.rst">time-machine's changelog</a>.</em></p> <blockquote> <h2>3.2.0 (2025-12-17)</h2> <ul> <li> <p>Add :attr:<code>time_machine.naive_mode</code> to control how time-machine interprets naive datetimes.</p> <p>The default mode is <code>MIXED</code>, which preserves existing behaviour: naive <code>datetime</code> objects and <code>date</code> objects are interpreted as UTC, while naive datetime strings are interpreted as local time.</p> <p>Three alternative modes are available:</p> <ul> <li><code>UTC</code>: naive datetimes are always interpreted as UTC.</li> <li><code>LOCAL</code>: naive datetimes are interpreted as local time, matching Python's default semantics, and freezegun.</li> <li><code>ERROR</code>: naive datetimes raise a <code>RuntimeError</code>, ensuring your tests are isolated from the current timezone.</li> </ul> <p>.. note::</p> <p>It’s recommended you use <code>LOCAL</code> or <code>ERROR</code> to avoid confusion around naive datetimes.</p> <p><code>PR [#591](adamchainz/time-machine#591) &lt;https://github.com/adamchainz/time-machine/pull/591&gt;</code>__. Thanks to Paolo Melchiorre for review.</p> <p>Thanks to PhML, Stefaan Lippens, Matthieu Rigal, Nikita Demir, Steve Mavens, Andy Freeland, and Paul Ganssle for their input on <code>Issue [#257](adamchainz/time-machine#257) &lt;https://github.com/adamchainz/time-machine/issues/257&gt;</code>__.</p> </li> <li> <p>Raise <code>RuntimeError</code> when attempting to start time travelling if <code>freezegun &lt;https://pypi.org/project/freezegun/&gt;</code>__ is active.</p> <p>This change should help avoid surprises when migrating complex test suites from freezegun to time-machine.</p> <p><code>PR [#590](adamchainz/time-machine#590) &lt;https://github.com/adamchainz/time-machine/pull/590&gt;</code>__.</p> </li> </ul> <h2>3.1.0 (2025-11-21)</h2> <ul> <li> <p>Optimize patching of <code>uuid</code> module. By avoiding using <code>unittest.mock</code>, this small overhead from starting <code>time_machine.travel()</code> has been reduced about 20x, from ~600ns to ~30ns by one benchmark.</p> <p><code>PR [#585](adamchainz/time-machine#585) &lt;https://github.com/adamchainz/time-machine/pull/585&gt;</code>__.</p> </li> </ul> <h2>3.0.0 (2025-11-18)</h2> <ul> <li> <p>Remove mocking of <code>time.monotonic()</code> and <code>time.monotonic_ns()</code>.</p> <p>This mocking caused too many issues, such as causing freezes in asyncio event loops (<code>Issue [#387](adamchainz/time-machine#387) &lt;https://github.com/adamchainz/time-machine/issues/387&gt;</code><strong>), preventing pytest-durations from timing tests correctly (<code>Issue [#505](adamchainz/time-machine#505) &lt;https://github.com/adamchainz/time-machine/issues/505&gt;</code></strong>), and triggering timeouts in psycopg (<code>Issue [#509](adamchainz/time-machine#509) &lt;https://github.com/adamchainz/time-machine/issues/509&gt;</code>__). The root cause here is that mocking the monotonic clock breaks its contract, allowing it to move backwards when it’s meant to only move forwards.</p> <p>As an alternative, use |unittest.mock|__ to mock the monotonic function for the specific tested modules that need it. That means that your code should import <code>monotonic()</code> or <code>monotonic_ns()</code> directly, so that your tests can mock it in those places only. For example, if your system under test looks like:</p> <p>.. |unittest.mock| replace:: <code>unittest.mock</code> __ <a href="https://docs.python.org/3/library/unittest.mock.html">https://docs.python.org/3/library/unittest.mock.html</a></p> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/adamchainz/time-machine/commit/1b7ac45defb26c72076dc202aba46967c8c28fa9"><code>1b7ac45</code></a> Version 3.2.0</li> <li><a href="https://github.com/adamchainz/time-machine/commit/9284e4407030e58a0e8c0a0f89f8983e2c81b9c1"><code>9284e44</code></a> Change freezegun detection (<a href="https://redirect.github.com/adamchainz/time-machine/issues/592">#592</a>)</li> <li><a href="https://github.com/adamchainz/time-machine/commit/dab094e8d3af7c5b3104588c59b0cd8d69cece50"><code>dab094e</code></a> Add <code>naive_mode</code> attribute to control handling of naive datetimes (<a href="https://redirect.github.com/adamchainz/time-machine/issues/591">#591</a>)</li> <li><a href="https://github.com/adamchainz/time-machine/commit/242f897e168495c1923e21f3487e1750c91236e5"><code>242f897</code></a> Raise RuntimeError if freezegun is active when starting time-machine (<a href="https://redirect.github.com/adamchainz/time-machine/issues/590">#590</a>)</li> <li><a href="https://github.com/adamchainz/time-machine/commit/4c014f2afa60e80775b8a5b0295f29726be633e4"><code>4c014f2</code></a> Upgrade dependencies (<a href="https://redirect.github.com/adamchainz/time-machine/issues/589">#589</a>)</li> <li><a href="https://github.com/adamchainz/time-machine/commit/ef6c030ea35ca5b9025fbcfafd6d6caee4106616"><code>ef6c030</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/adamchainz/time-machine/issues/587">#587</a>)</li> <li><a href="https://github.com/adamchainz/time-machine/commit/96be98524dc0114e322a7c92ab8ba03c4ba26f18"><code>96be985</code></a> Bump actions/checkout from 5 to 6 in the github-actions group (<a href="https://redirect.github.com/adamchainz/time-machine/issues/588">#588</a>)</li> <li><a href="https://github.com/adamchainz/time-machine/commit/b57d54ea4107114b95afe8ec93e8d3f6e83354fc"><code>b57d54e</code></a> Build documentation on Python 3.14 (<a href="https://redirect.github.com/adamchainz/time-machine/issues/586">#586</a>)</li> <li><a href="https://github.com/adamchainz/time-machine/commit/b9f7500d03de270766fcfaf694f4beccf57eae5e"><code>b9f7500</code></a> Version 3.1.0</li> <li><a href="https://github.com/adamchainz/time-machine/commit/965e906ec5b7acbeb348cf1dc85252918aa79f9e"><code>965e906</code></a> Optimize patching of uuid module (<a href="https://redirect.github.com/adamchainz/time-machine/issues/585">#585</a>)</li> <li>Additional commits viewable in <a href="https://github.com/adamchainz/time-machine/compare/2.19.0...3.2.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=time-machine&package-manager=uv&previous-version=2.19.0&new-version=3.2.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 7959e69 commit 021e780

2 files changed

Lines changed: 61 additions & 64 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ test = [
8787
"ray[default,tune]>=2.40.0,<3",
8888
"respx>=0.21,<1",
8989
"s3fs>=2024.9.0",
90-
"time-machine>=2.15,<3",
90+
"time-machine>=2.15,<4",
9191
"websockets>=14.2,<15",
9292
]
9393
docs = [

0 commit comments

Comments
 (0)