New comment by Vinfall on void-packages repository https://github.com/void-linux/void-packages/pull/53736#issuecomment-2585070757 Comment: Hi, I met similar issue with python3-freezegun and updated package failed to pass unittest, with or without upstream patch https://github.com/spulec/freezegun/pull/550. How do you solve this?
Build log

```python => xbps-src: updating repositories for host (x86_64)... [*] Updating repository `https://repo-default.voidlinux.org/current/bootstrap/x86_64-repodata' ... [*] Updating repository `https://repo-default.voidlinux.org/current/x86_64-repodata' ... x86_64-repodata: 1936KB [avg rate: 2206KB/s] [*] Updating repository `https://repo-default.voidlinux.org/current/nonfree/x86_64-repodata' ... [*] Updating repository `https://repo-default.voidlinux.org/current/debug/x86_64-repodata' ... x86_64-repodata: 895KB [avg rate: 30GB/s] [*] Updating repository `https://repo-default.voidlinux.org/current/multilib/bootstrap/x86_64-repodata' ... [*] Updating repository `https://repo-default.voidlinux.org/current/multilib/x86_64-repodata' ... x86_64-repodata: 736KB [avg rate: 21GB/s] [*] Updating repository `https://repo-default.voidlinux.org/current/multilib/nonfree/x86_64-repodata' ... => xbps-src: updating software in / masterdir... => xbps-src: cleaning up / masterdir... => python3-freezegun-1.5.1_1: removing autodeps, please wait... => python3-freezegun-1.5.1_1: building with [python3-module] [python3] for x86_64... [host] python3-setuptools-75.8.0_1: found (https://repo-default.voidlinux.org/current) [host] python3-packaging-bootstrap-24.2_1: found (https://repo-default.voidlinux.org/current/bootstrap) [check] python3-dateutil-2.9.0_2: found (https://repo-default.voidlinux.org/current) [check] python3-pytest-xdist-3.6.1_2: found (https://repo-default.voidlinux.org/current) [target] python3-3.13.1_1: found (https://repo-default.voidlinux.org/current) [runtime] python3-dateutil-2.9.0_2: found (https://repo-default.voidlinux.org/current) => python3-freezegun-1.5.1_1: installing host dependencies: python3-setuptools-75.8.0_1 python3-packaging-bootstrap-24.2_1 python3-dateutil-2.9.0_2 python3-pytest-xdist-3.6.1_2 ... => python3-freezegun-1.5.1_1: installing target dependencies: python3-3.13.1_1 ... => python3-freezegun-1.5.1_1: running do_check ... ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.1, pluggy-1.5.0 rootdir: /builddir/python3-freezegun-1.5.1 configfile: pyproject.toml plugins: xdist-3.6.1 collected 137 items tests/test_asyncio.py ..... [ 3%] tests/test_class_import.py .............. [ 13%] tests/test_configure.py ..... [ 17%] tests/test_datetimes.py .................s.....s.....s.s................ [ 52%] FFF....................s [ 70%] tests/test_errors.py .. [ 71%] tests/test_import_alias.py ... [ 73%] tests/test_operations.py ............. [ 83%] tests/test_pickle.py ... [ 85%] tests/test_sqlite3.py .. [ 86%] tests/test_ticking.py .s.......... [ 95%] tests/test_utils.py .. [ 97%] tests/test_uuid.py .. [ 98%] tests/test_warnings.py .. [100%] =================================== FAILURES =================================== _ TestUnitTestMethodDecorator.test_method_decorator_works_on_unittest_kwarg_frozen_time _ self = frozen_time = @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()) E AssertionError: FakeDate(2013, 4, 9) != datetime.datetime(2013, 4, 9, 0, 0) tests/test_datetimes.py:537: AssertionError _ TestUnitTestMethodDecorator.test_method_decorator_works_on_unittest_kwarg_frozen_time_with_func _ self = frozen_time = @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()) E AssertionError: FakeDate(2013, 4, 9) != datetime.datetime(2013, 4, 9, 0, 0) tests/test_datetimes.py:547: AssertionError _ TestUnitTestMethodDecorator.test_method_decorator_works_on_unittest_kwarg_hello _ self = kwargs = {'hello': } @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 E AssertionError: FakeDate(2013, 4, 9) != datetime.datetime(2013, 4, 9, 0, 0) tests/test_datetimes.py:542: AssertionError =============================== warnings summary =============================== tests/test_datetimes.py::test_simple_api /builddir/python3-freezegun-1.5.1/tests/test_datetimes.py:75: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). assert datetime.datetime.utcnow() != datetime.datetime(2012, 1, 14) tests/test_datetimes.py::test_compare_datetime_and_time_with_timezone /builddir/python3-freezegun-1.5.1/tests/test_datetimes.py:795: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC). assert now == datetime.datetime.utcfromtimestamp(time.time()) tests/test_datetimes.py::test_timestamp_with_tzoffset /builddir/python3-freezegun-1.5.1/tests/test_datetimes.py:812: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC). assert utcnow == datetime.datetime.utcfromtimestamp(time.time()) tests/test_pickle.py::test_pickle /builddir/python3-freezegun-1.5.1/tests/test_pickle.py:13: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). utc_now = datetime.datetime.utcnow() -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ FAILED tests/test_datetimes.py::TestUnitTestMethodDecorator::test_method_decorator_works_on_unittest_kwarg_frozen_time FAILED tests/test_datetimes.py::TestUnitTestMethodDecorator::test_method_decorator_works_on_unittest_kwarg_frozen_time_with_func FAILED tests/test_datetimes.py::TestUnitTestMethodDecorator::test_method_decorator_works_on_unittest_kwarg_hello ============= 3 failed, 128 passed, 6 skipped, 4 warnings in 0.79s ============= => ERROR: python3-freezegun-1.5.1_1: do_check: 'TZ="UTC" PYTHONPATH="${PWD}/build/lib" python3 -m pytest' exited with 1 => ERROR: in do_check() at srcpkgs/python3-freezegun/template:20 ```

