[packages/python-dateutil] - updated to 2.5.0 - system-zoneinfo patch dropped; dateutil.zoneinfo contains internal implementati

qboosh qboosh at pld-linux.org
Tue Mar 15 20:28:49 CET 2016


commit 562303085162b34c74efe2656da3f0f3f5cc4c7a
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Tue Mar 15 20:32:49 2016 +0100

    - updated to 2.5.0
    - system-zoneinfo patch dropped; dateutil.zoneinfo contains internal implementation,
      for system database use dateutil.tz
    - subpackaged -zoneinfo (not required normally unless referenced explicitly)

 python-dateutil.spec  |  84 ++++++++++++++++++++++++++++----------
 system-zoneinfo.patch | 109 --------------------------------------------------
 2 files changed, 63 insertions(+), 130 deletions(-)
---
diff --git a/python-dateutil.spec b/python-dateutil.spec
index cfbbdfd..6a3f6a8 100644
--- a/python-dateutil.spec
+++ b/python-dateutil.spec
@@ -7,16 +7,16 @@
 Summary:	Extensions to the standard Python datetime module
 Summary(pl.UTF-8):	Rozszerzenia modułu datetime języka Python
 Name:		python-dateutil
-Version:	2.2
-Release:	5
+Version:	2.5.0
+Release:	1
 License:	BSD
 Group:		Libraries/Python
+#Source0Download: https://pypi.python.org/simple/python-dateutil/
 Source0:	https://pypi.python.org/packages/source/p/python-dateutil/python-%{module}-%{version}.tar.gz
-# Source0-md5:	c1f654d0ff7e33999380a8ba9783fd5c
-Patch0:		system-zoneinfo.patch
-URL:		http://labix.org/python-dateutil
+# Source0-md5:	89cc81c2ee11cf71102c1d3985a01ecb
+URL:		https://dateutil.readthedocs.org/
 BuildRequires:	rpm-pythonprov
-BuildRequires:	rpmbuild(macros) >= 1.710
+BuildRequires:	rpmbuild(macros) >= 1.714
 %if %{with python2}
 BuildRequires:	python-modules >= 1:2.6
 BuildRequires:	python-setuptools
@@ -25,8 +25,8 @@ BuildRequires:	python-setuptools
 BuildRequires:	python3-modules >= 1:3.2
 BuildRequires:	python3-setuptools
 %endif
-Requires:	python-six
-Requires:	tzdata >= 2013h
+Requires:	python-six >= 1.5
+Requires:	tzdata >= 2016a
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -54,12 +54,30 @@ datetime, dostępnego w Pythonie 2.3+. Pozwala na:
 
 Ten pakiet zawiera moduł Pythona 2.x.
 
+%package zoneinfo
+Summary:	Internal zoneinfo implementation for Python 2 dateutil module
+Summary(pl.UTF-8):	Wewnętrzna implementacja zoneinfo dla modułu Pythona 2 dateutil
+Group:		Libraries/Python
+Requires:	%{name} = %{version}-%{release}
+
+%description zoneinfo
+Internal zoneinfo implementation for Python 2 dateutil module.
+
+Note: it contains own timezone database, which might not be up to date
+with system zoneinfo data.
+
+%description zoneinfo -l pl.UTF-8
+Wewnętrzna implementacja zoneinfo dla modułu Pythona 2 dateutil.
+
+Uwaga: zawiera własną bazę danych stref czasowych, która nie musi być
+aktualna w stosunku do systemowych danych zoneinfo.
+
 %package -n python3-dateutil
 Summary:	Extensions to the standard Python datetime module
 Summary(pl.UTF-8):	Rozszerzenia modułu datetime języka Python
 Group:		Libraries/Python
-Requires:	python3-six
-Requires:	tzdata >= 2013h
+Requires:	python3-six >= 1.5
+Requires:	tzdata >= 2016a
 
 %description -n python3-dateutil
 The dateutil module provides powerful extensions to the standard
@@ -85,9 +103,26 @@ datetime, dostępnego w Pythonie 2.3+. Pozwala na:
 
 Ten pakiet zawiera moduł Pythona 3.x.
 
+%package -n python3-dateutil-zoneinfo
+Summary:	Internal zoneinfo implementation for Python 2 dateutil module
+Summary(pl.UTF-8):	Wewnętrzna implementacja zoneinfo dla modułu Pythona 2 dateutil
+Group:		Libraries/Python
+Requires:	python3-dateutil = %{version}-%{release}
+
+%description -n python3-dateutil-zoneinfo
+Internal zoneinfo implementation for Python 2 dateutil module.
+
+Note: it contains own timezone database, which might not be up to date
+with system zoneinfo data.
+
+%description -n python3-dateutil-zoneinfo -l pl.UTF-8
+Wewnętrzna implementacja zoneinfo dla modułu Pythona 2 dateutil.
+
+Uwaga: zawiera własną bazę danych stref czasowych, która nie musi być
+aktualna w stosunku do systemowych danych zoneinfo.
+
 %prep
 %setup -q
-%patch0 -p1
 
 %build
 %if %{with python2}
@@ -105,16 +140,10 @@ rm -rf $RPM_BUILD_ROOT
 %py_install
 
 %py_postclean
-
-# NOTE: Not sure but seems zoneinfo is needed under windows only
-%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/dateutil/zoneinfo
 %endif
 
 %if %{with python3}
 %py3_install
-
-# NOTE: Not sure but seems zoneinfo is needed under windows only
-%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/dateutil/zoneinfo
 %endif
 
 %clean
@@ -123,15 +152,28 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python2}
 %files
 %defattr(644,root,root,755)
