Bug#714346: python-tz: source for timezone data not included

Helmut Grohne helmut at subdivi.de
Wed Nov 12 22:18:03 UTC 2014


Control: tags -1 + patch

On Fri, Jun 28, 2013 at 09:28:23AM +0200, Ansgar Burchardt wrote:
> The python-tz source package includes compiled timezone data without
> source in pytz/zoneinfo/*.  However source for all files needs to be
> present even for files not used in the binary packages.

One way to address this issue is to repack the source removing
pytz/zoneinfo/*. I implemented this approach and attach a .debdiff
facilitating the necessary changes. The .debdiff only contains the
changes to the debian folder. For applying a new upstream tarball must
be generated using uscan --download-current-version.

Note that python-tz has not been rebuilt in ages. The last built still
used pyshared and supports Python 2.6. Just rebuilding the package in
sid (regardless of the changes proposed), results in a very different
package that uses dh_python and drops support for Python 2.6.

I'd appreciate a review of the proposed changes with an eye towards the
Python aspects.

Helmut
-------------- next part --------------
diff -Nru python-tz-2012c/debian/changelog python-tz-2012c+dfsg/debian/changelog
--- python-tz-2012c/debian/changelog	2012-06-07 15:07:14.000000000 +0200
+++ python-tz-2012c+dfsg/debian/changelog	2014-11-12 23:08:09.000000000 +0100
@@ -1,3 +1,17 @@
+python-tz (2012c+dfsg-0.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Repack without zoneinfo files. (Closes: #714346)
+    + Add pytz/zoneinfo to Files-Excluded in d/copyright.
+    + Add dversionmangle to d/watch.
+    + Patch setup.py to not install zoneinfo files.
+    + Remove removal of zoneinfo files from d/rules.
+  * Rebuild (no source changes):
+    + Switch from pyshared to dh_python.
+    + Drop Python 2.6 support.
+
+ -- Helmut Grohne <helmut at subdivi.de>  Wed, 12 Nov 2014 22:19:38 +0100
+
 python-tz (2012c-1) unstable; urgency=low
 
   * Team upload.
diff -Nru python-tz-2012c/debian/copyright python-tz-2012c+dfsg/debian/copyright
--- python-tz-2012c/debian/copyright	2012-06-07 14:54:00.000000000 +0200
+++ python-tz-2012c+dfsg/debian/copyright	2014-11-12 22:18:53.000000000 +0100
@@ -2,6 +2,7 @@
 Upstream-Name: pytz
 Upstream-Contact: Stuart Bishop <stuart at stuartbishop.net>
 Source: http://pypi.python.org/pypi/pytz/
+Files-Excluded: pytz/zoneinfo/*
 
 Files: *
 Copyright: (c) 2003-2009 Stuart Bishop <stuart at stuartbishop.net>
@@ -23,8 +24,3 @@
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  DEALINGS IN THE SOFTWARE.
-
-Files: pytz/zoneinfo/*
-Copyright: Arthur David Olson et.al. <tz at elsie.nci.nih.gov>
-License: public-domain
-Comment: excluded from binary package
diff -Nru python-tz-2012c/debian/patches/tzdata python-tz-2012c+dfsg/debian/patches/tzdata
--- python-tz-2012c/debian/patches/tzdata	2012-06-06 04:20:09.000000000 +0200
+++ python-tz-2012c+dfsg/debian/patches/tzdata	2014-11-12 22:43:13.000000000 +0100
@@ -2,11 +2,12 @@
 Author: Kurt Roeckx <kurt at roeckx.be>
 Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=416202
 Forwarded: not-needed
+Last-Update: 2014-11-12
 
-Index: pytz-2011h/pytz/__init__.py
+Index: python-tz-2012c+dfsg/pytz/__init__.py
 ===================================================================
---- pytz-2011h.orig/pytz/__init__.py	2011-10-21 15:14:54.048406509 +0900
-+++ pytz-2011h/pytz/__init__.py	2011-10-21 15:14:57.232406629 +0900
+--- python-tz-2012c+dfsg.orig/pytz/__init__.py	2012-04-16 06:42:39.000000000 +0200
++++ python-tz-2012c+dfsg/pytz/__init__.py	2014-11-12 22:11:59.000000000 +0100
 @@ -31,11 +31,6 @@
  except ImportError:
      from collections import Mapping as DictMixin
@@ -39,11 +40,11 @@
      return open(filename, 'rb')
  
  
-Index: pytz-2011h/pytz/tzfile.py
+Index: python-tz-2012c+dfsg/pytz/tzfile.py
 ===================================================================
---- pytz-2011h.orig/pytz/tzfile.py	2011-06-27 22:48:49.000000000 +0900
-+++ pytz-2011h/pytz/tzfile.py	2011-10-21 15:16:11.116409439 +0900
-@@ -125,7 +125,8 @@
+--- python-tz-2012c+dfsg.orig/pytz/tzfile.py	2012-04-16 06:42:39.000000000 +0200
++++ python-tz-2012c+dfsg/pytz/tzfile.py	2014-11-12 22:11:59.000000000 +0100
+@@ -127,7 +127,8 @@
  if __name__ == '__main__':
      import os.path
      from pprint import pprint
@@ -53,3 +54,23 @@
      tz = build_tzinfo('Australia/Melbourne',
                        open(os.path.join(base,'Australia','Melbourne'), 'rb'))
      tz = build_tzinfo('US/Eastern',
+Index: python-tz-2012c+dfsg/setup.py
+===================================================================
+--- python-tz-2012c+dfsg.orig/setup.py	2012-04-16 06:42:39.000000000 +0200
++++ python-tz-2012c+dfsg/setup.py	2014-11-12 22:42:37.000000000 +0100
+@@ -13,15 +13,8 @@
+ memail = 'stuart at 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,
diff -Nru python-tz-2012c/debian/rules python-tz-2012c+dfsg/debian/rules
--- python-tz-2012c/debian/rules	2011-10-21 09:05:23.000000000 +0200
+++ python-tz-2012c+dfsg/debian/rules	2014-11-12 22:41:43.000000000 +0100
@@ -35,6 +35,3 @@
 
 	# install our testing package
 	install -D debian/test-pytz debian/python-tz/usr/lib/python-tz/test-pytz.py
-
-	# remove zoneinfo, our patch to pytz makes it use the one from tzdata
-	rm -rf debian/python*-tz/usr/lib/python*/*-packages/pytz/zoneinfo
diff -Nru python-tz-2012c/debian/watch python-tz-2012c+dfsg/debian/watch
--- python-tz-2012c/debian/watch	2011-10-21 07:54:27.000000000 +0200
+++ python-tz-2012c+dfsg/debian/watch	2014-11-12 22:32:41.000000000 +0100
@@ -1,2 +1,3 @@
 version=3
-http://pypi.python.org/packages/source/p/pytz/pytz-(.*).tar.gz
+opts=dversionmangle=s/\+dfsg\d*$// \
+ http://pypi.python.org/packages/source/p/pytz/pytz-(.*).tar.gz


More information about the pkg-zope-developers mailing list