Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pytz/, dev-python/pytz/files/
Date: Fri, 25 Dec 2020 09:17:19
Message-Id: 1608885461.0c2448f5380c933df73fed46490ef130aec4f1e5.mgorny@gentoo
1 commit: 0c2448f5380c933df73fed46490ef130aec4f1e5
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 25 08:20:33 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 25 08:37:41 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c2448f5
7
8 dev-python/pytz: Bump to 2020.5
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/pytz/Manifest | 1 +
13 .../pytz/files/pytz-2020.5-system-zoneinfo.patch | 33 ++++++++++++++++++++++
14 dev-python/pytz/pytz-2020.5.ebuild | 32 +++++++++++++++++++++
15 3 files changed, 66 insertions(+)
16
17 diff --git a/dev-python/pytz/Manifest b/dev-python/pytz/Manifest
18 index 403e47ba5db..13d5040e6f8 100644
19 --- a/dev-python/pytz/Manifest
20 +++ b/dev-python/pytz/Manifest
21 @@ -1 +1,2 @@
22 DIST pytz-2020.4.tar.gz 310941 BLAKE2B 8abe524ccb7ed676c64dbc129ade5d6562980ea28f8939a3a7a406acf16a8a936e79ff630bf37884610e8936dfe96311ecb752f3b79519a126e1f1ac48883842 SHA512 dcbe763bc6e48c52df855fe03a8109dc0656a0e851324c0468f4307e8aff60e577fe0c9f0b062319e90d2f639b96e98edf8346064705e244143386c863a0aa7c
23 +DIST pytz-2020.5.tar.gz 314194 BLAKE2B c374e0ee803878ad2dde1ef03c108f59f431d645d8067fb9f183b9feb029b4de283477e7f6c146a6d03462bd5cb4fc98118e03601c838f73903f5f7a7d28bf8f SHA512 0845c0b7cefb8732e3016568b17ae73232fe6537bac6da89cb1bf911ba5786ee1be6b5e3aa8767225291e3a7e9afd5b8e40e4051671a3a006f9e2f71c551e13e
24
25 diff --git a/dev-python/pytz/files/pytz-2020.5-system-zoneinfo.patch b/dev-python/pytz/files/pytz-2020.5-system-zoneinfo.patch
26 new file mode 100644
27 index 00000000000..94bad7e234a
28 --- /dev/null
29 +++ b/dev-python/pytz/files/pytz-2020.5-system-zoneinfo.patch
30 @@ -0,0 +1,33 @@
31 +diff --git a/pytz/__init__.py b/pytz/__init__.py
32 +index a1f75b6..f2a2330 100644
33 +--- a/pytz/__init__.py
34 ++++ b/pytz/__init__.py
35 +@@ -92,8 +92,7 @@ def open_resource(name):
36 + if zoneinfo_dir is not None:
37 + filename = os.path.join(zoneinfo_dir, *name_parts)
38 + else:
39 +- filename = os.path.join(os.path.dirname(__file__),
40 +- 'zoneinfo', *name_parts)
41 ++ filename = os.path.join('/usr/share/zoneinfo', *name_parts)
42 + if not os.path.exists(filename):
43 + # http://bugs.launchpad.net/bugs/383171 - we avoid using this
44 + # unless absolutely necessary to help when a broken version of
45 +diff --git a/setup.py b/setup.py
46 +index e31ff2b..ba6926b 100644
47 +--- a/setup.py
48 ++++ b/setup.py
49 +@@ -15,14 +15,8 @@ me = 'Stuart Bishop'
50 + memail = 'stuart@××××××××××××.net'
51 + packages = ['pytz']
52 + resources = ['zone.tab', 'locales/pytz.pot']
53 +-for dirpath, dirnames, filenames in os.walk(os.path.join('pytz', 'zoneinfo')):
54 +- # remove the 'pytz' part of the path
55 +- basepath = dirpath.split(os.path.sep, 1)[1]
56 +- resources.extend([os.path.join(basepath, filename) for filename in filenames])
57 + package_data = {'pytz': resources}
58 +
59 +-assert len(resources) > 10, 'zoneinfo files not found!'
60 +-
61 + setup(
62 + name='pytz',
63 + version=pytz.VERSION,
64
65 diff --git a/dev-python/pytz/pytz-2020.5.ebuild b/dev-python/pytz/pytz-2020.5.ebuild
66 new file mode 100644
67 index 00000000000..58a2cbcffbd
68 --- /dev/null
69 +++ b/dev-python/pytz/pytz-2020.5.ebuild
70 @@ -0,0 +1,32 @@
71 +# Copyright 1999-2020 Gentoo Authors
72 +# Distributed under the terms of the GNU General Public License v2
73 +
74 +EAPI=7
75 +
76 +PYTHON_COMPAT=( python3_{6,7,8,9} pypy3 )
77 +PYTHON_REQ_USE="threads(+)"
78 +
79 +inherit distutils-r1
80 +
81 +DESCRIPTION="World timezone definitions for Python"
82 +HOMEPAGE="https://pythonhosted.org/pytz/ https://pypi.org/project/pytz/"
83 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
84 +
85 +LICENSE="MIT"
86 +SLOT="0"
87 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris"
88 +IUSE=""
89 +
90 +RDEPEND="
91 + || ( >=sys-libs/timezone-data-2017a sys-libs/glibc[vanilla] )"
92 +DEPEND="${RDEPEND}
93 + app-arch/unzip"
94 +
95 +PATCHES=(
96 + # Use timezone-data zoneinfo.
97 + "${FILESDIR}"/pytz-2020.5-system-zoneinfo.patch
98 +)
99 +
100 +python_test() {
101 + "${EPYTHON}" pytz/tests/test_tzinfo.py -v || die "Tests fail with ${EPYTHON}"
102 +}