pytz-2018.7

This commit is contained in:
Andreas Billmeier 2018-12-23 00:55:36 +01:00
parent 9bc6c4236f
commit 822a119d57
8 changed files with 150 additions and 0 deletions

8
dev-python/pytz/Manifest Normal file
View File

@ -0,0 +1,8 @@
AUX 2016.6.1-zoneinfo.patch 569 BLAKE2B a4cb4ae2bd6953f8f315bb0c444bd083d3431d85128fb9d0ab3c97ad3679114a5f0ce13afcde65070d8bad0fc586b893260b30ccfe793bba6be26f85e9e08b22 SHA512 d1b2bf717c8099eb5cfbe353d50eb034ed321303f6430c0f4183dd84a64780157615b29b7aaf7c04eb8fe69e48c039e479f22f70f713b2aa5e907ae371c8ba01
AUX 2018.4-zoneinfo.patch 549 BLAKE2B 5654ac8133627afaf9dc17dd9ae8e6a22ef9206efc6ca88495bfdec0078fc77a290ab7a62d6d1aa722ac01b9428bf37382d5f19d9da65593aed43354d05ceeec SHA512 eb365950d2eb62c8d984146228c7d96fca96b2ab4ea90b951a85b3f450550451e6c014da21e403476435e71c5ae989f169d21e07c56fab9713dacec0aee3184f
AUX pytz-2009h-zoneinfo-noinstall.patch 957 BLAKE2B aec135326ab00e0287fc1c57ca745bc113ab8f0564d7328e82ed00cb024ad8a5008dcac4a7f580967672e996e861bc994fd307de7aee7e55f5e8623fe64844c5 SHA512 142d3ac58be3fffc35e2dc1f70ee988a7c9ebec51518d15bee9d36f4d4a08178840fa4d73f9734e92192c3633e517f525a9d583f7b5dc754af83f7c9536bd446
AUX pytz-2009j-zoneinfo.patch 651 BLAKE2B 9e0f5d4f037691ee02809ae46887d6f4f5a390e95f670d604a6525b9b68ba4b1743ed34a8c0c05b70f436e2023bc0c9326a6a9fa46ac3ce87eb9438adcdb60b2 SHA512 228d3c59e3e0b5b0b3b80f5b0b6e947815d11191fd5523d17420dde6cea488bc544c05b552619934c4ca72c30ebefd042114abfea6c72f03710e96a776f39038
AUX pytz-2018.4-zoneinfo-noinstall.patch 579 BLAKE2B 1d21d01160dbdf6c6848c2c0088cbc6ca326270b106098ce7157b363acf6f4da750a58498be95a8b5bf1ee342b679fdbbf16cf9d542d5f46088062db83f866f7 SHA512 309c2427f5a8ebb77bdf899ad3fb34029c46901cbaf2baf3ab697b83608dd1d3c6e7cf776b1b9b592918b91cbafd148ee3e4c0b4255f38ea3e41c0bca94f4c51
DIST pytz-2018.7.tar.gz 300745 BLAKE2B 56bfadbaac2eef1d007a321041c74af3bd6166c434a87a70a7ab1aa7ebe29f93b1a5081fa20b13f5a665259e7f5ee964a8ce0237e39cfee09ffccb8c5c5b5c49 SHA512 49cd9ed0b4b0959bab59c91ac1ced36b28ab0fa097002ab1d45daa0e7f962c43de2e0b9228344d9b1f8aa4dc2f3b02d51f41a3ed7e6af8c51fc2eec7aace5b48
EBUILD pytz-2018.7.ebuild 1029 BLAKE2B 911f0c75682d7cb40f04f7a15c5b9ba94a2920199f1562814f90be7d87bc6118bc8df39391cc2405cba4f465339316f633860c891f908f25168e91b9b98d790a SHA512 578f3e0c207e31b483f4435ad7d065a0e905181c5f2cac8e5c8b88b0a25b182b884eefb37876010526ecc6139d7016cb70baada84095c2bc3402ae51cffe1d37
MISC metadata.xml 739 BLAKE2B d96611c8cdfc1d45fa86eabcbcc60ed1d3f7e7d2a358a2fc5cf54a64ac3427140299651263e0be1cc4d2f87750df81c4adac9512be75ab334d38f44a375238ea SHA512 b7c9e6ea1b5bd128f1c5ce0a77171d0b7cdbb6f8ffb186d92aa4167d2d84c60c28c647cae66ffc7532350bca13ab65aaab5eb441f68321fc786a14b90f8813e8

View File

@ -0,0 +1,12 @@
--- a/pytz/__init__.py
+++ b/pytz/__init__.py
@@ -81,8 +81,7 @@
for part in name_parts:
if part == os.path.pardir or os.path.sep in part:
raise ValueError('Bad path segment: %r' % part)
- filename = os.path.join(os.path.dirname(__file__),
- 'zoneinfo', *name_parts)
+ filename = os.path.join('/usr/share/zoneinfo', *name_parts)
if not os.path.exists(filename):
# http://bugs.launchpad.net/bugs/383171 - we avoid using this
# unless absolutely necessary to help when a broken version of

View File

@ -0,0 +1,12 @@
--- a/pytz/__init__.py
+++ b/pytz/__init__.py
@@ -91,8 +91,7 @@
if zoneinfo_dir is not None:
filename = os.path.join(zoneinfo_dir, *name_parts)
else:
- filename = os.path.join(os.path.dirname(__file__),
- 'zoneinfo', *name_parts)
+ filename = os.path.join('/usr/share/zoneinfo', *name_parts)
if not os.path.exists(filename):
# http://bugs.launchpad.net/bugs/383171 - we avoid using this
# unless absolutely necessary to help when a broken version of

View File

@ -0,0 +1,32 @@
From e43745593e4627de8027587cb3b4a465c93fa0b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Wed, 19 Dec 2012 19:22:29 +0100
Subject: [PATCH] Do not install zoneinfo files.
---
setup.py | 7 -------
1 file changed, 7 deletions(-)
diff --git a/setup.py b/setup.py
index c8152d5..8f13279 100644
--- a/setup.py
+++ b/setup.py
@@ -13,15 +13,8 @@ me = 'Stuart Bishop'
memail = 'stuart@stuartbishop.net'
packages = ['pytz']
resources = ['zone.tab', 'locales/pytz.pot']
-for dirpath, dirnames, filenames in os.walk(os.path.join('pytz', 'zoneinfo')):
- # remove the 'pytz' part of the path
- basepath = dirpath.split(os.path.sep, 1)[1]
- resources.extend([os.path.join(basepath, filename)
- for filename in filenames])
package_data = {'pytz': resources}
-assert len(resources) > 10, 'zoneinfo files not found!'
-
setup (
name='pytz',
version=pytz.VERSION,
--
1.8.0.2

View File

@ -0,0 +1,14 @@
Use the system zoneinfo from sys-libs/timezone-data.
--- pytz/__init__.py
+++ pytz/__init__.py
@@ -54,8 +54,7 @@
for part in name_parts:
if part == os.path.pardir or os.path.sep in part:
raise ValueError('Bad path segment: %r' % part)
- filename = os.path.join(os.path.dirname(__file__),
- 'zoneinfo', *name_parts)
+ filename = os.path.join('/usr/share/zoneinfo', *name_parts)
if not os.path.exists(filename) and resource_stream is not None:
# http://bugs.launchpad.net/bugs/383171 - we avoid using this
# unless absolutely necessary to help when a broken version of

View File

@ -0,0 +1,18 @@
--- a/setup.py
+++ b/setup.py
@@ -15,15 +15,8 @@
memail = 'stuart@stuartbishop.net'
packages = ['pytz']
resources = ['zone.tab', 'locales/pytz.pot']
-for dirpath, dirnames, filenames in os.walk(os.path.join('pytz', 'zoneinfo')):
- # remove the 'pytz' part of the path
- basepath = dirpath.split(os.path.sep, 1)[1]
- resources.extend([os.path.join(basepath, filename)
- for filename in filenames])
package_data = {'pytz': resources}
-assert len(resources) > 10, 'zoneinfo files not found!'
-
setup(
name='pytz',
version=pytz.VERSION,

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>python@gentoo.org</email>
<name>Python</name>
</maintainer>
<longdescription lang="en">
pytz brings the Olson tz database into Python. This library allows
accurate and cross platform timezone calculations using Python 2.3
or higher. It also solves the issue of ambiguous times at the end of
daylight savings, which you can read more about in the Python
Library Reference (datetime.tzinfo).
Amost all (over 540) of the Olson timezones are supported.
</longdescription>
<upstream>
<remote-id type="pypi">pytz</remote-id>
</upstream>
</pkgmetadata>

View File

@ -0,0 +1,35 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} pypy pypy3 )
PYTHON_REQ_USE="threads(+)"
inherit distutils-r1
DESCRIPTION="World timezone definitions for Python"
HOMEPAGE="https://pythonhosted.org/pytz/ https://pypi.org/project/pytz/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris"
IUSE=""
RDEPEND="
dev-python/setuptools[${PYTHON_USEDEP}]
|| ( >=sys-libs/timezone-data-2017a sys-libs/glibc[vanilla] )"
DEPEND="${RDEPEND}
app-arch/unzip"
PATCHES=(
# Use timezone-data zoneinfo.
"${FILESDIR}"/2018.4-zoneinfo.patch
# ...and do not install a copy of it.
"${FILESDIR}"/${PN}-2018.4-zoneinfo-noinstall.patch
)
python_test() {
"${PYTHON}" pytz/tests/test_tzinfo.py -v || die "Tests fail with ${EPYTHON}"
}