Merge lp:~cjwatson/launchpad-buildd/normalise-python-packaging into lp:launchpad-buildd

Proposed by Colin Watson
Status: Merged
Merged at revision: 313
Proposed branch: lp:~cjwatson/launchpad-buildd/normalise-python-packaging
Merge into: lp:launchpad-buildd
Prerequisite: lp:~cjwatson/launchpad-buildd/translation-operation
Diff against target: 263 lines (+82/-36)
12 files modified
.bzrignore (+4/-0)
MANIFEST.in (+1/-2)
debian/changelog (+4/-0)
debian/compat (+1/-1)
debian/control (+47/-5)
debian/launchpad-buildd.install (+5/-5)
debian/pydist-overrides (+1/-0)
debian/python-lpbuildd.install (+0/-5)
debian/python-lpbuildd.links (+2/-0)
debian/rules (+11/-8)
lpbuildd/tests/harness.py (+0/-1)
setup.py (+6/-9)
To merge this branch: bzr merge lp:~cjwatson/launchpad-buildd/normalise-python-packaging
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+330450@code.launchpad.net

Commit message

Normalise Python packaging. We now install our modules on the normal system path, using pybuild. setup.py now installs buildd-slave.tac in the lpbuildd package rather than data_files in order not to pollute the top level of a virtualenv.

Description of the change

