Ubuntu

Merge lp:~takluyver/ubuntu/quantal/python-tz/merge-py3 into lp:ubuntu/quantal/python-tz

Proposed by Thomas Kluyver on 2012-05-12
Status: Merged
Merge reported by: James Page
Merged at revision: not available
Proposed branch: lp:~takluyver/ubuntu/quantal/python-tz/merge-py3
Merge into: lp:ubuntu/quantal/python-tz
Diff against target: 252 lines (+99/-66) 9 files modified
To merge this branch: bzr merge lp:~takluyver/ubuntu/quantal/python-tz/merge-py3
Reviewer Review Type Date Requested Status
Barry Warsaw Approve on 2012-05-22
Ubuntu branches 2012-05-12 Pending
Review via email: mp+105551@code.launchpad.net

Description of the Change

This merges packaging changes from Debian to build a python3-tz package.

I also cleaned up a couple of Lintian warnings, and I noticed that the zoneinfo data files weren't being removed from the Python 3 package, so I fixed that.

To post a comment you must log in.
Barry Warsaw (barry) wrote :

Hi Thomas,

This is really great, and I appreciate your contribution to Ubuntu, especially because this adds Python 3 support to a very useful package. I was able to build it locally and try it out on both Python 2 and Python 3. Everything works great.

I get one warning when building the source package:

W: python-tz source: missing-license-paragraph-in-dep5-copyright public-domain (paragraph at line 27)

and I get one minor warning on the resulting .debs:

% lintian *.deb
W: python-tz: wrong-name-for-upstream-changelog usr/share/doc/python-tz/CHANGES.txt

The other thing I suggest is to structure your debian/rules file to be more in line with these recommendations:

http://wiki.debian.org/Python/LibraryStyleGuide

Pay attention specifically to the section on enabling the tests in all versions (which I see is currently disabled -- why?) and in avoiding the use of for-loops to build the Python 3 packages. If you fix these, I would happily sponsor your upload, but for Quantal only, as this is a new feature that isn't appropriate for SRU'ing into Precise.

review: Needs Fixing
Barry Warsaw (barry) wrote :

Oh, also it should be

%:
        dh $@ --with python2,python3

Thomas Kluyver (takluyver) wrote :

Thanks, Barry

A few questions:

- Missing license description for 'public domain' - the Debian manual says that the description should contain details of exactly what exemptions from copyright are made [1]. I had no involvement in making the timezone database, and the webpage about it just describes it as "the public domain time zone database"[2], so I don't know what details I can put.

- debian/rules structure: Is it worth restructuring just for Ubuntu, given that it will make a new diff against Debian's version? I'd prefer to keep the diff as small as practical, so that future merges are easy.

- Tests: They were disabled in Ubuntu earlier this year, a day after they were enabled [3]. Chuck doesn't give a reason in the commit message, but I assume he had one.

[1] http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/#public-domain
[2] http://www.iana.org/time-zones/repository/tz-link.html
[3] http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/quantal/python-tz/quantal/revision/27

Barry Warsaw (barry) wrote :

On May 22, 2012, at 09:44 PM, Thomas Kluyver wrote:

>- Missing license description for 'public domain' - the Debian manual says
> that the description should contain details of exactly what exemptions from
> copyright are made [1]. I had no involvement in making the timezone
> database, and the webpage about it just describes it as "the public domain
> time zone database"[2], so I don't know what details I can put.

Okay, we'll leave this one alone.

>- debian/rules structure: Is it worth restructuring just for Ubuntu, given
> that it will make a new diff against Debian's version? I'd prefer to keep
> the diff as small as practical, so that future merges are easy.

It's a good question. Given that Ubuntu's python-tz is so far ahead of Debian
(which in itself is unfortunate), it might be worth making our package conform
to current standards, and then try to push those changes back to Debian. But
I can be convinced otherwise, if it makes merging whatever meager bits we
still can from Debian.

>- Tests: They were disabled in Ubuntu earlier this year, a day after they
> were enabled [3]. Chuck doesn't give a reason in the commit message, but I
> assume he had one.

I talked to Chuck on IRC about this one. I says that the tests got
re-disabled almost immediately because they weren't actually testing
python-tz. He wasn't sure what the tests were actually testing. So I guess
we can leave this one alone too.

Okay, I think it's worth getting Python 3 support to go ahead and do the
merge. I'll sponsor that. Eventually it would be good to modernize the
Debian package (with the d/rules improvements), but we can worry about that
later. Perhaps you'd care to file a bug with Debian on that?

Barry Warsaw (barry) :
review: Approve
Thomas Kluyver (takluyver) wrote :

Great, thanks. I've sent a report to Debian about the suggestions for debian/rules:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=674083

Preview Diff

