From a98fd37bf0617b7ee2ffe21b0ea54cdfd1108897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Wed, 3 Jan 2024 19:18:56 -0300 Subject: [PATCH] python3-ipyparallel: fix utcnow deprecation and one more test. --- .../818-mock-assert_called_once_with.patch | 21 +++++++++++++++++++ .../patches/859-utcnow-deprecation.patch | 15 +++++++++++++ srcpkgs/python3-ipyparallel/template | 2 +- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/python3-ipyparallel/patches/818-mock-assert_called_once_with.patch create mode 100644 srcpkgs/python3-ipyparallel/patches/859-utcnow-deprecation.patch diff --git a/srcpkgs/python3-ipyparallel/patches/818-mock-assert_called_once_with.patch b/srcpkgs/python3-ipyparallel/patches/818-mock-assert_called_once_with.patch new file mode 100644 index 00000000000..9b8ea0a2754 --- /dev/null +++ b/srcpkgs/python3-ipyparallel/patches/818-mock-assert_called_once_with.patch @@ -0,0 +1,21 @@ +https://github.com/ipython/ipyparallel/pull/818 + +commit 47aba76d77b1ae83463badcd1a9002c74cc454cc +Author: Miro HronĨok +Date: Mon Jul 3 20:52:18 2023 +0200 + + Fix unittest.mock usage on Python 3.12 + +diff --git a/ipyparallel/tests/test_util.py b/ipyparallel/tests/test_util.py +index f4e0c953..eb1e11dc 100644 +--- a/ipyparallel/tests/test_util.py ++++ b/ipyparallel/tests/test_util.py +@@ -14,7 +14,7 @@ def test_disambiguate_ip(warn_mock): + assert util.disambiguate_ip_address('0.0.0.0', socket.gethostname()) == localhost() + wontresolve = 'this.wontresolve.dns' + assert util.disambiguate_ip_address('0.0.0.0', wontresolve) == wontresolve +- assert warn_mock.called_once_with( ++ warn_mock.assert_called_once_with( + 'IPython could not determine IPs for {}: ' + '[Errno -2] Name or service not known'.format(wontresolve), + RuntimeWarning, diff --git a/srcpkgs/python3-ipyparallel/patches/859-utcnow-deprecation.patch b/srcpkgs/python3-ipyparallel/patches/859-utcnow-deprecation.patch new file mode 100644 index 00000000000..695000588b3 --- /dev/null +++ b/srcpkgs/python3-ipyparallel/patches/859-utcnow-deprecation.patch @@ -0,0 +1,15 @@ +https://github.com/ipython/ipyparallel/pull/859 + +diff --git a/ipyparallel/util.py b/ipyparallel/util.py +index 130d8cef..f1ba8b2e 100644 +--- a/ipyparallel/util.py ++++ b/ipyparallel/util.py +@@ -591,7 +589,7 @@ def compare_datetimes(a, b): + + def utcnow(): + """Timezone-aware UTC timestamp""" +- return datetime.utcnow().replace(tzinfo=utc) ++ return datetime.now(utc) + + + def _v(version_s): diff --git a/srcpkgs/python3-ipyparallel/template b/srcpkgs/python3-ipyparallel/template index 55bdf592292..02d954de1f9 100644 --- a/srcpkgs/python3-ipyparallel/template +++ b/srcpkgs/python3-ipyparallel/template @@ -1,7 +1,7 @@ # Template file for 'python3-ipyparallel' pkgname=python3-ipyparallel version=8.6.1 -revision=2 +revision=3 build_style=python3-pep517 hostmakedepends="hatchling" depends="python3-entrypoints python3-decorator python3-pyzmq python3-traitlets