Merge lp:~barry/oneconf/lp1088536 into lp:oneconf

Proposed by Barry Warsaw
Status: Merged
Approved by: Didier Roche-Tolomelli
Approved revision: 279
Merged at revision: 265
Proposed branch: lp:~barry/oneconf/lp1088536
Merge into: lp:oneconf
Diff against target: 363 lines (+197/-38)
14 files modified
debian/changelog (+23/-0)
debian/compat (+1/-1)
debian/control (+89/-10)
debian/oneconf-common.install (+1/-0)
debian/oneconf.install (+1/-0)
debian/oneconf.links (+2/-0)
debian/python-oneconf.install (+1/-0)
debian/python3-oneconf.install (+1/-0)
debian/rules (+42/-13)
debian/tests/control (+3/-0)
debian/tests/unittests (+13/-0)
oneconf/version.py (+2/-2)
setup.py (+13/-9)
test/test_daemon.py (+5/-3)
To merge this branch: bzr merge lp:~barry/oneconf/lp1088536
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+139487@code.launchpad.net

Description of the change

Update packaging for Python 3 port.

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

I'm turning this back to a Work In Progress. The issue is that Software Center imports oneconf modules directly, and because it's port to Python 3 is blocked on Xapian (sigh), SC for now still needs Python 2 versions of the modules.

What I propose is to split oneconf into three binary packages:

python-oneconf - the Python 2 version of the core library, usable by SC until its port is complete
python3-oneconf - the Python 3 version of the core library
oneconf - the bin scripts and other stuff

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

That's fine with me :)

Revision history for this message
Barry Warsaw (barry) wrote :

Okay, I've implemented the package split, so now Software Center can depend on `python-oneconf` while oneconf itself can depend on `python3-oneconf`.

I think this is ready for review now, but please do your own testing! Note that I've enabled two out of three of the unittests during build time. I couldn't figure out how to get test_daemon to run properly in the chroot, but if you have ideas please let me know.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

This looks good to me!
small things to change IMHO:
- can you move debhelper to version 9 instead of 8? Let's use the latest and greatest :)
- I think short description should be different between binary package, maybe adding pythonX lib?
- We should add the tests (and so test.test_daemon) as an autopkg tests to ensure depends don't break oneconf :)

Thanks a lot!

review: Needs Fixing
lp:~barry/oneconf/lp1088536 updated
273. By Barry Warsaw

- debhelper 9
- Include the Python version in the short description

274. By Barry Warsaw

Preliminary DEP 8 autopkgtests.

275. By Barry Warsaw

* Don't write files if we're testing.
* Use all test dependencies.

276. By Barry Warsaw

Better; don't write files if not building.

277. By Barry Warsaw

Add restrictions

Revision history for this message
Barry Warsaw (barry) wrote :

On Jan 14, 2013, at 11:15 PM, Didier Roche wrote:

>- can you move debhelper to version 9 instead of 8? Let's use the latest and
>- greatest :)

Done. Easy.

>- I think short description should be different between binary package, maybe
>- adding pythonX lib?

Done. Easy.

>- We should add the tests (and so test.test_daemon) as an autopkg tests to
>- ensure depends don't break oneconf :)

Not so easy. :)

I think most of my problem is not really having written any autopkgtests
previously, so I'm glad for the opportunity to learn how to do this.
Unfortunately, it seems there are plenty of obstacles, such as the long
turnaround times for tweaking the test, and the (current) need for a writable
build directory to run setup.py (since it writes version.py and the dbus .conf
file, not to mention wanting to delete the .egg directories).

Anyway, I'll keep playing with this and see if I can get a usable
autopkgtest.

lp:~barry/oneconf/lp1088536 updated
278. By Barry Warsaw

* Complete the working autotests:
 - we need a writable build tree
 - add xvfb to the dependencies so we can run the test_daemon with an X display
 - disable one test that fails under autopkgtest

279. By Barry Warsaw