-%doc LICENSE NEWS README
-%{py_sitescriptdir}/dateutil
+%doc LICENSE NEWS README.rst
+%dir %{py_sitescriptdir}/dateutil
+%{py_sitescriptdir}/dateutil/*.py[co]
+%{py_sitescriptdir}/dateutil/tz
 %{py_sitescriptdir}/python_dateutil-%{version}-py*.egg-info
+
+%files zoneinfo
+%defattr(644,root,root,755)
+%{py_sitescriptdir}/dateutil/zoneinfo
 %endif
 
 %if %{with python3}
 %files -n python3-dateutil
 %defattr(644,root,root,755)
-%doc LICENSE NEWS README
-%{py3_sitescriptdir}/dateutil
+%doc LICENSE NEWS README.rst
+%dir %{py3_sitescriptdir}/dateutil
+%{py3_sitescriptdir}/dateutil/*.py
+%{py3_sitescriptdir}/dateutil/__pycache__
+%{py3_sitescriptdir}/dateutil/tz
 %{py3_sitescriptdir}/python_dateutil-%{version}-py*.egg-info
+
+%files -n python3-dateutil-zoneinfo
+%defattr(644,root,root,755)
+%{py3_sitescriptdir}/dateutil/zoneinfo
 %endif
diff --git a/system-zoneinfo.patch b/system-zoneinfo.patch
deleted file mode 100644
index b669624..0000000
--- a/system-zoneinfo.patch
+++ /dev/null
@@ -1,109 +0,0 @@
-diff -up python-dateutil-1.5/dateutil/zoneinfo/__init__.py\~ python-dateutil-1.5/dateutil/zoneinfo/__init__.py
---- python-dateutil-1.5/dateutil/zoneinfo/__init__.py~	2005-12-22 19:13:50.000000000 +0100
-+++ python-dateutil-1.5/dateutil/zoneinfo/__init__.py	2011-08-17 15:24:29.019214748 +0200
-@@ -15,6 +15,7 @@ __all__ = ["setcachesize", "gettz", "reb
- 
- CACHE = []
- CACHESIZE = 10
-+USE_SYSTEM_ZONEINFO = True # XXX configure at build time
- 
- class tzfile(tzfile):
-     def __reduce__(self):
-@@ -29,7 +30,8 @@ def getzoneinfofile():
-             return os.path.join(os.path.dirname(__file__), entry)
-     return None
- 
--ZONEINFOFILE = getzoneinfofile()
-+ZONEINFOFILE = getzoneinfofile() if USE_SYSTEM_ZONEINFO else None
-+ZONEINFODIR = (os.getenv("TZDIR") or "/usr/share/zoneinfo").rstrip(os.sep)
- 
- del getzoneinfofile
- 
-@@ -39,22 +40,37 @@ def setcachesize(size):
-     del CACHE[size:]
- 
- def gettz(name):
--    tzinfo = None
--    if ZONEINFOFILE:
--        for cachedname, tzinfo in CACHE:
--            if cachedname == name:
--                break
-+    for cachedname, tzinfo in CACHE:
-+        if cachedname == name:
-+            return tzinfo
-+
-+    name_parts = name.lstrip('/').split('/')
-+    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(ZONEINFODIR, *name_parts)
-+    try:
-+        zonefile = open(filename, "rb")
-+    except:
-+        tzinfo = None
-+    else:
-+        tzinfo = tzfile(zonefile)
-+        zonefile.close()
-+
-+    if tzinfo is None and ZONEINFOFILE:
-+        tf = TarFile.open(ZONEINFOFILE)
-+        try:
-+            zonefile = tf.extractfile(name)
-+        except KeyError:
-+            tzinfo = None
-         else:
--            tf = TarFile.open(ZONEINFOFILE)
--            try:
--                zonefile = tf.extractfile(name)
--            except KeyError:
--                tzinfo = None
--            else:
--                tzinfo = tzfile(zonefile)
--            tf.close()
--            CACHE.insert(0, (name, tzinfo))
--            del CACHE[CACHESIZE:]
-+            tzinfo = tzfile(zonefile)
-+        tf.close()
-+
-+    if tzinfo is not None:
-+        CACHE.insert(0, (name, tzinfo))
-+        del CACHE[CACHESIZE:]
-+
-     return tzinfo
- 
- def rebuild(filename, tag=None, format="gz"):
---- python-dateutil-2.2/setup.py.orig	2013-11-01 09:32:03.000000000 +0100
-+++ python-dateutil-2.2/setup.py	2014-10-19 16:56:34.244854176 +0200
-@@ -16,6 +16,16 @@
- VERSION = re.search('__version__ = "([^"]+)"',
-                     codecs.open(TOPDIR + "/dateutil/__init__.py", encoding='utf-8').read()).group(1)
- 
-+# XXX We would like to bind this to something like
-+# --system-zoneinfo=/path/to/zoneinfo.  Any way of doing this short of
-+# overriding build and install commands?
-+if False:
-+    extra_options = dict(
-+        package_data={"": ["*.tar.gz"]},
-+        )
-+else:
-+    extra_options = {}
-+
- 
- setup(name="python-dateutil",
-       version = VERSION,
-@@ -30,7 +40,6 @@
- datetime module available in the Python standard library.
- """,
-       packages = ["dateutil", "dateutil.zoneinfo"],
--      package_data = {"": ["*.tar.gz"]},
-       include_package_data = True,
-       zip_safe = False,
-       requires = ["six"],
-@@ -47,5 +56,6 @@
-           'Programming Language :: Python :: 3.2',
-           'Programming Language :: Python :: 3.3',
-           'Topic :: Software Development :: Libraries',
--      ]
-+      ],
-+      **extra_options
-       )
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-dateutil.git/commitdiff/562303085162b34c74efe2656da3f0f3f5cc4c7a



More information about the pld-cvs-commit mailing list