forked from pool/python-pytz
Accepting request 261670 from devel:languages:python
1 OBS-URL: https://build.opensuse.org/request/show/261670 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytz?expand=0&rev=16
This commit is contained in:
commit
3d56409205
@ -1,3 +1,16 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Nov 13 12:17:35 UTC 2014 - aplanas@suse.com
|
||||
|
||||
- Use system tz database instead pytz one
|
||||
+ Add system_zoneinfo.patch
|
||||
+ Add timezone requirement
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 11 11:47:38 UTC 2014 - idonmez@suse.com
|
||||
|
||||
- Update to pytz 2014.9
|
||||
+ Database updated to 2014i
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jul 24 09:41:38 UTC 2014 - mcihar@suse.com
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
Name: python-pytz
|
||||
Version: 2014.4
|
||||
Version: 2014.9
|
||||
Release: 0
|
||||
Summary: World timezone definitions, modern and historical
|
||||
License: MIT
|
||||
@ -26,9 +26,14 @@ Url: http://pytz.sourceforge.net
|
||||
Source: http://pypi.python.org/packages/source/p/pytz/pytz-%{version}.tar.bz2
|
||||
# PATCH-FIX-UPSTREAM fix-tests.patch -- Remote tests which are known to be broken
|
||||
Patch0: fix-tests.patch
|
||||
# PATCH-FEATURE-OPENSUSE -- Use system tz database (Olson database)
|
||||
Patch1: system_zoneinfo.patch
|
||||
Requires: timezone
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: python-nose
|
||||
# Tests will use this package
|
||||
BuildRequires: timezone
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
||||
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||
@ -53,6 +58,8 @@ Amost all of the Olson timezones are supported.
|
||||
%setup -q -n pytz-%{version}
|
||||
# Disable test which is not working (and documented so)
|
||||
%patch0 -p1
|
||||
# Use system tz database
|
||||
%patch1 -p1
|
||||
# For rpmlint warning: remove shebang from python library:
|
||||
sed -i '/^#!/d' ./pytz/tzfile.py
|
||||
|
||||
@ -61,6 +68,8 @@ python setup.py build
|
||||
|
||||
%install
|
||||
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
||||
# Remove the pytz zoneinfo
|
||||
rm -fr %{buildroot}%{python_sitelib}/pytz/zoneinfo
|
||||
%fdupes %{buildroot}%{python_sitelib}
|
||||
|
||||
%check
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a339a5ba846985bcf0a87782492458752b5d95b56ba219de4c9404c0ee5beec9
|
||||
size 159160
|
3
pytz-2014.9.tar.bz2
Normal file
3
pytz-2014.9.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4ba0ab74fa7f34f77ff236ee2157454d1c2aaeaaa25932363bfa1be6cb82dbd6
|
||||
size 166230
|
44
system_zoneinfo.patch
Normal file
44
system_zoneinfo.patch
Normal file
@ -0,0 +1,44 @@
|
||||
Index: pytz-2014.9/pytz/__init__.py
|
||||
===================================================================
|
||||
--- pytz-2014.9.orig/pytz/__init__.py
|
||||
+++ pytz-2014.9/pytz/__init__.py
|
||||
@@ -25,11 +25,6 @@ __all__ = [
|
||||
|
||||
import sys, datetime, os.path, gettext
|
||||
|
||||
-try:
|
||||
- from pkg_resources import resource_stream
|
||||
-except ImportError:
|
||||
- resource_stream = None
|
||||
-
|
||||
from pytz.exceptions import AmbiguousTimeError
|
||||
from pytz.exceptions import InvalidTimeError
|
||||
from pytz.exceptions import NonExistentTimeError
|
||||
@@ -86,13 +81,7 @@ def open_resource(name):
|
||||
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)
|
||||
- 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
|
||||
- # pkg_resources is installed.
|
||||
- return resource_stream(__name__, 'zoneinfo/' + name)
|
||||
+ filename = os.path.join('/usr/share/zoneinfo', *name_parts)
|
||||
return open(filename, 'rb')
|
||||
|
||||
|
||||
Index: pytz-2014.9/pytz/tzfile.py
|
||||
===================================================================
|
||||
--- pytz-2014.9.orig/pytz/tzfile.py
|
||||
+++ pytz-2014.9/pytz/tzfile.py
|
||||
@@ -127,7 +127,7 @@ def build_tzinfo(zone, fp):
|
||||
if __name__ == '__main__':
|
||||
import os.path
|
||||
from pprint import pprint
|
||||
- base = os.path.join(os.path.dirname(__file__), 'zoneinfo')
|
||||
+ base = '/usr/share/zoneinfo'
|
||||
tz = build_tzinfo('Australia/Melbourne',
|
||||
open(os.path.join(base,'Australia','Melbourne'), 'rb'))
|
||||
tz = build_tzinfo('US/Eastern',
|
Loading…
x
Reference in New Issue
Block a user