git format-patch

```diff --- .../python3-freezegun/patches/py3.13.patch | 81 +++++++++++++++++++ srcpkgs/python3-freezegun/template | 6 +- 2 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/python3-freezegun/patches/py3.13.patch diff --git a/srcpkgs/python3-freezegun/patches/py3.13.patch b/srcpkgs/python3-freezegun/patches/py3.13.patch new file mode 100644 index 000000000..448df8cd2 --- /dev/null +++ b/srcpkgs/python3-freezegun/patches/py3.13.patch @@ -0,0 +1,81 @@ +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(-) + +diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml +index 67c263e..59200ca 100644 +--- a/.github/workflows/ci.yaml ++++ b/.github/workflows/ci.yaml +@@ -11,18 +11,20 @@ jobs: + strategy: + matrix: + python-version: +- - '3.7' + - '3.8' + - '3.9' + - '3.10' + - '3.11' + - '3.12' ++ - '3.13.0-beta.2' + + steps: + - uses: actions/checkout@master + + - name: Set up Python + uses: actions/setup-python@v4 ++ with: ++ python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | +@@ -44,16 +46,17 @@ jobs: + - '3.10' + - '3.11' + - '3.12' ++ - '3.13.0-beta.2' + implementation: + - '' # CPython + - 'pypy' # PyPy + exclude: # unreleased; +- - implementation: 'pypy' +- python-version: '3.10' + - implementation: 'pypy' + python-version: '3.11' + - implementation: 'pypy' + python-version: '3.12' ++ - implementation: 'pypy' ++ python-version: '3.13.0-beta.2' + + steps: + - uses: actions/checkout@master +diff --git a/tests/test_datetimes.py b/tests/test_datetimes.py +index a6f1989..b75ad3b 100644 +--- 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') diff --git a/srcpkgs/python3-freezegun/template b/srcpkgs/python3-freezegun/template index 653237b3f..dbc6f581e 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 -- 2.47.1 ```

Side note: I think a separate PR would be more appropriate.