From ef73e09115e31302e5cbb715082a56268529aad6 Mon Sep 17 00:00:00 2001 From: Tom Strausbaugh Date: Sat, 11 Jan 2025 09:24:21 -0500 Subject: [PATCH] python3-freezegun: update to 1.5.1 --- .../patches/fix-upstream-issue-396.patch | 30 ------------------- .../patches/fix-upstream-issue-550.patch | 25 ++++++++++++++++ srcpkgs/python3-freezegun/template | 6 ++-- 3 files changed, 28 insertions(+), 33 deletions(-) delete mode 100644 srcpkgs/python3-freezegun/patches/fix-upstream-issue-396.patch create mode 100644 srcpkgs/python3-freezegun/patches/fix-upstream-issue-550.patch diff --git a/srcpkgs/python3-freezegun/patches/fix-upstream-issue-396.patch b/srcpkgs/python3-freezegun/patches/fix-upstream-issue-396.patch deleted file mode 100644 index 42642d5a84d264..00000000000000 --- a/srcpkgs/python3-freezegun/patches/fix-upstream-issue-396.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 57d024e4ce2516c55c715448296b9099db68343c Mon Sep 17 00:00:00 2001 -From: Karthikeyan Singaravelan -Date: Fri, 7 May 2021 15:51:33 +0000 -Subject: [PATCH] Fix decorate_class for Python 3.10 where staticmethod is - callable. - -https://github.com/spulec/freezegun/pull/397 (edited by mgorny for more readable indent) ---- - freezegun/api.py | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/freezegun/api.py b/freezegun/api.py -index cab9ebe..eb3a931 100644 ---- a/freezegun/api.py -+++ b/freezegun/api.py -@@ -598,7 +598,10 @@ class _freeze_time(object): - continue - seen.add(attr) - -- if not callable(attr_value) or inspect.isclass(attr_value): -+ # staticmethods are callable from Python 3.10 . Hence skip them from decoration -+ if (not callable(attr_value) -+ or inspect.isclass(attr_value) -+ or isinstance(attr_value, staticmethod)): - continue - - try: --- -2.31.1 - diff --git a/srcpkgs/python3-freezegun/patches/fix-upstream-issue-550.patch b/srcpkgs/python3-freezegun/patches/fix-upstream-issue-550.patch new file mode 100644 index 00000000000000..5091090f8bbb08 --- /dev/null +++ b/srcpkgs/python3-freezegun/patches/fix-upstream-issue-550.patch @@ -0,0 +1,25 @@ +https://github.com/spulec/freezegun/pull/550 + +--- a/tests/test_datetimes.py ++++ b/tests/test_datetimes.py +@@ -534,17 +534,17 @@ + @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') diff --git a/srcpkgs/python3-freezegun/template b/srcpkgs/python3-freezegun/template index 653237b3f44dea..dbc6f581e2945d 100644 --- a/srcpkgs/python3-freezegun/template +++ b/srcpkgs/python3-freezegun/template @@ -1,7 +1,7 @@ # Template file for 'python3-freezegun' pkgname=python3-freezegun -version=1.2.2 -revision=4 +version=1.5.1 +revision=1 build_style=python3-module hostmakedepends="python3-setuptools" depends="python3-dateutil" @@ -12,7 +12,7 @@ license="Apache-2.0" homepage="https://github.com/spulec/freezegun" changelog="https://raw.githubusercontent.com/spulec/freezegun/master/CHANGELOG" distfiles="${PYPI_SITE}/f/freezegun/freezegun-${version}.tar.gz" -checksum=cd22d1ba06941384410cd967d8a99d5ae2442f57dfafeff2fda5de8dc5c05446 +checksum=b29dedfcda6d5e8e083ce71b2b542753ad48cfec44037b3fc79702e2980a89e9 do_check() { # Timezone needs to be fixed due to