1=== modified file 'debian/changelog'
2--- debian/changelog 2012-02-28 10:36:56 +0000
3+++ debian/changelog 2012-05-12 11:20:23 +0000
4@@ -1,3 +1,12 @@
5+python-tz (2011k-0ubuntu6) precise; urgency=low
6+
7+ * Merge with Debian unstable (now builds for Python 3)
8+ * Bump standards version to 3.9.3
9+ * Add metadata to tzdata patch
10+ * Remove zoneinfo data from python3-tz package
11+
12+ -- Thomas Kluyver <thomas@kluyver.me.uk> Sat, 12 May 2012 11:25:52 +0100
13+
14 python-tz (2011k-0ubuntu5) precise; urgency=low
15
16 * Disable testsuite
17
18=== added file 'debian/clean'
19--- debian/clean 1970-01-01 00:00:00 +0000
20+++ debian/clean 2012-05-12 11:20:23 +0000
21@@ -0,0 +1,1 @@
22+pytz.egg-info/*
23
24=== modified file 'debian/control'
25--- debian/control 2012-01-06 10:29:22 +0000
26+++ debian/control 2012-05-12 11:20:23 +0000
27@@ -4,11 +4,17 @@
28 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
29 XSBC-Original-Maintainer: Debian/Ubuntu Zope Team <pkg-zope-developers@lists.alioth.debian.org>
30 Uploaders: Brian Sutherland <brian@vanguardistas.net>, Fabio Tranchitella <kobold@debian.org>
31-Build-Depends: debhelper (>= 7.0.50~), python-all (>= 2.6.6-3~), python-setuptools
32-Standards-Version: 3.9.2
33+Build-Depends: debhelper (>= 7.0.50~),
34+ python-all (>= 2.6.6-3~),
35+ python3-all,
36+ python-setuptools,
37+ python3-setuptools
38+Standards-Version: 3.9.3
39 Homepage: http://pypi.python.org/pypi/pytz/
40 X-Python-Version: >= 2.4
41+X-Python3-Version: >= 3.1
42 Vcs-Svn: svn://svn.debian.org/svn/pkg-zope/python-tz/trunk
43+Vcs-Browser: http://svn.debian.org/viewsvn/pkg-zope/python-tz/trunk
44
45 Package: python-tz
46 Architecture: all
47@@ -19,3 +25,15 @@
48 It also solves the issue of ambiguous times at the end of daylight savings,
49 which you can read more about in the Python Library Reference
50 (datetime.tzinfo).
51+
52+Package: python3-tz
53+Architecture: all
54+Depends: tzdata, ${python3:Depends}, ${misc:Depends}
55+Description: Python3 version of the Olson timezone database
56+ python-tz brings the Olson tz database into Python. This library allows
57+ accurate and cross platform timezone calculations using Python 2.3 or higher.
58+ It also solves the issue of ambiguous times at the end of daylight savings,
59+ which you can read more about in the Python Library Reference
60+ (datetime.tzinfo).
61+ .
62+ This package contains the Python 3 version of the library.
63
64=== modified file 'debian/copyright'
65--- debian/copyright 2008-10-27 07:29:54 +0000
66+++ debian/copyright 2012-05-12 11:20:23 +0000
67@@ -1,60 +1,31 @@
68-This package was debianized by Brian Sutherland <jinty@web.de> on
69-Tue, 8 Feb 2005 02:14:33 +0100.
70-
71-It was downloaded from http://pypi.python.org/pypi/pytz/
72-
73-Copyright:
74-
75-Upstream Author: Stuart Bishop <stuart@stuartbishop.net>
76-
77-This package is the result of an automatic generation from the Olsen database
78-(available from ftp://elsie.nci.nih.gov/pub). This means that there are two
79-licenses involved, that of the original distribution and the automatic
80-generation code. Fortunately both are BSD style.
81-
82-Both are included here as they are quite different from the standard BSD style
83-license distributed with Debian.
84-
85-
86-License:
87-
88-The files of the original database distribution contain this license text:
89-
90-/*
91-** Copyright (c) 1989 The Regents of the University of California.
92-** All rights reserved.
93-**
94-** Redistribution and use in source and binary forms are permitted
95-** provided that the above copyright notice and this paragraph are
96-** duplicated in all such forms and that any documentation,
97-** advertising materials, and other materials related to such
98-** distribution and use acknowledge that the software was developed
99-** by the University of California, Berkeley. The name of the
100-** University may not be used to endorse or promote products derived
101-** from this software without specific prior written permission.
102-** THIS SOFTWARE IS PROVIDED ``AS IS' AND WITHOUT ANY EXPRESS OR
103-** IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
104-** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
105-*/
106-
107-And the automatic generation code license is:
108-
109-Copyright (c) 2003-2008 Stuart Bishop <stuart@stuartbishop.net>
110-
111-Permission is hereby granted, free of charge, to any person obtaining a
112-copy of this software and associated documentation files (the "Software"),
113-to deal in the Software without restriction, including without limitation
114-the rights to use, copy, modify, merge, publish, distribute, sublicense,
115-and/or sell copies of the Software, and to permit persons to whom the
116-Software is furnished to do so, subject to the following conditions:
117-
118-The above copyright notice and this permission notice shall be included in
119-all copies or substantial portions of the Software.
120-
121-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
122-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
123-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
124-THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
125-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
126-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
127-DEALINGS IN THE SOFTWARE.
128+Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=174
129+Upstream-Name: pytz
130+Upstream-Contact: Stuart Bishop <stuart@stuartbishop.net>
131+Source: http://pypi.python.org/pypi/pytz/
132+
133+Files: *
134+Copyright: (c) 2003-2008 Stuart Bishop <stuart@stuartbishop.net>
135+License: Expat
136+ Permission is hereby granted, free of charge, to any person obtaining a
137+ copy of this software and associated documentation files (the "Software"),
138+ to deal in the Software without restriction, including without limitation
139+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
140+ and/or sell copies of the Software, and to permit persons to whom the
141+ Software is furnished to do so, subject to the following conditions:
142+ .
143+ The above copyright notice and this permission notice shall be included in
144+ all copies or substantial portions of the Software.
145+ .
146+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
147+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
148+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
149+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
150+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
151+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
152+ DEALINGS IN THE SOFTWARE.
153+
154+Files: pytz/zoneinfo/*
155+Copyright: Arthur David Olson et.al. <tz@elsie.nci.nih.gov>
156+License: public-domain
157+Comment: excluded from binary package
158+
159
160=== modified file 'debian/patches/tzdata'
161--- debian/patches/tzdata 2011-11-08 15:47:51 +0000
162+++ debian/patches/tzdata 2012-05-12 11:20:23 +0000
163@@ -1,3 +1,8 @@
164+Description: Use system zone information from the tzdata package
165+Author: Kurt Roeckx <kurt@roeckx.be>
166+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=416202
167+Forwarded: not-needed
168+
169 Index: pytz-2011h/pytz/__init__.py
170 ===================================================================
171 --- pytz-2011h.orig/pytz/__init__.py 2011-10-21 15:14:54.048406509 +0900
172
173=== modified file 'debian/rules' (properties changed: +x to -x)
174--- debian/rules 2012-02-28 10:36:56 +0000
175+++ debian/rules 2012-05-12 11:20:23 +0000
176@@ -1,14 +1,44 @@
177 #!/usr/bin/make -f
178
179+PACKAGE=python-tz
180+PACKAGE_PYTHON3=python3-tz
181+
182+PYVERS:=$(shell pyversions -r)
183+PY3VERS:=$(shell py3versions -r)
184+
185 %:
186- dh --with python2 $@
187+ dh --with python2 --with python3 $@
188+
189+override_dh_auto_build:
190+ dh_auto_build -p$(PACKAGE)
191+
192+ set -e; \
193+ for python in $(PY3VERS); do \
194+ $$python setup.py build; \
195+ done
196+
197+override_dh_auto_install:
198+ dh_auto_install -p$(PACKAGE) --destdir=$(CURDIR)/debian/$(PACKAGE)
199+
200+ set -ex; \
201+ for python in $(PY3VERS); do \
202+ $$python setup.py install --install-layout=deb \
203+ --root=$(CURDIR)/debian/$(PACKAGE_PYTHON3); \
204+ done
205+
206+override_dh_clean:
207+ dh_clean
208+ rm -rf build
209
210 override_dh_install:
211 dh_install
212+
213 # install our testing package
214 install -D debian/test-pytz debian/python-tz/usr/lib/python-tz/test-pytz.py
215+
216 # remove zoneinfo, our patch to pytz makes it use the one from tzdata
217 rm -rf debian/python-tz/usr/lib/python*/*-packages/pytz/zoneinfo
218+ rm -rf debian/python3-tz/usr/lib/python*/*-packages/pytz/zoneinfo
219
220 #override_dh_auto_test:
221 # set -e ; for pyversion in $(shell pyversions -r); do $$pyversion $(CURDIR)/pytz/tests/test_tzinfo.py ; done
222
223=== modified file 'debian/test-pytz'
224--- debian/test-pytz 2008-10-27 07:29:54 +0000
225+++ debian/test-pytz 2012-05-12 11:20:23 +0000
226@@ -13,5 +13,5 @@
227 tests += mod_tests
228
229 if not errors:
230- print "Ran %s tests successfully." % tests
231+ print("Ran %s tests successfully." % tests)
232 sys.exit(errors)
233
234=== modified file 'debian/watch'
235--- debian/watch 2008-10-27 07:29:54 +0000
236+++ debian/watch 2012-05-12 11:20:23 +0000
237@@ -1,2 +1,2 @@
238 version=3
239-http://pypi.python.org/pypi/pytz http://pypi.python.org/packages/source/p/pytz/pytz-(.*).tar.gz#md5=.*
240+http://pypi.python.org/packages/source/p/pytz/pytz-(.*).tar.gz
241
242=== modified file 'pytz.egg-info/SOURCES.txt'
243--- pytz.egg-info/SOURCES.txt 2011-10-21 14:01:38 +0000
244+++ pytz.egg-info/SOURCES.txt 2012-05-12 11:20:23 +0000
245@@ -2,7 +2,6 @@
246 LICENSE.txt
247 MANIFEST.in
248 README.txt
249-setup.cfg
250 setup.py
251 pytz/__init__.py
252 pytz/exceptions.py

Subscribers

People subscribed via source and target branches