I haven't tested it yet, but this should hopefully help to get buildd-related tests passing in my LP virtualenv-pip branch.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2015-11-04 14:10:28 +0000
3+++ .bzrignore 2017-09-08 17:28:12 +0000
4@@ -1,9 +1,13 @@
5 *.egg-info
6 *.pyc
7+.pybuild
8+buildd-slave-example.conf
9 dist
10+debian/debhelper-build-stamp
11 debian/files
12 debian/launchpad-buildd
13 debian/python-lpbuildd
14+debian/tmp
15 debian/*.debhelper.log
16 debian/*.debhelper
17 debian/*.substvars
18
19=== modified file 'MANIFEST.in'
20--- MANIFEST.in 2017-09-08 17:28:12 +0000
21+++ MANIFEST.in 2017-09-08 17:28:12 +0000
22@@ -8,8 +8,7 @@
23 include bin/test_buildd_generatetranslationtemplates
24 include bin/test_buildd_recipe
25 include buildd-genconfig
26-include buildd-slave.tac
27 include debian/changelog
28 include sbuildrc
29 include template-buildd-slave.conf
30-recursive-include lpbuildd/tests *.diff *.tar.gz buildd-slave-test.conf buildlog buildlog.long
31+recursive-include lpbuildd/tests *.diff *.tar.gz buildd-slave.tac buildd-slave-test.conf buildlog buildlog.long
32
33=== modified file 'debian/changelog'
34--- debian/changelog 2017-09-08 17:28:12 +0000
35+++ debian/changelog 2017-09-08 17:28:12 +0000
36@@ -4,6 +4,10 @@
37 * Merge TranslationTemplatesBuildState.{INSTALL,GENERATE} into a single
38 state.
39 * Convert generate-translation-templates to the new Operation framework.
40+ * Normalise Python packaging. We now install our modules on the normal
41+ system path, using pybuild. setup.py now installs buildd-slave.tac in
42+ the lpbuildd package rather than data_files in order not to pollute the
43+ top level of a virtualenv.
44
45 -- Colin Watson <cjwatson@ubuntu.com> Fri, 08 Sep 2017 13:42:17 +0100
46
47
48=== modified file 'debian/compat'
49--- debian/compat 2015-08-25 09:23:24 +0000
50+++ debian/compat 2017-09-08 17:28:12 +0000
51@@ -1,1 +1,1 @@
52-7
53+9
54
55=== modified file 'debian/control'
56--- debian/control 2017-08-25 13:34:14 +0000
57+++ debian/control 2017-09-08 17:28:12 +0000
58@@ -3,14 +3,50 @@
59 Priority: extra
60 Maintainer: Adam Conrad <adconrad@ubuntu.com>
61 Standards-Version: 3.9.5
62-Build-Depends: debhelper (>= 7.0.50~), apt-utils, bzr, intltool, python, python-apt, python-debian, python-fixtures, python-mock, python-netaddr, python-pylxd, python-setuptools, python-systemfixtures, python-testtools, python-twisted, python-txfixtures, python-zope.interface
63+Build-Depends: apt-utils,
64+ bzr,
65+ debhelper (>= 9~),
66+ dh-exec,
67+ dh-python,
68+ intltool,
69+ python (>= 2.6.6-3~),
70+ python-apt,
71+ python-debian,
72+ python-fixtures,
73+ python-mock,
74+ python-netaddr,
75+ python-pylxd,
76+ python-setuptools,
77+ python-systemfixtures,
78+ python-testtools,
79+ python-twisted,
80+ python-txfixtures,
81+# We don't use the bits of pylxd that require this at run-time, but at
82+# build-time pybuild fails if it's not available.
83+ python-ws4py,
84+ python-zope.interface,
85
86 Package: launchpad-buildd
87 Section: misc
88 Architecture: all
89-Depends: python-lpbuildd (=${source:Version}), python, debootstrap, dpkg-dev,
90- file, bzip2, sudo, ntpdate, adduser, apt-transport-https, lsb-release,
91- pristine-tar, python-apt, sbuild, schroot, lsof, lxd, ${misc:Depends}
92+Depends: adduser,
93+ apt-transport-https,
94+ bzip2,
95+ debootstrap,
96+ dpkg-dev,
97+ file,
98+ lsb-release,
99+ lsof,
100+ lxd,
101+ ntpdate,
102+ pristine-tar,
103+ python,
104+ python-apt,
105+ python-lpbuildd (=${source:Version}),
106+ sbuild,
107+ schroot,
108+ sudo,
109+ ${misc:Depends},
110 Description: Launchpad buildd slave
111 This is the launchpad buildd slave package. It contains everything needed to
112 get a launchpad buildd going apart from the database manipulation required to
113@@ -21,7 +57,13 @@
114 Package: python-lpbuildd
115 Section: python
116 Architecture: all
117-Depends: python, python-twisted-core, python-twisted-web, python-zope.interface, python-apt, python-debian (>= 0.1.23), python-netaddr, python-pylxd, python-setuptools, apt-utils, procps, ${misc:Depends}
118+Depends: apt-utils,
119+ procps,
120+ python-apt,
121+# Work around missing dependency in python-pbr.
122+ python-setuptools,
123+ ${misc:Depends},
124+ ${python:Depends},
125 Breaks: launchpad-buildd (<< 88)
126 Replaces: launchpad-buildd (<< 88)
127 Description: Python libraries for a Launchpad buildd slave
128
129=== modified file 'debian/launchpad-buildd.install'
130--- debian/launchpad-buildd.install 2017-09-08 17:28:12 +0000
131+++ debian/launchpad-buildd.install 2017-09-08 17:28:12 +0000
132@@ -1,10 +1,10 @@
133-default/launchpad-buildd etc/default
134-buildd-genconfig usr/share/launchpad-buildd
135-debian/upgrade-config usr/share/launchpad-buildd
136-sbuildrc usr/share/launchpad-buildd
137-template-buildd-slave.conf usr/share/launchpad-buildd
138 bin/buildrecipe usr/share/launchpad-buildd/slavebin
139 bin/in-target usr/share/launchpad-buildd/slavebin
140 bin/sbuild-package usr/share/launchpad-buildd/slavebin
141 bin/slave-prep usr/share/launchpad-buildd/slavebin
142 bin/snap-git-proxy usr/share/launchpad-buildd/slavebin
143+buildd-genconfig usr/share/launchpad-buildd
144+debian/upgrade-config usr/share/launchpad-buildd
145+default/launchpad-buildd etc/default
146+sbuildrc usr/share/launchpad-buildd
147+template-buildd-slave.conf usr/share/launchpad-buildd
148
149=== added file 'debian/pydist-overrides'
150--- debian/pydist-overrides 1970-01-01 00:00:00 +0000
151+++ debian/pydist-overrides 2017-09-08 17:28:12 +0000
152@@ -0,0 +1,1 @@
153+python-debian python-debian (>= 0.1.23)
154
155=== removed file 'debian/python-lpbuildd.install'
156--- debian/python-lpbuildd.install 2017-07-28 20:33:31 +0000
157+++ debian/python-lpbuildd.install 1970-01-01 00:00:00 +0000
158@@ -1,5 +0,0 @@
159-buildd-slave.tac usr/lib/launchpad-buildd
160-lpbuildd/*py usr/lib/launchpad-buildd/lpbuildd
161-lpbuildd/pottery/*py usr/lib/launchpad-buildd/lpbuildd/pottery
162-lpbuildd/target/*py usr/lib/launchpad-buildd/lpbuildd/target
163-lpbuildd/tests/* usr/lib/launchpad-buildd/lpbuildd/tests
164
165=== added file 'debian/python-lpbuildd.links'
166--- debian/python-lpbuildd.links 1970-01-01 00:00:00 +0000
167+++ debian/python-lpbuildd.links 2017-09-08 17:28:12 +0000
168@@ -0,0 +1,2 @@
169+#! /usr/bin/dh-exec
170+${LIBDIR}/lpbuildd/buildd-slave.tac usr/lib/launchpad-buildd/buildd-slave.tac
171
172=== modified file 'debian/rules'
173--- debian/rules 2017-07-27 15:35:27 +0000
174+++ debian/rules 2017-09-08 17:28:12 +0000
175@@ -1,24 +1,27 @@
176 #!/usr/bin/make -f
177 #
178-# Copyright 2009-2015 Canonical Ltd.
179+# Copyright 2009-2017 Canonical Ltd.
180 #
181 # This software is licensed under the GNU Affero General Public License version
182 # 3 (see the file LICENSE).
183
184+export PYBUILD_NAME := lpbuildd
185+
186+export LIBDIR := $(shell python -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())')
187+
188 %:
189- dh $@
190+ dh $@ --with=python2 --buildsystem=pybuild
191
192 override_dh_auto_build:
193+ dh_auto_build
194 python buildd-genconfig --template=template-buildd-slave.conf \
195 --arch=i386 --port=8221 --name=default --host=buildd.buildd \
196 > buildd-slave-example.conf
197
198-override_dh_auto_test:
199- dh_auto_test
200- find -name \*.pyc -print0 | xargs -0r rm -f
201-
202-override_dh_auto_clean:
203- find -name \*.pyc -print0 | xargs -0r rm -f
204+override_dh_auto_install:
205+ dh_auto_install
206+ # This should be split into a testable library and a wrapper.
207+ chmod +x debian/python-lpbuildd/$(LIBDIR)/lpbuildd/check_implicit_pointer_functions.py
208
209 override_dh_builddeb:
210 dh_builddeb -- -Zgzip
211
212=== renamed file 'buildd-slave.tac' => 'lpbuildd/buildd-slave.tac'
213=== modified file 'lpbuildd/tests/harness.py'
214--- lpbuildd/tests/harness.py 2017-08-03 10:16:57 +0000
215+++ lpbuildd/tests/harness.py 2017-09-08 17:28:12 +0000
216@@ -125,7 +125,6 @@
217 return os.path.abspath(os.path.join(
218 os.path.dirname(__file__),
219 os.path.pardir,
220- os.path.pardir,
221 'buildd-slave.tac'
222 ))
223
224
225=== modified file 'setup.py'
226--- setup.py 2017-07-27 16:12:45 +0000
227+++ setup.py 2017-09-08 17:28:12 +0000
228@@ -49,29 +49,26 @@
229 """).strip(),
230 url='https://launchpad.net/launchpad-buildd',
231 packages=find_packages(),
232- package_data={
233- 'lpbuildd': [
234- 'tests/buildd-slave-test.conf',
235- ],
236- },
237+ include_package_data=True,
238 maintainer='Launchpad Developers',
239 maintainer_email='launchpad-dev@lists.launchpad.net',
240 license='Affero GPL v3',
241 install_requires=[
242+ 'netaddr',
243+ 'pylxd',
244 # XXX cjwatson 2015-11-04: This does in fact require python-apt, but
245 # that's normally shipped as a system package and specifying it here
246 # causes problems for Launchpad's build system.
247 #'python-apt',
248- 'python-debian',
249+ 'python-debian>=0.1.23',
250 'Twisted',
251 'zope.interface',
252 ],
253- data_files=[
254- ('', ['buildd-slave.tac', 'template-buildd-slave.conf']),
255- ],
256 test_suite='lpbuildd.tests',
257 tests_require=[
258 'fixtures',
259+ 'mock',
260+ 'systemfixtures',
261 'testtools',
262 'txfixtures',
263 ],

Subscribers

People subscribed via source and target branches

to all changes: