Merge lp:~cjwatson/launchpad-buildd/build-sdist into lp:launchpad-buildd

Proposed by Colin Watson
Status: Merged
Merged at revision: 181
Proposed branch: lp:~cjwatson/launchpad-buildd/build-sdist
Merge into: lp:launchpad-buildd
Diff against target: 137 lines (+108/-0)
4 files modified
.bzrignore (+2/-0)
MANIFEST.in (+24/-0)
debian/changelog (+3/-0)
setup.py (+79/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad-buildd/build-sdist
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+276654@code.launchpad.net

Commit message

Add Python packaging files so that Launchpad's test suite can incorporate this as a Python dependency rather than requiring python-lpbuildd to be installed on the test system.

Description of the change

Add Python packaging files so that Launchpad's test suite can incorporate this as a Python dependency rather than requiring python-lpbuildd to be installed on the test system. The latter is cumbersome for two reasons: firstly, we have to ask sysadmins to upgrade buildbots manually rather than being able to control the versions in use for ourselves; secondly, we have to have special buildout configuration to add /usr/lib/launchpad-buildd to sys.path. Treating it as a Python dependency instead will let us fix both problems.

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

Move fixtures, testtools, and txfixtures to tests_require.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2011-11-11 02:04:22 +0000
3+++ .bzrignore 2015-11-11 08:57:28 +0000
4@@ -1,4 +1,6 @@
5+*.egg-info
6 *.pyc
7+dist
8 debian/files
9 debian/launchpad-buildd
10 debian/python-lpbuildd
11
12=== added file 'MANIFEST.in'
13--- MANIFEST.in 1970-01-01 00:00:00 +0000
14+++ MANIFEST.in 2015-11-11 08:57:28 +0000
15@@ -0,0 +1,24 @@
16+include LICENSE
17+include Makefile
18+include buildd-genconfig
19+include buildd-slave.tac
20+include buildlivefs
21+include buildrecipe
22+include buildsnap
23+include debian/changelog
24+include generate-translation-templates
25+include mount-chroot
26+include override-sources-list
27+include remove-build
28+include sbuild-package
29+include sbuildrc
30+include scan-for-processes
31+include slave-prep
32+include sudo-wrapper
33+include template-buildd-slave.conf
34+include test_buildd_generatetranslationtemplates
35+include test_buildd_recipe
36+include umount-chroot
37+include unpack-chroot
38+include update-debian-chroot
39+recursive-include lpbuildd/tests *.diff *.tar.gz buildd-slave-test.conf buildlog buildlog.long
40
41=== modified file 'debian/changelog'
42--- debian/changelog 2015-11-04 13:35:36 +0000
43+++ debian/changelog 2015-11-11 08:57:28 +0000
44@@ -5,6 +5,9 @@
45 sbuild's UTF-8 section markers, and this seems to be the simplest way to
46 fix that while preserving source compatibility with earlier versions of
47 Twisted.
48+ * Add Python packaging files so that Launchpad's test suite can
49+ incorporate this as a Python dependency rather than requiring
50+ python-lpbuildd to be installed on the test system.
51
52 -- Colin Watson <cjwatson@ubuntu.com> Wed, 04 Nov 2015 11:49:27 +0000
53
54
55=== added file 'setup.py'
56--- setup.py 1970-01-01 00:00:00 +0000
57+++ setup.py 2015-11-11 08:57:28 +0000
58@@ -0,0 +1,79 @@
59+#!/usr/bin/env python
60+
61+# Copyright 2015 Canonical Ltd. All rights reserved.
62+#
63+# This file is part of launchpad-buildd.
64+#
65+# launchpad-buildd is free software: you can redistribute it and/or modify
66+# it under the terms of the GNU Affero General Public License as published
67+# by the Free Software Foundation, version 3 of the License.
68+#
69+# launchpad-buildd is distributed in the hope that it will be useful, but
70+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
71+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
72+# License for more details.
73+#
74+# You should have received a copy of the GNU Affero General Public License
75+# along with launchpad-buildd. If not, see <http://www.gnu.org/licenses/>.
76+
77+import re
78+from textwrap import dedent
79+
80+from setuptools import (
81+ find_packages,
82+ setup,
83+ )
84+
85+
86+changelog_heading = re.compile(r'\w[-+0-9a-z.]* \(([^\(\) \t]+)\)')
87+
88+with open('debian/changelog') as changelog:
89+ line = changelog.readline()
90+ match = changelog_heading.match(line)
91+ if match is None:
92+ raise ValueError(
93+ "Failed to parse first line of debian/changelog: '%s'" % line)
94+ version = match.group(1)
95+
96+
97+setup(
98+ name='launchpad-buildd',
99+ version=version,
100+ description='Launchpad buildd slave',
101+ long_description=dedent("""
102+ The Launchpad buildd slave libraries. The PyPI version of this
103+ package will not produce a complete installation on its own, and is
104+ mostly useful for testing other pieces of software against
105+ launchpad-buildd; for a real Launchpad buildd slave, install the
106+ launchpad-buildd package from ppa:launchpad/ubuntu/ppa.
107+ """).strip(),
108+ url='https://launchpad.net/launchpad-buildd',
109+ packages=find_packages(),
110+ package_data={
111+ 'lpbuildd': [
112+ 'tests/buildd-slave-test.conf',
113+ ],
114+ },
115+ maintainer='Launchpad Developers',
116+ maintainer_email='launchpad-dev@lists.launchpad.net',
117+ license='Affero GPL v3',
118+ install_requires=[
119+ 'bzr',
120+ # XXX cjwatson 2015-11-04: This does in fact require python-apt, but
121+ # that's normally shipped as a system package and specifying it here
122+ # causes problems for Launchpad's build system.
123+ #'python-apt',
124+ 'python-debian',
125+ 'Twisted',
126+ 'zope.interface',
127+ ],
128+ data_files=[
129+ ('', ['buildd-slave.tac', 'template-buildd-slave.conf']),
130+ ],
131+ test_suite='lpbuildd.tests',
132+ tests_require=[
133+ 'fixtures',
134+ 'testtools',
135+ 'txfixtures',
136+ ],
137+ )

Subscribers

People subscribed via source and target branches

to all changes: