Accepting request 1184152 from devel:languages:python
- add py313-support.patch to fix build with python 3.13 OBS-URL: https://build.opensuse.org/request/show/1184152 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-freezegun?expand=0&rev=21
This commit is contained in:
commit
2a4a00a2d1
33
py313-support.patch
Normal file
33
py313-support.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
From 1777174bb97c0b514033a09b820078b0d117f4a8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Bert Blommers <info@bertblommers.nl>
|
||||||
|
Date: Fri, 28 Jun 2024 19:21:04 +0000
|
||||||
|
Subject: [PATCH] Admin: Support Python 3.13
|
||||||
|
|
||||||
|
---
|
||||||
|
.github/workflows/ci.yaml | 9 ++++++---
|
||||||
|
tests/test_datetimes.py | 6 +++---
|
||||||
|
2 files changed, 9 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
--- a/tests/test_datetimes.py
|
||||||
|
+++ b/tests/test_datetimes.py
|
||||||
|
@@ -534,17 +534,17 @@ def test_method_decorator_works_on_unittest(self) -> None:
|
||||||
|
@freeze_time('2013-04-09', as_kwarg='frozen_time')
|
||||||
|
def test_method_decorator_works_on_unittest_kwarg_frozen_time(self, frozen_time: Any) -> None:
|
||||||
|
self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today())
|
||||||
|
- self.assertEqual(datetime.date(2013, 4, 9), frozen_time.time_to_freeze.today())
|
||||||
|
+ assert frozen_time.time_to_freeze.today().strftime('%Y-%m-%d') == "2013-04-09"
|
||||||
|
|
||||||
|
@freeze_time('2013-04-09', as_kwarg='hello')
|
||||||
|
def test_method_decorator_works_on_unittest_kwarg_hello(self, **kwargs: Any) -> None:
|
||||||
|
self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today())
|
||||||
|
- self.assertEqual(datetime.date(2013, 4, 9), kwargs.get('hello').time_to_freeze.today()) # type: ignore
|
||||||
|
+ assert kwargs.get("hello").time_to_freeze.today().strftime('%Y-%m-%d') == "2013-04-09" # type: ignore
|
||||||
|
|
||||||
|
@freeze_time(lambda: datetime.date(year=2013, month=4, day=9), as_kwarg='frozen_time')
|
||||||
|
def test_method_decorator_works_on_unittest_kwarg_frozen_time_with_func(self, frozen_time: Any) -> None:
|
||||||
|
self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today())
|
||||||
|
- self.assertEqual(datetime.date(2013, 4, 9), frozen_time.time_to_freeze.today())
|
||||||
|
+ assert frozen_time.time_to_freeze.today().strftime('%Y-%m-%d') == "2013-04-09"
|
||||||
|
|
||||||
|
|
||||||
|
@freeze_time('2013-04-09')
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun Jun 30 21:22:02 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- add py313-support.patch to fix build with python 3.13
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Jun 12 09:20:35 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
Wed Jun 12 09:20:35 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
@ -24,10 +24,14 @@ Summary: Mock time date for Python
|
|||||||
License: Apache-2.0
|
License: Apache-2.0
|
||||||
URL: https://github.com/spulec/freezegun
|
URL: https://github.com/spulec/freezegun
|
||||||
Source: https://files.pythonhosted.org/packages/source/f/freezegun/freezegun-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/f/freezegun/freezegun-%{version}.tar.gz
|
||||||
|
# PATCH-FIX-UPSTREAM: https://github.com/spulec/freezegun/commit/1777174bb97c0b514033a09b820078b0d117f4a8
|
||||||
|
Patch1: py313-support.patch
|
||||||
BuildRequires: %{python_module base >= 3.7}
|
BuildRequires: %{python_module base >= 3.7}
|
||||||
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
BuildRequires: %{python_module python-dateutil > 2.7}
|
BuildRequires: %{python_module python-dateutil > 2.7}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: %{pythons}
|
BuildRequires: %{pythons}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
@ -41,14 +45,13 @@ FreezeGun is a library that allows your python tests to travel through
|
|||||||
time by mocking the datetime module.
|
time by mocking the datetime module.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n freezegun-%{version}
|
%autosetup -p1 -n freezegun-%{version}
|
||||||
%autopatch -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%pyproject_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%python_install
|
%pyproject_install
|
||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
@ -58,6 +61,6 @@ time by mocking the datetime module.
|
|||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
%{python_sitelib}/freezegun
|
%{python_sitelib}/freezegun
|
||||||
%{python_sitelib}/freezegun-%{version}*-info
|
%{python_sitelib}/freezegun-%{version}.dist-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
x
Reference in New Issue
Block a user