From e08ad7bf553f3c33aee8fc90c83ed29635d37fea Mon Sep 17 00:00:00 2001 From: icp Date: Sat, 27 Aug 2022 00:49:02 +0530 Subject: [PATCH] python3-tzlocal: update to 4.2. --- .../python3-tzlocal/patches/fix-test.patch | 12 +++++++++ srcpkgs/python3-tzlocal/template | 26 +++++++------------ 2 files changed, 21 insertions(+), 17 deletions(-) create mode 100644 srcpkgs/python3-tzlocal/patches/fix-test.patch diff --git a/srcpkgs/python3-tzlocal/patches/fix-test.patch b/srcpkgs/python3-tzlocal/patches/fix-test.patch new file mode 100644 index 00000000000..7b5623df696 --- /dev/null +++ b/srcpkgs/python3-tzlocal/patches/fix-test.patch @@ -0,0 +1,12 @@ +--- a/tests/test_tzlocal.py ++++ b/tests/test_tzlocal.py +@@ -205,6 +205,9 @@ + + + def test_win32_no_dst(mocker): ++ sys.modules["winreg"] = MagicMock() ++ import tzlocal.win32 ++ + mocker.patch("tzlocal.utils.assert_tz_offset") + valuesmock = mocker.patch("tzlocal.win32.valuestodict") + diff --git a/srcpkgs/python3-tzlocal/template b/srcpkgs/python3-tzlocal/template index bc7ddacaf32..7b40a12dfe4 100644 --- a/srcpkgs/python3-tzlocal/template +++ b/srcpkgs/python3-tzlocal/template @@ -1,28 +1,20 @@ # Template file for 'python3-tzlocal' pkgname=python3-tzlocal -version=2.1 -revision=4 +version=4.2 +revision=1 wrksrc="tzlocal-${version}" -build_style=python3-module -hostmakedepends="python3-setuptools" -depends="python3-pytz" -checkdepends="python3-pytz python3-mock" +build_style=python3-pep517 +hostmakedepends="python3-wheel" +depends="python3-pytz_deprecation_shim" +checkdepends="${depends} python3-pytest-mock python3-pytest-xdist" short_desc="Return the tzinfo object for the local timezone (Python 3)" maintainer="Orphaned " license="MIT" homepage="https://github.com/regebro/tzlocal" changelog="https://raw.githubusercontent.com/regebro/tzlocal/master/CHANGES.txt" -distfiles="${PYPI_SITE}/t/tzlocal/tzlocal-${version}.tar.gz" -checksum=643c97c5294aedc737780a49d9df30889321cbe1204eac2c2ec6134035a92e44 - -post_patch() { - # In tzlocal development tree, below file is a symlink - # Hence, the check correctly report its value - rm -f tests/test_data/symlink_localtime/etc/localtime - ln -s ../usr/share/zoneinfo/Africa/Harare \ - tests/test_data/symlink_localtime/etc/localtime -} +distfiles="https://github.com/regebro/tzlocal/archive/refs/tags/${version}.tar.gz" +checksum=9bbfaedb6083467003bd1a622a412a7b2f1608f45b2d9132bf936f55fe72d65e post_install() { - vlicense LICENSE.txt LICENSE + vlicense LICENSE.txt }