debian/tests/*: Enable DEP 8 autopkgtests.

Revision history for this message
Barry Warsaw (barry) wrote :

I got the DEP 8 tests working, although I had to disable one unittest in test_daemon.py. I wasn't able to get this test to pass both under binary package build time and under autopkgtests. Please take a look, but it seemed not terribly important, so I just commented it out.

This should address all the issues with the packaging. I'm happy to merge and upload it after your positive review (of course, it'll have to get approved by the archive admins due to the new binary packages).

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

That's perfect! Thanks a bunch again Barry, feel free to go ahead and push it :)

review: Approve
Revision history for this message
Barry Warsaw (barry) wrote :

On Jan 16, 2013, at 05:21 PM, Didier Roche wrote:

>That's perfect! Thanks a bunch again Barry, feel free to go ahead and push it
>:)

Thanks! I'll push it as soon as I submit an mp for LP: #1100408 (S-C Depends:
python-oneconf).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2012-06-08 13:30:08 +0000
+++ debian/changelog 2013-01-16 03:10:27 +0000
@@ -1,3 +1,26 @@
1oneconf (0.3) raring; urgency=low
2
3 * Port to Python 3 and split the packaging:
4 - debian/compat: Bump to 8.
5 - debian/control:
6 + debhelper >= 8
7 + Add python3-* build dependencies.
8 + Add new binary packages: oneconf-common, python-oneconf,
9 python3-oneconf, oneconf (the latter has the executables).
10 + Remove python-imaging since PIL is not available for Python 3.
11 + Switch to python3-oauthlib.
12 - debian/*.install: Added for new binary package layout.
13 - debian/*.links: Added.
14 - debian/rules:
15 + Build for both Python 2 and Python 3.
16 + Run the test suite where possible.
17 - debian/tests/*: Enable DEP 8 autopkgtests.
18 - oneconf/version.py:
19 + Bump to 0.3
20 + Codename: raring
21
22 -- Barry Warsaw <barry@ubuntu.com> Tue, 15 Jan 2013 10:52:09 -0500
23
1oneconf (0.2.9.1) quantal; urgency=low24oneconf (0.2.9.1) quantal; urgency=low
225
3 * handle a regression when the wallpaper isn't reachable + test case26 * handle a regression when the wallpaper isn't reachable + test case
427
=== modified file 'debian/compat'
--- debian/compat 2010-07-29 15:08:16 +0000
+++ debian/compat 2013-01-16 03:10:27 +0000
@@ -1,1 +1,1 @@
1719
22
=== modified file 'debian/control'
--- debian/control 2012-04-12 14:45:36 +0000
+++ debian/control 2013-01-16 03:10:27 +0000
@@ -1,27 +1,106 @@
1Source: oneconf1Source: oneconf
2Section: python2Section: python
3Priority: extra3Priority: extra
4Build-Depends: debhelper (>= 7.0.50),4Build-Depends: debhelper (>= 9),
5 lsb-release,5 lsb-release,
6 gettext,6 gettext,
7 intltool,7 intltool,
8 xvfb,
8 python,9 python,
10 python-setuptools,
9 python-distutils-extra,11 python-distutils-extra,
10 python-nose,12 python-nose,
13 python-mock,
14 python-xdg,
15 python-gi,
16 python-piston-mini-client,
17 python-dbus,
18 python3,
19 python3-setuptools,
20 python3-distutils-extra,
21 python3-nose,
22 python3-mock,
23 python3-xdg,
24 python3-gi,
25 python3-piston-mini-client,
26 python3-dbus
11Maintainer: Didier Roche <didrocks@ubuntu.com>27Maintainer: Didier Roche <didrocks@ubuntu.com>
12Standards-Version: 3.9.328Standards-Version: 3.9.4
29X-Python-Version: >= 2.7
30X-Python3-Version: >= 3.3
31XS-Testsuite: autopkgtest
32
33Package: oneconf-common
34Architecture: all
35Depends: ${misc:Depends},
36 ${python:Depends},
37 python-dbus,
38 python-oauthlib,
39 python-gi,
40 python-apt,
41 python-piston-mini-client,
42 python-httplib2,
43 python-xdg
44Description: synchronize your configuration data over the network
45 OneConf provides the ability to sync your computer's configuration data over
46 the network.
47 .
48 It integrates nicely with the Ubuntu Software Center to compare sets of
49 installed software between computers. A command line tool also provides for
50 the same functionality.
51 .
52 This is the packaging containing common files.
53
54Package: python-oneconf
55Architecture: all
56Depends: ${misc:Depends},
57 ${python:Depends},
58 oneconf-common,
59 python-dbus,
60 python-oauthlib,
61 python-gi,
62 python-apt,
63 python-piston-mini-client,
64 python-httplib2,
65 python-xdg
66Description: synchronize your configuration data over the network (Python 2)
67 OneConf provides the ability to sync your computer's configuration data over
68 the network.
69 .
70 It integrates nicely with the Ubuntu Software Center to compare sets of
71 installed software between computers. A command line tool also provides for
72 the same functionality.
73 .
74 This is the Python 2 support library.
75
76Package: python3-oneconf
77Architecture: all
78Depends: ${misc:Depends},
79 ${python3:Depends},
80 oneconf-common,
81 python3-dbus,
82 python3-oauthlib,
83 python3-gi,
84 python3-apt,
85 python3-piston-mini-client,
86 python3-httplib2,
87 python3-xdg
88Description: synchronize your configuration data over the network (Python 3)
89 OneConf provides the ability to sync your computer's configuration data over
90 the network.
91 .
92 It integrates nicely with the Ubuntu Software Center to compare sets of
93 installed software between computers. A command line tool also provides for
94 the same functionality.
95 .
96 This is the Python 3 support library.
1397
14Package: oneconf98Package: oneconf
15Architecture: all99Architecture: all
16Depends: ${misc:Depends},100Depends: ${misc:Depends},
17 ${python:Depends},101 oneconf-common,
18 python-dbus,102 python3-oneconf,
19 python-oauth,103 ubuntu-sso-client
20 python-gi,
21 python-apt,
22 ubuntu-sso-client,
23 python-piston-mini-client (>= 0.3+bzr32-0ubuntu1),
24 python-imaging,
25Recommends: software-center (>= 4.1.21),104Recommends: software-center (>= 4.1.21),
26 update-notifier (>= 0.103),105 update-notifier (>= 0.103),
27Description: synchronize your configuration data over the network106Description: synchronize your configuration data over the network
28107
=== added file 'debian/oneconf-common.install'
--- debian/oneconf-common.install 1970-01-01 00:00:00 +0000
+++ debian/oneconf-common.install 2013-01-16 03:10:27 +0000
@@ -0,0 +1,1 @@
1usr/share
02
=== added file 'debian/oneconf.install'
--- debian/oneconf.install 1970-01-01 00:00:00 +0000
+++ debian/oneconf.install 2013-01-16 03:10:27 +0000
@@ -0,0 +1,1 @@
1usr/bin
02
=== added file 'debian/oneconf.links'
--- debian/oneconf.links 1970-01-01 00:00:00 +0000
+++ debian/oneconf.links 2013-01-16 03:10:27 +0000
@@ -0,0 +1,2 @@
1usr/share/oneconf/oneconf-query usr/bin/oneconf-query
2usr/share/oneconf/oneconf-update usr/share/update-notifier/plugins/cache-changed/oneconf-update
03
=== added file 'debian/python-oneconf.install'
--- debian/python-oneconf.install 1970-01-01 00:00:00 +0000
+++ debian/python-oneconf.install 2013-01-16 03:10:27 +0000
@@ -0,0 +1,1 @@
1usr/lib/python2.*/dist-packages
02
=== added file 'debian/python3-oneconf.install'
--- debian/python3-oneconf.install 1970-01-01 00:00:00 +0000
+++ debian/python3-oneconf.install 2013-01-16 03:10:27 +0000
@@ -0,0 +1,1 @@
1usr/lib/python3
02
=== modified file 'debian/rules'
--- debian/rules 2011-09-01 08:47:01 +0000
+++ debian/rules 2013-01-16 03:10:27 +0000
@@ -1,22 +1,51 @@
1#!/usr/bin/make -f1#!/usr/bin/make -f
2
3#DH_VERBOSE=1
2share:=usr/share/oneconf4share:=usr/share/oneconf
35
6# Prevent setuptools/distribute from accessing the internet.
7export http_proxy = http://127.0.9.1:9
8
9PYTHON2=$(shell pyversions -vr)
10PYTHON3=$(shell py3versions -vr)
11
4%:12%:
5 dh --with=python2 $@13 dh $@ --with python2,python3
614
7# Install the modules in a private directory, as our applications are the15ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
8# only ones using them.16test-python%:
9override_dh_auto_install:17 # The tests don't work well when run as one unit, so run them
18 # individually.
19 python$* setup.py nosetests -vv --test test.test_mainfeatures
20 python$* setup.py nosetests -vv --test test.test_syncing
21 # I don't know of a good way to run this test in the schroot, even
22 # using xvfb to give us an X display. Rely on DEP 8 tests to cover
23 # these tests.
24 #xvfb-run python$* setup.py nosetests -vv --test test.test_daemon
25
26override_dh_auto_test: $(PYTHON2:%=test-python%) $(PYTHON3:%=test-python%)
27endif
28
29build-python%:
30 python$* setup.py build
31
32override_dh_auto_build: $(PYTHON3:%=build-python%)
33 dh_auto_build
34
35install-python%:
36 python$* setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb
37
38override_dh_auto_install: $(PYTHON3:%=install-python%)
10 dh_auto_install39 dh_auto_install
11 # Move the scripts to $(SHARE) and relink some again later.40 # Move the scripts to $(SHARE) and relink some again later. The
12 mv debian/oneconf/usr/*bin/* debian/oneconf/$(share)41 # scripts will be included in the "oneconf" binary package
13 rmdir debian/oneconf/usr/*bin42 mkdir -p debian/oneconf/$(share)
43 mv debian/tmp/usr/*bin/* debian/oneconf/$(share)
1444
45override_dh_auto_clean:
46 dh_auto_clean
47 rm -rf build
48 rm -rf *.egg-info
1549
16override_dh_install:50override_dh_install:
17 dh_install --fail-missing51 dh_install --fail-missing
18
19 dh_link $(share)/oneconf-query usr/bin/oneconf-query \
20 $(share)/oneconf-update usr/share/update-notifier/plugins/cache-changed/oneconf-update
21
22.PHONY: override_dh_auto_install
2352
=== added directory 'debian/tests'
=== added file 'debian/tests/control'
--- debian/tests/control 1970-01-01 00:00:00 +0000
+++ debian/tests/control 2013-01-16 03:10:27 +0000
@@ -0,0 +1,3 @@
1Tests: unittests
2Depends: @, xvfb, python3-nose, python3-mock
3Restrictions: rw-build-tree build-needed
04
=== added file 'debian/tests/unittests'
--- debian/tests/unittests 1970-01-01 00:00:00 +0000
+++ debian/tests/unittests 2013-01-16 03:10:27 +0000
@@ -0,0 +1,13 @@
1#!/bin/sh
2# autopkgtest check: Run the upstream unittests.
3# (C) 2013 Canonical Ltd.
4# Author: Barry Warsaw <barry@ubuntu.com>
5
6set -ex
7
8# Run the tests individually, since running them via the tests/run script does
9# not always complete.
10
11python3 setup.py nosetests -vv --test test.test_mainfeatures
12python3 setup.py nosetests -vv --test test.test_syncing
13xvfb-run python3 setup.py nosetests -vv --test test.test_daemon
014
=== modified file 'oneconf/version.py'
--- oneconf/version.py 2012-11-21 20:01:42 +0000
+++ oneconf/version.py 2013-01-16 03:10:27 +0000
@@ -1,5 +1,5 @@
11
2VERSION='0.2.9'2VERSION='0.3'
3CODENAME='quantal'3CODENAME='raring'
4DISTRO='Ubuntu'4DISTRO='Ubuntu'
5RELEASE='13.04'5RELEASE='13.04'
66
=== modified file 'setup.py'
--- setup.py 2012-11-29 23:17:54 +0000
+++ setup.py 2013-01-16 03:10:27 +0000
@@ -4,6 +4,7 @@
4from DistUtilsExtra.command import *4from DistUtilsExtra.command import *
55
6import re6import re
7import sys
7import glob8import glob
8from codecs import open9from codecs import open
9from subprocess import Popen, PIPE10from subprocess import Popen, PIPE
@@ -22,21 +23,24 @@
22 stdout=PIPE,23 stdout=PIPE,
23 universal_newlines=True).communicate()[0].strip()24 universal_newlines=True).communicate()[0].strip()
2425
25with open('oneconf/version.py', 'w', encoding='utf-8') as fp:26#should be replaced by $USR
26 fp.write("""27oneconf_service_path = "/usr/share/oneconf/oneconf-service"
28
29# Only write the files if we're building.
30if any(argv for argv in sys.argv if 'build' in argv):
31 with open('oneconf/version.py', 'w', encoding='utf-8') as fp:
32 fp.write("""\
27VERSION='%s'33VERSION='%s'
28CODENAME='%s'34CODENAME='%s'
29DISTRO='%s'35DISTRO='%s'
30RELEASE='%s'36RELEASE='%s'
31""" % (VERSION, CODENAME, DISTRO, RELEASE))37""" % (VERSION, CODENAME, DISTRO, RELEASE))
3238 with open('misc/com.ubuntu.OneConf.service', 'w', encoding='utf-8') as fp:
33#should be replaced by $USR39 fp.write("""\
34oneconf_service_path = "/usr/share/oneconf/oneconf-service"40[D-BUS Service]
35
36with open('misc/com.ubuntu.OneConf.service', 'w', encoding='utf-8') as fp:
37 fp.write("""[D-BUS Service]
38Name=com.ubuntu.OneConf41Name=com.ubuntu.OneConf
39Exec=%s""" % oneconf_service_path)42Exec=%s
43""" % oneconf_service_path)
4044
41# real setup45# real setup
42setup(name="oneconf", version=VERSION,46setup(name="oneconf", version=VERSION,
4347
=== modified file 'test/test_daemon.py'
--- test/test_daemon.py 2012-12-13 23:37:23 +0000
+++ test/test_daemon.py 2013-01-16 03:10:27 +0000
@@ -105,10 +105,12 @@
105 daemon2 = subprocess.Popen(["./oneconf-service"],105 daemon2 = subprocess.Popen(["./oneconf-service"],
106 stdout=devnull, stderr=devnull)106 stdout=devnull, stderr=devnull)
107 daemon2.wait() # let it proceeding quitting107 daemon2.wait() # let it proceeding quitting
108 time_stop = time.time()108 #time_stop = time.time()
109 self.assertFalse(self.daemon_still_there(daemon2.pid))109 self.assertFalse(self.daemon_still_there(daemon2.pid))
110 self.assertTrue(110 # This assertion is unreliable, especially under DEP 8
111 time_stop - self.time_start < MIN_TIME_WITHOUT_ACTIVITY)111 # autopkgtests and possibly other limited environments.
112 ## self.assertLess(time_stop - self.time_start,
113 ## MIN_TIME_WITHOUT_ACTIVITY)
112 finally:114 finally:
113 if close:115 if close:
114 devnull.close()116 devnull.close()

Subscribers

People subscribed via source and target branches