add python-dateutil-2.8.1 patches
This commit is contained in:
parent
878e03d011
commit
b1a11ab6d1
@ -1,4 +1,6 @@
|
||||
AUX 0001-zoneinfo-Get-timezone-data-from-system-tzdata-r1.patch 3537 BLAKE2B 7f36974a98f5e6ff1961e91542e7c0ff8ee1d62ec4a400a8d8e09f60625660a5d76001855f876aedad7a66980fc5bab8cc2168436e8eddd9f2acfda0682c96cf SHA512 f540e9fd12d98d4d9ea2033187644856d7c7591e4a68f6143fb9335ff367a5b82f0dfdac90ba1ae8141d46a92f6a29015bfd71640fba60967571de4dfa8648bc
|
||||
AUX 0001-zoneinfo-Get-timezone-data-from-system-tzdata.patch 3504 BLAKE2B b26810c285257c14eec697e7529c3a85c637619dc19979a48b16b0ce45780041e84946748b30b048de84f5b35bb320dd7f79a22a13f42954433ad7ec7f3286a4 SHA512 37ad4c6630b0055a57704b375e6fa869c87a16b0d5d6c79bf77dd5cdfd7aeac56ad696e5a8acc5028b34dec35b932fa76e9fa8b26095cd369508af3386d3f89c
|
||||
AUX python-dateutil-2.8.1-no-pytest-cov.patch 687 BLAKE2B 97eb6d653a013b6fb279209804d7a82b4599ed672eb7a6b94654dc789ae3ad5e2978c9684439d94e405423c0a022ff70155c7d50f5d03a5e74cfe111a665ff7c SHA512 f4e90ed1d1cdab509a574319ae6cf0b646c2741eb05459c408caa29e1a6ca512e71a258ca8119c8e1f59948276c9e14e726b6f53cea868709bd89dea2280b700
|
||||
DIST python-dateutil-2.8.0.tar.gz 327134 BLAKE2B 6525eee57aeaef3c588413210df7c1ad3627a380c6e44af78e9acc9abea523b29e8d9afec495f8d1e585d25d32ab82e6e28bf93dca148893d2e6a533e1f4ce47 SHA512 ec7da86203572582f883a4686acf8a732a2de4f396d809057eb51b2c60dbca5623a7fa90c2c0618c281a2282c60841739bd837731a51cc876f4ff369297f2f81
|
||||
DIST python-dateutil-2.8.1.tar.gz 331745 BLAKE2B 9785fe93976d9bbe21d6610133e37e558cdde4062a1a738ccbf2bf80aa062882ba59c60f2b9bfc44c53e0f8fc4b5ebdd5d12b6ba54a60706576360e453b2f160 SHA512 337000216e0f8ce32d6363768444144183ab9268f69082f20858f2b3322b1c449e53b2f2b5dcb3645be22294659ce7838f74ace2fd7a7c4f2adc6cf806a9fa2c
|
||||
EBUILD python-dateutil-2.8.0-r1.ebuild 1126 BLAKE2B d1eacc87e39016e6281ffe2ed6aab73663ea2a4abf06ceeabc21873dda97860d5d4e6de0d2920e030b0bae453a8e54506096238d23af02fa1d389b5e29cb9f99 SHA512 42a7307f4dc456390ced69aee73922da6c43c8353d812fe34add72c257751becabf851a2591ecee0002274ce9d37444a0aca52210188005ccbea4c3ab245ca1c
|
||||
|
||||
@ -0,0 +1,104 @@
|
||||
From f48e70ae846c161dfbfe6ddb36e4bcad4427ac8c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
|
||||
Date: Tue, 3 Apr 2018 22:03:32 +0200
|
||||
Subject: [PATCH] zoneinfo: Get timezone data from system tzdata
|
||||
|
||||
---
|
||||
dateutil/test/test_imports.py | 3 +--
|
||||
dateutil/zoneinfo/__init__.py | 25 ++++++++++++++-----------
|
||||
2 files changed, 15 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/dateutil/test/test_imports.py b/dateutil/test/test_imports.py
|
||||
index 2a19b62..97d07e4 100644
|
||||
--- a/dateutil/test/test_imports.py
|
||||
+++ b/dateutil/test/test_imports.py
|
||||
@@ -158,9 +158,8 @@ class ImportZoneInfoTest(unittest.TestCase):
|
||||
def testZoneinfoStar(self):
|
||||
from dateutil.zoneinfo import gettz
|
||||
from dateutil.zoneinfo import gettz_db_metadata
|
||||
- from dateutil.zoneinfo import rebuild
|
||||
|
||||
- zi_all = (gettz, gettz_db_metadata, rebuild)
|
||||
+ zi_all = (gettz, gettz_db_metadata)
|
||||
|
||||
for var in zi_all:
|
||||
self.assertIsNot(var, None)
|
||||
diff --git a/dateutil/zoneinfo/__init__.py b/dateutil/zoneinfo/__init__.py
|
||||
index 34f11ad..e9870ca 100644
|
||||
--- a/dateutil/zoneinfo/__init__.py
|
||||
+++ b/dateutil/zoneinfo/__init__.py
|
||||
@@ -1,6 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import warnings
|
||||
import json
|
||||
+import os
|
||||
|
||||
from tarfile import TarFile
|
||||
from pkgutil import get_data
|
||||
@@ -10,7 +11,7 @@ from dateutil.tz import tzfile as _tzfile
|
||||
|
||||
__all__ = ["get_zonefile_instance", "gettz", "gettz_db_metadata"]
|
||||
|
||||
-ZONEFILENAME = "dateutil-zoneinfo.tar.gz"
|
||||
+ZONEDIRECTORY = "/usr/share/zoneinfo"
|
||||
METADATA_FN = 'METADATA'
|
||||
|
||||
|
||||
@@ -19,12 +20,14 @@ class tzfile(_tzfile):
|
||||
return (gettz, (self._filename,))
|
||||
|
||||
|
||||
-def getzoneinfofile_stream():
|
||||
- try:
|
||||
- return BytesIO(get_data(__name__, ZONEFILENAME))
|
||||
- except IOError as e: # TODO switch to FileNotFoundError?
|
||||
- warnings.warn("I/O error({0}): {1}".format(e.errno, e.strerror))
|
||||
- return None
|
||||
+def iter_zones(topdir):
|
||||
+ for dirpath, dirnames, filenames in os.walk(topdir):
|
||||
+ for f in filenames:
|
||||
+ if f.endswith(('.list', '.tab', '.zi', 'leapseconds')):
|
||||
+ continue
|
||||
+ fpath = os.path.join(dirpath, f)
|
||||
+ relpath = os.path.relpath(fpath, topdir)
|
||||
+ yield (relpath, tzfile(fpath, filename=relpath))
|
||||
|
||||
|
||||
class ZoneInfoFile(object):
|
||||
@@ -48,7 +51,7 @@ class ZoneInfoFile(object):
|
||||
# no metadata in tar file
|
||||
self.metadata = None
|
||||
else:
|
||||
- self.zones = {}
|
||||
+ self.zones = dict(iter_zones(ZONEDIRECTORY))
|
||||
self.metadata = None
|
||||
|
||||
def get(self, name, default=None):
|
||||
@@ -99,7 +102,7 @@ def get_zonefile_instance(new_instance=False):
|
||||
zif = getattr(get_zonefile_instance, '_cached_instance', None)
|
||||
|
||||
if zif is None:
|
||||
- zif = ZoneInfoFile(getzoneinfofile_stream())
|
||||
+ zif = ZoneInfoFile()
|
||||
|
||||
get_zonefile_instance._cached_instance = zif
|
||||
|
||||
@@ -140,7 +143,7 @@ def gettz(name):
|
||||
DeprecationWarning)
|
||||
|
||||
if len(_CLASS_ZONE_INSTANCE) == 0:
|
||||
- _CLASS_ZONE_INSTANCE.append(ZoneInfoFile(getzoneinfofile_stream()))
|
||||
+ _CLASS_ZONE_INSTANCE.append(ZoneInfoFile())
|
||||
return _CLASS_ZONE_INSTANCE[0].zones.get(name)
|
||||
|
||||
|
||||
@@ -163,5 +166,5 @@ def gettz_db_metadata():
|
||||
DeprecationWarning)
|
||||
|
||||
if len(_CLASS_ZONE_INSTANCE) == 0:
|
||||
- _CLASS_ZONE_INSTANCE.append(ZoneInfoFile(getzoneinfofile_stream()))
|
||||
+ _CLASS_ZONE_INSTANCE.append(ZoneInfoFile())
|
||||
return _CLASS_ZONE_INSTANCE[0].metadata
|
||||
--
|
||||
2.17.0
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
diff --git a/dateutil/test/conftest.py b/dateutil/test/conftest.py
|
||||
index 78ed70a..4bb4c0a 100644
|
||||
--- a/dateutil/test/conftest.py
|
||||
+++ b/dateutil/test/conftest.py
|
||||
@@ -14,10 +14,11 @@ def pytest_collection_modifyitems(items):
|
||||
|
||||
marker = marker_getter('xfail')
|
||||
|
||||
+ # requires pytest-cov
|
||||
# Need to query the args because conditional xfail tests still have
|
||||
# the xfail mark even if they are not expected to fail
|
||||
- if marker and (not marker.args or marker.args[0]):
|
||||
- item.add_marker(pytest.mark.no_cover)
|
||||
+ #if marker and (not marker.args or marker.args[0]):
|
||||
+ # item.add_marker(pytest.mark.no_cover)
|
||||
|
||||
|
||||
def set_tzpath():
|
||||
Loading…
x
Reference in New Issue
Block a user