17
0

4 Commits

Author SHA256 Message Date
2ad5189924 Accepting request 1219722 from devel:languages:python
- update to 2.16.0:
  * Drop Python 3.8 support.
  * Include wheels for Python 3.13.

OBS-URL: https://build.opensuse.org/request/show/1219722
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-time-machine?expand=0&rev=18
2024-11-01 20:00:42 +00:00
9291ea657a - update to 2.16.0:
* Drop Python 3.8 support.
  * Include wheels for Python 3.13.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-time-machine?expand=0&rev=35
2024-10-30 19:50:50 +00:00
cb3b759107 Accepting request 1184081 from devel:languages:python
- update to 2.14.2:
  * Fix SystemError on Python 3.13 and Windows when starting time
    travelling.

OBS-URL: https://build.opensuse.org/request/show/1184081
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-time-machine?expand=0&rev=17
2024-07-03 18:29:44 +00:00
783ab86aa0 - update to 2.14.2:
* Fix SystemError on Python 3.13 and Windows when starting time
    travelling.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-time-machine?expand=0&rev=33
2024-06-30 08:25:30 +00:00
4 changed files with 13 additions and 108 deletions

BIN
python-time-machine-2.16.0.tar.gz LFS Normal file

Binary file not shown.

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c74880a913e25b30de6be7645fa81b8ff374f0332dbbfd6c22d9445729cee637
size 85884

View File

@@ -1,96 +1,3 @@
-------------------------------------------------------------------
Wed Jan 28 12:27:44 UTC 2026 - Dirk Müller <dmueller@suse.com>
- update to 3.2.0:
* Add :attr:`time_machine.naive_mode` to control how time-
machine interprets naive datetimes. The default mode is
MIXED, which preserves existing behaviour: naive datetime
objects and date objects are interpreted as UTC, while naive
datetime strings are interpreted as local time. Three
alternative modes are available: UTC: naive datetimes are
always interpreted as UTC. LOCAL: naive datetimes are
interpreted as local time, matching Python's default
semantics, and freezegun. ERROR: naive datetimes raise a
RuntimeError, ensuring your tests are isolated from the
current timezone. Note Its recommended you use LOCAL or
ERROR to avoid confusion around naive datetimes. PR #591.
Thanks to Paolo Melchiorre for review. Thanks to PhML,
Stefaan Lippens, Matthieu Rigal, Nikita Demir, Steve Mavens,
Andy Freeland, and Paul Ganssle for their input on Issue
#257.
* UTC: naive datetimes are always interpreted as UTC.
* LOCAL: naive datetimes are interpreted as local time,
matching Python's default semantics, and freezegun.
* ERROR: naive datetimes raise a RuntimeError, ensuring your
tests are isolated from the current timezone.
* Raise RuntimeError when attempting to start time travelling
if freezegun is active. This change should help avoid
surprises when migrating complex test suites from freezegun
to time-machine. PR #590.
-------------------------------------------------------------------
Tue Dec 9 21:22:28 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Update to 3.1.0
- Optimize patching of uuid module. By avoiding using
unittest.mock, this small overhead from starting
time_machine.travel() has been reduced about 20x, from ~600ns
to ~30ns by one benchmark.
- Update to 3.0.0
- Remove mocking of time.monotonic() and time.monotonic_ns().
This mocking caused too many issues, such as causing freezes
in asyncio event loops (Issue #387), preventing
pytest-durations from timing tests correctly (Issue #505),
and triggering timeouts in psycopg (Issue #509). The root
cause here is that mocking the monotonic clock breaks its
contract, allowing it to move backwards when its meant to
only move forwards.
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 monotonic() or
monotonic_ns() directly, so that your tests can mock it in
those places only.
- Parse str destinations with datetime.fromisoformat() first,
before falling back to dateutil if installed.
datetime.fromisoformat() can parse most valid ISO 8601
formats, with better performance and no extra dependencies.
- Make the dependency on dateutil optional.
- Rename the Coordinates class to Traveller, to match the
recommended context manager variable name.
- Drop Python 3.9 support.
- Make the escape_hatch functions raise ValueError when called
outside of time-travelling, rather than triggering
segmentation faults.
- Update to 2.19.0
- Add marker support to the pytest plugin. Decorate tests with
@pytest.mark.time_machine(<destination>) to set time during a test,
affecting function-level fixtures as well.
- Add asynchronous context manager support to time_machine.travel(). You can
now use async with time_machine.travel(...): in asynchronous code, per the
documentation.
- Import date and time functions once in the C extension.
- This should improve speed a little bit, and avoid segmentation faults when
the functions have been swapped out, such as when freezegun is in effect.
(time-machine still wont apply if freezegun is in effect.)
- Update to 2.18.0
- Update the migration CLI to detect unittest classes based on whether they
use self.assert* methods like self.assertEqual().
- Fix free-threaded Python warning: RuntimeWarning: The global interpreter
lock (GIL) has been enabled... as seen on Python 3.13+.
- Add support to travel() for datetime destinations with tzinfo set to
datetime.UTC (datetime.timezone.utc).
- Prevent segmentation faults in unlikely scenarios, such as if the
time_machine module cannot be imported.
- Make travel() fully unpatch date and time functions when travel ends. This
may fix certain edge cases.
- Update to 2.17.0
- Include wheels for Python 3.14.
- Support free-threaded Python.
- Add a new CLI for migrating code from freezegun to time-machine.
- Install with pip install time-machine[cli] and run with python -m
time_machine migrate.
- Move the documentation to Read the Docs, and add a retro-futuristic logo.
-------------------------------------------------------------------
Wed Oct 30 19:50:38 UTC 2024 - Dirk Müller <dmueller@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-time-machine
#
# Copyright (c) 2026 SUSE LLC and contributors
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,12 +16,13 @@
#
%{?sle15_python_module_pythons}
Name: python-time-machine
Version: 3.2.0
Group: Development/Languages/Python
Version: 2.16.0
Release: 0
Summary: Travel through time in your tests
License: MIT
Group: Development/Languages/Python
URL: https://github.com/adamchainz/time-machine
# pypi packages don't contain the tests anymore since 2.2.0, see changelog
Source: https://github.com/adamchainz/time-machine/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
@@ -29,20 +30,17 @@ BuildRequires: %{python_module devel >= 3.8}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-generators
BuildRequires: python-rpm-macros
Requires: python-python-dateutil
Requires: python-tokenize-rt
Requires: timezone
# SECTION tests
BuildRequires: %{python_module backports.zoneinfo if %python-base < 3.9}
BuildRequires: %{python_module freezegun}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module python-dateutil}
BuildRequires: %{python_module tokenize-rt}
BuildRequires: timezone
# /SECTION
BuildRequires: fdupes
BuildRequires: python-rpm-generators
Requires: python-python-dateutil
Requires: timezone
%python_subpackages
%description
@@ -57,7 +55,7 @@ It can be used independently, as a function decorator, or as a context manager.
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pytest_arch
@@ -67,6 +65,6 @@ It can be used independently, as a function decorator, or as a context manager.
%license LICENSE
%{python_sitearch}/time_machine
%{python_sitearch}/_time_machine.*.so
%{python_sitearch}/time_machine-%{version}*-info
%{python_sitearch}/time_machine-%{version}.dist-info
%changelog