Merge ~cjwatson/launchpad-buildd:flake8 into launchpad-buildd:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 2faae1482f1a26e354f9658ba8e554b4e272d765
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad-buildd:flake8
Merge into: launchpad-buildd:master
Diff against target: 907 lines (+211/-168)
27 files modified
.pre-commit-config.yaml (+13/-0)
bin/buildrecipe (+21/-19)
bin/test_buildd_generatetranslationtemplates (+0/-5)
bin/test_buildd_recipe (+5/-6)
buildd-genconfig (+36/-31)
debian/changelog (+6/-0)
debian/upgrade-config (+28/-10)
lpbuildd/binarypackage.py (+17/-13)
lpbuildd/builder.py (+4/-4)
lpbuildd/check_implicit_pointer_functions.py (+7/-7)
lpbuildd/oci.py (+1/-2)
lpbuildd/proxy.py (+5/-5)
lpbuildd/sourcepackagerecipe.py (+2/-3)
lpbuildd/target/build_charm.py (+0/-1)
lpbuildd/target/lxd.py (+2/-2)
lpbuildd/target/operation.py (+0/-2)
lpbuildd/target/tests/test_lxd.py (+3/-2)
lpbuildd/target/vcs.py (+2/-1)
lpbuildd/tests/fakebuilder.py (+4/-4)
lpbuildd/tests/oci_tarball.py (+4/-6)
lpbuildd/tests/test_binarypackage.py (+15/-15)
lpbuildd/tests/test_buildrecipe.py (+29/-25)
lpbuildd/tests/test_charm.py (+2/-1)
lpbuildd/tests/test_harness.py (+1/-1)
lpbuildd/tests/test_sourcepackagerecipe.py (+1/-1)
lpbuildd/tests/test_util.py (+2/-1)
setup.py (+1/-1)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+412903@code.launchpad.net

Commit message

Add basic pre-commit configuration and apply flake8

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) wrote :

LGTM

A couple of re-formats made the code less readable imho - let's have a quick discussion at standup whether the line length limit is set in stone or whether we could just # noqa this rare occasions.

review: Approve
Revision history for this message
Colin Watson (cjwatson) wrote :

As mentioned at standup I have no particular objection to the occasional noqa comment, but in this case I found some alternative approaches that avoid line length issues while (IMO) not compromising readability.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
0new file mode 1006440new file mode 100644
index 0000000..8970c21
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,13 @@
1repos:
2- repo: https://github.com/pre-commit/pre-commit-hooks
3 rev: v4.0.1
4 hooks:
5 - id: check-added-large-files
6 - id: check-merge-conflict
7 - id: check-xml
8 - id: check-yaml
9 - id: debug-statements
10- repo: https://github.com/PyCQA/flake8
11 rev: 4.0.1
12 hooks:
13 - id: flake8
diff --git a/bin/buildrecipe b/bin/buildrecipe
index 4d04c4f..5dcab4a 100755
--- a/bin/buildrecipe
+++ b/bin/buildrecipe
@@ -114,8 +114,8 @@ class RecipeBuilder:
114 # using buildd@<hostname>.114 # using buildd@<hostname>.
115 hostname = socket.gethostname()115 hostname = socket.gethostname()
116 email = 'buildd@%s' % hostname116 email = 'buildd@%s' % hostname
117 lsb_release = subprocess.Popen(['sudo',117 lsb_release = subprocess.Popen([
118 '/usr/sbin/chroot', self.chroot_path, 'lsb_release',118 'sudo', '/usr/sbin/chroot', self.chroot_path, 'lsb_release',
119 '-r', '-s'], stdout=subprocess.PIPE, universal_newlines=True)119 '-r', '-s'], stdout=subprocess.PIPE, universal_newlines=True)
120 distroseries_version = lsb_release.communicate()[0].rstrip()120 distroseries_version = lsb_release.communicate()[0].rstrip()
121 assert lsb_release.returncode == 0121 assert lsb_release.returncode == 0
@@ -190,12 +190,13 @@ class RecipeBuilder:
190 control = self.getSourceControl()190 control = self.getSourceControl()
191 with open(os.path.join(191 with open(os.path.join(
192 self.apt_dir, "%s.dsc" % package), "w") as dummy_dsc:192 self.apt_dir, "%s.dsc" % package), "w") as dummy_dsc:
193 print(dedent("""\193 print(
194 Format: 1.0194 dedent("""\
195 Source: %(package)s195 Format: 1.0
196 Architecture: any196 Source: %(package)s
197 Version: 99:0197 Architecture: any
198 Maintainer: invalid@example.org""") % {"package": package},198 Version: 99:0
199 Maintainer: invalid@example.org""") % {"package": package},
199 file=dummy_dsc)200 file=dummy_dsc)
200 for field in (201 for field in (
201 "Build-Depends", "Build-Depends-Indep",202 "Build-Depends", "Build-Depends-Indep",
@@ -208,17 +209,18 @@ class RecipeBuilder:
208 def runAptFtparchive(self):209 def runAptFtparchive(self):
209 conf_path = os.path.join(self.apt_dir, "ftparchive.conf")210 conf_path = os.path.join(self.apt_dir, "ftparchive.conf")
210 with open(conf_path, "w") as conf:211 with open(conf_path, "w") as conf:
211 print(dedent("""\212 print(
212 Dir::ArchiveDir "%(apt_dir)s";213 dedent("""\
213 Default::Sources::Compress ". bzip2";214 Dir::ArchiveDir "%(apt_dir)s";
214 BinDirectory "%(apt_dir)s" { Sources "Sources"; };215 Default::Sources::Compress ". bzip2";
215 APT::FTPArchive::Release {216 BinDirectory "%(apt_dir)s" { Sources "Sources"; };
216 Origin "buildrecipe-archive";217 APT::FTPArchive::Release {
217 Label "buildrecipe-archive";218 Origin "buildrecipe-archive";
218 Suite "invalid";219 Label "buildrecipe-archive";
219 Codename "invalid";220 Suite "invalid";
220 Description "buildrecipe temporary archive";221 Codename "invalid";
221 };""") % {"apt_dir": self.apt_dir},222 Description "buildrecipe temporary archive";
223 };""") % {"apt_dir": self.apt_dir},
222 file=conf)224 file=conf)
223 ftparchive_env = dict(os.environ)225 ftparchive_env = dict(os.environ)
224 ftparchive_env.pop("APT_CONFIG", None)226 ftparchive_env.pop("APT_CONFIG", None)
diff --git a/bin/test_buildd_generatetranslationtemplates b/bin/test_buildd_generatetranslationtemplates
index 85ddc2e..2282f1d 100755
--- a/bin/test_buildd_generatetranslationtemplates
+++ b/bin/test_buildd_generatetranslationtemplates
@@ -28,8 +28,3 @@ build_type = 'translation-templates'
28filemap = {}28filemap = {}
29args = {'branch_url': 'no-branch-here-sorry'}29args = {'branch_url': 'no-branch-here-sorry'}
30print(proxy.build(buildid, build_type, chroot_sha1, filemap, args))30print(proxy.build(buildid, build_type, chroot_sha1, filemap, args))
31#status = proxy.status()
32#for filename, sha1 in status[3].iteritems():
33# print(filename)
34#proxy.clean()
35
diff --git a/bin/test_buildd_recipe b/bin/test_buildd_recipe
index 849b28b..d4f5ed6 100755
--- a/bin/test_buildd_recipe
+++ b/bin/test_buildd_recipe
@@ -17,12 +17,14 @@ distroseries_name = 'maverick'
17recipe_text = """# bzr-builder format 0.2 deb-version {debupstream}-0~{revno}17recipe_text = """# bzr-builder format 0.2 deb-version {debupstream}-0~{revno}
18http://bazaar.launchpad.dev/~ppa-user/+junk/wakeonlan"""18http://bazaar.launchpad.dev/~ppa-user/+junk/wakeonlan"""
1919
20
20def deb_line(host, suites):21def deb_line(host, suites):
21 prefix = 'deb http://'22 prefix = 'deb http://'
22 if apt_cacher_ng_host != None:23 if apt_cacher_ng_host is not None:
23 prefix += '%s:3142/' % apt_cacher_ng_host24 prefix += '%s:3142/' % apt_cacher_ng_host
24 return '%s%s %s %s' % (prefix, host, distroseries_name, suites)25 return '%s%s %s %s' % (prefix, host, distroseries_name, suites)
2526
27
26proxy = ServerProxy('http://localhost:8221/rpc')28proxy = ServerProxy('http://localhost:8221/rpc')
27print(proxy.echo('Hello World'))29print(proxy.echo('Hello World'))
28print(proxy.info())30print(proxy.info())
@@ -44,8 +46,5 @@ print(proxy.build(
44 deb_line('%s.archive.ubuntu.com/ubuntu' % country_code,46 deb_line('%s.archive.ubuntu.com/ubuntu' % country_code,
45 'main universe'),47 'main universe'),
46 deb_line('ppa.launchpad.net/launchpad/bzr-builder-dev/ubuntu',48 deb_line('ppa.launchpad.net/launchpad/bzr-builder-dev/ubuntu',
47 'main'),]}))49 'main'),
48#status = proxy.status()50 ]}))
49#for filename, sha1 in status[3].iteritems():
50# print(filename)
51#proxy.clean()
diff --git a/buildd-genconfig b/buildd-genconfig
index 2615b88..8195ef7 100755
--- a/buildd-genconfig
+++ b/buildd-genconfig
@@ -5,42 +5,47 @@
55
6from __future__ import print_function6from __future__ import print_function
77
8from optparse import OptionParser
8import os9import os
910
10archtag = os.popen("dpkg --print-architecture").read().strip()11archtag = os.popen("dpkg --print-architecture").read().strip()
1112
12from optparse import OptionParser
13
14parser = OptionParser()13parser = OptionParser()
15parser.add_option("-n", "--name", dest="NAME",14parser.add_option(
16 help="the name for this buildd",15 "-n", "--name", dest="NAME",
17 metavar="NAME",16 help="the name for this buildd",
18 default="default")17 metavar="NAME",
1918 default="default")
20parser.add_option("-H", "--host", dest="BINDHOST",19
21 help="the IP/host this buildd binds to",20parser.add_option(
22 metavar="HOSTNAME",21 "-H", "--host", dest="BINDHOST",
23 default="localhost")22 help="the IP/host this buildd binds to",
2423 metavar="HOSTNAME",
25parser.add_option("-p", "--port", dest="BINDPORT",24 default="localhost")
26 help="the port this buildd binds to",25
27 metavar="PORT",26parser.add_option(
28 default="8221")27 "-p", "--port", dest="BINDPORT",
2928 help="the port this buildd binds to",
30parser.add_option("-a", "--arch", dest="ARCHTAG",29 metavar="PORT",
31 help="the arch tag this buildd claims",30 default="8221")
32 metavar="ARCHTAG",31
33 default=archtag)32parser.add_option(
3433 "-a", "--arch", dest="ARCHTAG",
35parser.add_option("-t", "--template", dest="TEMPLATE",34 help="the arch tag this buildd claims",
36 help="the template file to use",35 metavar="ARCHTAG",
37 metavar="FILE",36 default=archtag)
38 default="/usr/share/launchpad-buildd/template-buildd-slave.conf")37
3938parser.add_option(
40parser.add_option("--proxy-port", dest="PROXYPORT",39 "-t", "--template", dest="TEMPLATE",
41 help="the port the local builder proxy binds to",40 help="the template file to use",
42 metavar="PORT",41 metavar="FILE",
43 default="8222")42 default="/usr/share/launchpad-buildd/template-buildd-slave.conf")
43
44parser.add_option(
45 "--proxy-port", dest="PROXYPORT",
46 help="the port the local builder proxy binds to",
47 metavar="PORT",
48 default="8222")
4449
45(options, args) = parser.parse_args()50(options, args) = parser.parse_args()
4651
diff --git a/debian/changelog b/debian/changelog
index 92cb241..a10074a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
1launchpad-buildd (206) UNRELEASED; urgency=medium
2
3 * Fix flake8 violations.
4
5 -- Colin Watson <cjwatson@ubuntu.com> Wed, 08 Dec 2021 15:42:26 +0000
6
1launchpad-buildd (205) bionic; urgency=medium7launchpad-buildd (205) bionic; urgency=medium
28
3 * Ignore NotAutomatic flag for -proposed and -backports (LP: #1016776).9 * Ignore NotAutomatic flag for -proposed and -backports (LP: #1016776).
diff --git a/debian/upgrade-config b/debian/upgrade-config
index 3145a89..db10239 100755
--- a/debian/upgrade-config
+++ b/debian/upgrade-config
@@ -31,6 +31,9 @@ apt_pkg.init()
3131
32(old_version, conf_file) = sys.argv[1:]32(old_version, conf_file) = sys.argv[1:]
3333
34bin_path = "/usr/share/launchpad-buildd/slavebin"
35
36
34def upgrade_to_12():37def upgrade_to_12():
35 print("Upgrading %s to version 12" % conf_file)38 print("Upgrading %s to version 12" % conf_file)
36 subprocess.call(["mv", conf_file, conf_file+"-prev12~"])39 subprocess.call(["mv", conf_file, conf_file+"-prev12~"])
@@ -38,13 +41,14 @@ def upgrade_to_12():
38 out_file = open(conf_file, "w")41 out_file = open(conf_file, "w")
39 for line in in_file:42 for line in in_file:
40 if line.startswith("[debianmanager]"):43 if line.startswith("[debianmanager]"):
41 line += "ogrepath = /usr/share/launchpad-buildd/slavebin/apply-ogre-model\n"44 line += "ogrepath = %s/apply-ogre-model\n" % bin_path
42 if line.startswith("sbuildargs"):45 if line.startswith("sbuildargs"):
43 line = line.replace("-A", "")46 line = line.replace("-A", "")
44 out_file.write(line)47 out_file.write(line)
45 in_file.close()48 in_file.close()
46 out_file.close()49 out_file.close()
4750
51
48def upgrade_to_34():52def upgrade_to_34():
49 print("Upgrading %s to version 34" % conf_file)53 print("Upgrading %s to version 34" % conf_file)
50 subprocess.call(["mv", conf_file, conf_file+"-prev34~"])54 subprocess.call(["mv", conf_file, conf_file+"-prev34~"])
@@ -52,11 +56,12 @@ def upgrade_to_34():
52 out_file = open(conf_file, "w")56 out_file = open(conf_file, "w")
53 for line in in_file:57 for line in in_file:
54 if line.startswith("[debianmanager]"):58 if line.startswith("[debianmanager]"):
55 line += "sourcespath = /usr/share/launchpad-buildd/slavebin/override-sources-list\n"59 line += "sourcespath = %s/override-sources-list\n" % bin_path
56 out_file.write(line)60 out_file.write(line)
57 in_file.close()61 in_file.close()
58 out_file.close()62 out_file.close()
5963
64
60def upgrade_to_39():65def upgrade_to_39():
61 print("Upgrading %s to version 39" % conf_file)66 print("Upgrading %s to version 39" % conf_file)
62 subprocess.call(["mv", conf_file, conf_file+"-prev39~"])67 subprocess.call(["mv", conf_file, conf_file+"-prev39~"])
@@ -64,13 +69,14 @@ def upgrade_to_39():
64 out_file = open(conf_file, "w")69 out_file = open(conf_file, "w")
65 for line in in_file:70 for line in in_file:
66 if line.startswith("sbuildargs"):71 if line.startswith("sbuildargs"):
67 line = line.replace("-dautobuild ","")72 line = line.replace("-dautobuild ", "")
68 if line.startswith("[slave]"):73 if line.startswith("[slave]"):
69 line += "ntphost = ntp.buildd\n"74 line += "ntphost = ntp.buildd\n"
70 out_file.write(line)75 out_file.write(line)
71 in_file.close()76 in_file.close()
72 out_file.close()77 out_file.close()
7378
79
74def upgrade_to_57():80def upgrade_to_57():
75 print("Upgrading %s to version 57" % conf_file)81 print("Upgrading %s to version 57" % conf_file)
76 subprocess.call(["mv", conf_file, conf_file+"-prev57~"])82 subprocess.call(["mv", conf_file, conf_file+"-prev57~"])
@@ -90,6 +96,7 @@ def upgrade_to_57():
90 in_file.close()96 in_file.close()
91 out_file.close()97 out_file.close()
9298
99
93def upgrade_to_58():100def upgrade_to_58():
94 print("Upgrading %s to version 58" % conf_file)101 print("Upgrading %s to version 58" % conf_file)
95 subprocess.call(["mv", conf_file, conf_file+"-prev58~"])102 subprocess.call(["mv", conf_file, conf_file+"-prev58~"])
@@ -98,8 +105,8 @@ def upgrade_to_58():
98 out_file.write(in_file.read())105 out_file.write(in_file.read())
99 out_file.write(106 out_file.write(
100 '\n[sourcepackagerecipemanager]\n'107 '\n[sourcepackagerecipemanager]\n'
101 'buildrecipepath = /usr/share/launchpad-buildd'108 'buildrecipepath = %s/buildrecipe\n' % bin_path)
102 '/slavebin/buildrecipe\n')109
103110
104def upgrade_to_59():111def upgrade_to_59():
105 print("Upgrading %s to version 59" % conf_file)112 print("Upgrading %s to version 59" % conf_file)
@@ -109,8 +116,9 @@ def upgrade_to_59():
109 out_file.write(in_file.read())116 out_file.write(in_file.read())
110 out_file.write(117 out_file.write(
111 '\n[translationtemplatesmanager]\n'118 '\n[translationtemplatesmanager]\n'
112 'generatepath = /usr/share/launchpad-buildd/slavebin/generate-translation-templates\n'119 'generatepath = %s/generate-translation-templates\n'
113 'resultarchive = translation-templates.tar.gz\n')120 'resultarchive = translation-templates.tar.gz\n' % bin_path)
121
114122
115def upgrade_to_63():123def upgrade_to_63():
116 print("Upgrading %s to version 63" % conf_file)124 print("Upgrading %s to version 63" % conf_file)
@@ -121,6 +129,7 @@ def upgrade_to_63():
121 if not line.startswith('ogrepath'):129 if not line.startswith('ogrepath'):
122 out_file.write(line)130 out_file.write(line)
123131
132
124def upgrade_to_110():133def upgrade_to_110():
125 print("Upgrading %s to version 110" % conf_file)134 print("Upgrading %s to version 110" % conf_file)
126 subprocess.call(["mv", conf_file, conf_file+"-prev110~"])135 subprocess.call(["mv", conf_file, conf_file+"-prev110~"])
@@ -128,11 +137,12 @@ def upgrade_to_110():
128 out_file = open(conf_file, "w")137 out_file = open(conf_file, "w")
129 for line in in_file:138 for line in in_file:
130 if line.startswith("[allmanagers]"):139 if line.startswith("[allmanagers]"):
131 line += "preppath = /usr/share/launchpad-buildd/slavebin/slave-prep\n"140 line += "preppath = %s/slave-prep\n" % bin_path
132 out_file.write(line)141 out_file.write(line)
133 in_file.close()142 in_file.close()
134 out_file.close()143 out_file.close()
135144
145
136def upgrade_to_115():146def upgrade_to_115():
137 print("Upgrading %s to version 115" % conf_file)147 print("Upgrading %s to version 115" % conf_file)
138 subprocess.call(["mv", conf_file, conf_file+"-prev115~"])148 subprocess.call(["mv", conf_file, conf_file+"-prev115~"])
@@ -143,13 +153,15 @@ def upgrade_to_115():
143 if line.startswith("[allmanagers]"):153 if line.startswith("[allmanagers]"):
144 in_allmanagers = True154 in_allmanagers = True
145 elif in_allmanagers and (line.startswith("[") or not line.strip()):155 elif in_allmanagers and (line.startswith("[") or not line.strip()):
146 out_file.write("processscanpath = /usr/share/launchpad-buildd/slavebin/scan-for-processes\n")156 out_file.write(
157 "processscanpath = %s/scan-for-processes\n" % bin_path)
147 in_allmanagers = False158 in_allmanagers = False
148 if not line.startswith("processscanpath = "):159 if not line.startswith("processscanpath = "):
149 out_file.write(line)160 out_file.write(line)
150 in_file.close()161 in_file.close()
151 out_file.close()162 out_file.close()
152163
164
153def upgrade_to_120():165def upgrade_to_120():
154 print("Upgrading %s to version 120" % conf_file)166 print("Upgrading %s to version 120" % conf_file)
155 subprocess.call(["mv", conf_file, conf_file+"-prev120~"])167 subprocess.call(["mv", conf_file, conf_file+"-prev120~"])
@@ -158,10 +170,11 @@ def upgrade_to_120():
158 out_file.write(in_file.read())170 out_file.write(in_file.read())
159 out_file.write(171 out_file.write(
160 "\n[livefilesystemmanager]\n"172 "\n[livefilesystemmanager]\n"
161 "buildlivefspath = /usr/share/launchpad-buildd/slavebin/buildlivefs\n")173 "buildlivefspath = %s/buildlivefs\n" % bin_path)
162 in_file.close()174 in_file.close()
163 out_file.close()175 out_file.close()
164176
177
165def upgrade_to_126():178def upgrade_to_126():
166 print("Upgrading %s to version 126" % conf_file)179 print("Upgrading %s to version 126" % conf_file)
167 subprocess.call(["mv", conf_file, conf_file+"-prev126~"])180 subprocess.call(["mv", conf_file, conf_file+"-prev126~"])
@@ -176,6 +189,7 @@ def upgrade_to_126():
176 in_file.close()189 in_file.close()
177 out_file.close()190 out_file.close()
178191
192
179def upgrade_to_127():193def upgrade_to_127():
180 print("Upgrading %s to version 127" % conf_file)194 print("Upgrading %s to version 127" % conf_file)
181 os.rename(conf_file, conf_file + "-prev127~")195 os.rename(conf_file, conf_file + "-prev127~")
@@ -209,6 +223,7 @@ def upgrade_to_127():
209 in_file.close()223 in_file.close()
210 out_file.close()224 out_file.close()
211225
226
212def upgrade_to_162():227def upgrade_to_162():
213 print("Upgrading %s to version 162" % conf_file)228 print("Upgrading %s to version 162" % conf_file)
214 os.rename(conf_file, conf_file + "-prev162~")229 os.rename(conf_file, conf_file + "-prev162~")
@@ -220,6 +235,7 @@ def upgrade_to_162():
220 "\n[snapmanager]\n"235 "\n[snapmanager]\n"
221 "proxyport = 8222\n")236 "proxyport = 8222\n")
222237
238
223def upgrade_to_190():239def upgrade_to_190():
224 print("Upgrading %s to version 190" % conf_file)240 print("Upgrading %s to version 190" % conf_file)
225 os.rename(conf_file, conf_file + "-prev190~")241 os.rename(conf_file, conf_file + "-prev190~")
@@ -231,6 +247,7 @@ def upgrade_to_190():
231 line = "[builder]\n"247 line = "[builder]\n"
232 out_file.write(line)248 out_file.write(line)
233249
250
234def upgrade_to_200():251def upgrade_to_200():
235 print("Upgrading %s to version 200" % conf_file)252 print("Upgrading %s to version 200" % conf_file)
236253
@@ -273,6 +290,7 @@ def upgrade_to_200():
273 (line.startswith("[") or not line.strip())):290 (line.startswith("[") or not line.strip())):
274 in_snapmanager = False291 in_snapmanager = False
275292
293
276if __name__ == "__main__":294if __name__ == "__main__":
277 old_version = re.sub(r'[~-].*', '', old_version)295 old_version = re.sub(r'[~-].*', '', old_version)
278 if apt_pkg.version_compare(old_version, "12") < 0:296 if apt_pkg.version_compare(old_version, "12") < 0:
diff --git a/lpbuildd/binarypackage.py b/lpbuildd/binarypackage.py
index 7312473..1bbf831 100644
--- a/lpbuildd/binarypackage.py
+++ b/lpbuildd/binarypackage.py
@@ -48,7 +48,11 @@ APT_DUBIOUS_DEP_PATTERNS = [
4848
4949
50class BuildLogRegexes:50class BuildLogRegexes:
51 """Build log regexes for performing actions based on regexes, and extracting dependencies for auto dep-waits"""51 """Various build log regexes.
52
53 These allow performing actions based on regexes, and extracting
54 dependencies for auto dep-waits.
55 """
52 GIVENBACK = [56 GIVENBACK = [
53 (r"^E: There are problems and -y was used without --force-yes"),57 (r"^E: There are problems and -y was used without --force-yes"),
54 ]58 ]
@@ -131,15 +135,16 @@ class BinaryPackageBuildManager(DebianBuildManager):
131 # Use the "plain" chroot type because we do the necessary setup135 # Use the "plain" chroot type because we do the necessary setup
132 # and teardown ourselves: it's easier to do this the same way136 # and teardown ourselves: it's easier to do this the same way
133 # for all build types.137 # for all build types.
134 print(dedent('''\138 print(
135 [build-{buildid}]139 dedent('''\
136 description=build-{buildid}140 [build-{buildid}]
137 groups=sbuild,root141 description=build-{buildid}
138 root-groups=sbuild,root142 groups=sbuild,root
139 type=plain143 root-groups=sbuild,root
140 directory={chroot_path}144 type=plain
141 ''').format(145 directory={chroot_path}
142 buildid=self._buildid, chroot_path=self.chroot_path),146 ''').format(
147 buildid=self._buildid, chroot_path=self.chroot_path),
143 file=schroot_file, end='')148 file=schroot_file, end='')
144 schroot_file.flush()149 schroot_file.flush()
145 subprocess.check_call(150 subprocess.check_call(
@@ -285,9 +290,8 @@ class BinaryPackageBuildManager(DebianBuildManager):
285 return True290 return True
286 dep_restrictions = dep.get("restrictions")291 dep_restrictions = dep.get("restrictions")
287 if dep_restrictions is not None:292 if dep_restrictions is not None:
288 if all(293 if all(any(restriction.enabled for restriction in restrlist)
289 any(restriction.enabled for restriction in restrlist)294 for restrlist in dep_restrictions):
290 for restrlist in dep_restrictions):
291 # This dependency "matches" in the sense that it's ignored295 # This dependency "matches" in the sense that it's ignored
292 # when no build profiles are enabled.296 # when no build profiles are enabled.
293 return True297 return True
diff --git a/lpbuildd/builder.py b/lpbuildd/builder.py
index b8362d3..ad08639 100644
--- a/lpbuildd/builder.py
+++ b/lpbuildd/builder.py
@@ -193,7 +193,8 @@ class BuildManager(object):
193 if notify:193 if notify:
194 iterate = partial(self.iterateReap, state)194 iterate = partial(self.iterateReap, state)
195 else:195 else:
196 iterate = lambda success: None196 def iterate(success):
197 pass
197 self.runTargetSubProcess("scan-for-processes", iterate=iterate)198 self.runTargetSubProcess("scan-for-processes", iterate=iterate)
198199
199 def doCleanup(self):200 def doCleanup(self):
@@ -232,9 +233,8 @@ class BuildManager(object):
232233
233 os.mkdir("%s/build-%s" % (self.home, self._buildid))234 os.mkdir("%s/build-%s" % (self.home, self._buildid))
234 for f in files:235 for f in files:
235 os.symlink( self._builder.cachePath(files[f]),236 os.symlink(self._builder.cachePath(files[f]),
236 "%s/build-%s/%s" % (self.home,237 "%s/build-%s/%s" % (self.home, self._buildid, f))
237 self._buildid, f))
238 self._chroottarfile = self._builder.cachePath(chroot)238 self._chroottarfile = self._builder.cachePath(chroot)
239239
240 self.image_type = extra_args.get('image_type', 'chroot')240 self.image_type = extra_args.get('image_type', 'chroot')
diff --git a/lpbuildd/check_implicit_pointer_functions.py b/lpbuildd/check_implicit_pointer_functions.py
index 7f28338..78df89f 100755
--- a/lpbuildd/check_implicit_pointer_functions.py
+++ b/lpbuildd/check_implicit_pointer_functions.py
@@ -42,12 +42,12 @@ implicit_pattern = re.compile(
42pointer_pattern = re.compile(42pointer_pattern = re.compile(
43 br"([^:]*):(\d+):(\d+:)? warning: "43 br"([^:]*):(\d+):(\d+:)? warning: "
44 br"("44 br"("
45 br"(assignment"45 br"(assignment"
46 br"|initialization"46 br"|initialization"
47 br"|return"47 br"|return"
48 br"|passing arg \d+ of `[^']*'"48 br"|passing arg \d+ of `[^']*'"
49 br"|passing arg \d+ of pointer to function"49 br"|passing arg \d+ of pointer to function"
50 br") makes pointer from integer without a cast"50 br") makes pointer from integer without a cast"
51 br"|"51 br"|"
52 br"cast to pointer from integer of different size)")52 br"cast to pointer from integer of different size)")
5353
@@ -77,7 +77,7 @@ def filter_log(in_file, out_file, in_line=False):
77 pointer_filename = m.group(1)77 pointer_filename = m.group(1)
78 pointer_linenum = int(m.group(2))78 pointer_linenum = int(m.group(2))
79 if (last_implicit_filename == pointer_filename79 if (last_implicit_filename == pointer_filename
80 and last_implicit_linenum == pointer_linenum):80 and last_implicit_linenum == pointer_linenum):
81 err = (81 err = (
82 b"Function `%s' implicitly converted to pointer at "82 b"Function `%s' implicitly converted to pointer at "
83 b"%s:%d" % (83 b"%s:%d" % (
diff --git a/lpbuildd/oci.py b/lpbuildd/oci.py
index aa28a03..c6e103c 100644
--- a/lpbuildd/oci.py
+++ b/lpbuildd/oci.py
@@ -242,7 +242,6 @@ class OCIBuildManager(BuildManagerProxyMixin, DebianBuildManager):
242 source_name, target_name))242 source_name, target_name))
243 shutil.copy(source_name, target_name)243 shutil.copy(source_name, target_name)
244244
245
246 # We need these mapping files245 # We need these mapping files
247 sha_directory = tempfile.mkdtemp()246 sha_directory = tempfile.mkdtemp()
248 # This can change depending on the kernel options / docker package247 # This can change depending on the kernel options / docker package
@@ -255,7 +254,7 @@ class OCIBuildManager(BuildManagerProxyMixin, DebianBuildManager):
255 # we will have no contents from it.254 # we will have no contents from it.
256 if self.backend.path_exists(sha_path):255 if self.backend.path_exists(sha_path):
257 sha_files = [x for x in self.backend.listdir(sha_path)256 sha_files = [x for x in self.backend.listdir(sha_path)
258 if not x.startswith('.')]257 if not x.startswith('.')]
259 for file in sha_files:258 for file in sha_files:
260 self.backend.copy_out(259 self.backend.copy_out(
261 os.path.join(sha_path, file),260 os.path.join(sha_path, file),
diff --git a/lpbuildd/proxy.py b/lpbuildd/proxy.py
index 908770d..de6e3c7 100644
--- a/lpbuildd/proxy.py
+++ b/lpbuildd/proxy.py
@@ -128,15 +128,15 @@ class BuilderProxyRequest(http.Request):
128 if self.startedWriting:128 if self.startedWriting:
129 return129 return
130 self.startedWriting = 1130 self.startedWriting = 1
131 l = []131 lines = []
132 l.append(132 lines.append(
133 self.clientproto + b" " + intToBytes(self.code) + b" " +133 self.clientproto + b" " + intToBytes(self.code) + b" " +
134 self.code_message + b"\r\n")134 self.code_message + b"\r\n")
135 for name, values in self.responseHeaders.getAllRawHeaders():135 for name, values in self.responseHeaders.getAllRawHeaders():
136 for value in values:136 for value in values:
137 l.extend([name, b": ", value, b"\r\n"])137 lines.extend([name, b": ", value, b"\r\n"])
138 l.append(b"\r\n")138 lines.append(b"\r\n")
139 self.transport.writeSequence(l)139 self.transport.writeSequence(lines)
140140
141 def write(self, data):141 def write(self, data):
142 if self.channel is not None:142 if self.channel is not None:
diff --git a/lpbuildd/sourcepackagerecipe.py b/lpbuildd/sourcepackagerecipe.py
index b2f46cb..4e237a6 100644
--- a/lpbuildd/sourcepackagerecipe.py
+++ b/lpbuildd/sourcepackagerecipe.py
@@ -117,9 +117,8 @@ class SourcePackageRecipeBuildManager(DebianBuildManager):
117 print("Returning build status: Build failed")117 print("Returning build status: Build failed")
118 self._builder.buildFail()118 self._builder.buildFail()
119 self.alreadyfailed = True119 self.alreadyfailed = True
120 elif (120 elif (retcode >= RETCODE_FAILURE_INSTALL and
121 retcode >= RETCODE_FAILURE_INSTALL and121 retcode <= RETCODE_FAILURE_BUILD_SOURCE_PACKAGE):
122 retcode <= RETCODE_FAILURE_BUILD_SOURCE_PACKAGE):
123 # XXX AaronBentley 2009-01-13: We should handle depwait separately122 # XXX AaronBentley 2009-01-13: We should handle depwait separately
124 if not self.alreadyfailed:123 if not self.alreadyfailed:
125 self._builder.buildFail()124 self._builder.buildFail()
diff --git a/lpbuildd/target/build_charm.py b/lpbuildd/target/build_charm.py
index d5ade71..5d0b3ab 100644
--- a/lpbuildd/target/build_charm.py
+++ b/lpbuildd/target/build_charm.py
@@ -136,4 +136,3 @@ class BuildCharm(BuilderProxyOperationMixin, VCSOperationMixin,
136 logger.exception('Build failed')136 logger.exception('Build failed')
137 return RETCODE_FAILURE_BUILD137 return RETCODE_FAILURE_BUILD
138 return 0138 return 0
139
diff --git a/lpbuildd/target/lxd.py b/lpbuildd/target/lxd.py
index 6ddd1d0..163176d 100644
--- a/lpbuildd/target/lxd.py
+++ b/lpbuildd/target/lxd.py
@@ -402,8 +402,8 @@ class LXD(Backend):
402 if os.path.islink(resolv_conf):402 if os.path.islink(resolv_conf):
403 resolv_conf = os.path.realpath(resolv_conf)403 resolv_conf = os.path.realpath(resolv_conf)
404 if (resolv_conf == "/run/systemd/resolve/stub-resolv.conf" and404 if (resolv_conf == "/run/systemd/resolve/stub-resolv.conf" and
405 os.path.isfile("/run/systemd/resolve/resolv.conf")):405 os.path.isfile("/run/systemd/resolve/resolv.conf")):
406 resolv_conf = "/run/systemd/resolve/resolv.conf"406 resolv_conf = "/run/systemd/resolve/resolv.conf"
407407
408 self.copy_in(resolv_conf, "/etc/resolv.conf")408 self.copy_in(resolv_conf, "/etc/resolv.conf")
409409
diff --git a/lpbuildd/target/operation.py b/lpbuildd/target/operation.py
index 7020786..2f9fe64 100644
--- a/lpbuildd/target/operation.py
+++ b/lpbuildd/target/operation.py
@@ -5,8 +5,6 @@ from __future__ import print_function
55
6__metaclass__ = type6__metaclass__ = type
77
8import os
9
10from lpbuildd.target.backend import make_backend8from lpbuildd.target.backend import make_backend
119
1210
diff --git a/lpbuildd/target/tests/test_lxd.py b/lpbuildd/target/tests/test_lxd.py
index 38d3337..35be3bb 100644
--- a/lpbuildd/target/tests/test_lxd.py
+++ b/lpbuildd/target/tests/test_lxd.py
@@ -312,8 +312,9 @@ class TestLXD(TestCase):
312 ("lxc.network.0.ipv4.gateway", "10.10.10.1"),312 ("lxc.network.0.ipv4.gateway", "10.10.10.1"),
313 ])313 ])
314314
315 raw_lxc_config = "".join("{key}={val}\n".format(key=key, val=val)315 raw_lxc_config = "".join(
316 for key, val in sorted(raw_lxc_config + extra_raw_lxc_config))316 "{key}={val}\n".format(key=key, val=val)
317 for key, val in sorted(raw_lxc_config + extra_raw_lxc_config))
317318
318 expected_config = {319 expected_config = {
319 "security.privileged": "true",320 "security.privileged": "true",
diff --git a/lpbuildd/target/vcs.py b/lpbuildd/target/vcs.py
index 4ddd9e5..f02e540 100644
--- a/lpbuildd/target/vcs.py
+++ b/lpbuildd/target/vcs.py
@@ -57,7 +57,8 @@ class VCSOperationMixin:
57 else:57 else:
58 return ["git"]58 return ["git"]
5959
60 def vcs_fetch(self, name, cwd, env=None, quiet=False, git_shallow_clone=False):60 def vcs_fetch(self, name, cwd, env=None, quiet=False,
61 git_shallow_clone=False):
61 full_env = OrderedDict()62 full_env = OrderedDict()
62 full_env["LANG"] = "C.UTF-8"63 full_env["LANG"] = "C.UTF-8"
63 full_env["SHELL"] = "/bin/sh"64 full_env["SHELL"] = "/bin/sh"
diff --git a/lpbuildd/tests/fakebuilder.py b/lpbuildd/tests/fakebuilder.py
index 7731ea2..ef20810 100644
--- a/lpbuildd/tests/fakebuilder.py
+++ b/lpbuildd/tests/fakebuilder.py
@@ -108,10 +108,10 @@ class FakeBuilder:
108 self._config = FakeConfig()108 self._config = FakeConfig()
109 self.waitingfiles = {}109 self.waitingfiles = {}
110 for fake_method in (110 for fake_method in (
111 "emptyLog", "log",111 "emptyLog", "log",
112 "chrootFail", "buildFail", "builderFail", "depFail", "buildOK",112 "chrootFail", "buildFail", "builderFail", "depFail", "buildOK",
113 "buildComplete",113 "buildComplete",
114 ):114 ):
115 setattr(self, fake_method, FakeMethod())115 setattr(self, fake_method, FakeMethod())
116116
117 def cachePath(self, file):117 def cachePath(self, file):
diff --git a/lpbuildd/tests/oci_tarball.py b/lpbuildd/tests/oci_tarball.py
index 21ec013..35860ad 100644
--- a/lpbuildd/tests/oci_tarball.py
+++ b/lpbuildd/tests/oci_tarball.py
@@ -17,8 +17,9 @@ class OCITarball:
17 @property17 @property
18 def config(self):18 def config(self):
19 return self._makeFile(19 return self._makeFile(
20 {"rootfs": {"diff_ids":20 {"rootfs": {
21 ["sha256:diff1", "sha256:diff2", "sha256:diff3"]}},21 "diff_ids": [
22 "sha256:diff1", "sha256:diff2", "sha256:diff3"]}},
22 'config.json')23 'config.json')
2324
24 @property25 @property
@@ -57,10 +58,7 @@ class OCITarball:
57 source = os.path.join(source_layer_directory, "layer.tar")58 source = os.path.join(source_layer_directory, "layer.tar")
5859
59 os.mkdir(target_layer_directory)60 os.mkdir(target_layer_directory)
60 os.symlink(61 os.symlink(os.path.relpath(source, target_layer_directory), target)
61 os.path.relpath(source, target_layer_directory),
62 os.path.join(target_layer_directory, "layer.tar")
63 )
64 return target_layer_directory62 return target_layer_directory
6563
66 def build_tar_file(self):64 def build_tar_file(self):
diff --git a/lpbuildd/tests/test_binarypackage.py b/lpbuildd/tests/test_binarypackage.py
index c88bdb2..22c4b0a 100644
--- a/lpbuildd/tests/test_binarypackage.py
+++ b/lpbuildd/tests/test_binarypackage.py
@@ -134,11 +134,11 @@ class TestBinaryPackageBuildManagerIteration(TestCase):
134 self.assertState(134 self.assertState(
135 BinaryPackageBuildState.SBUILD,135 BinaryPackageBuildState.SBUILD,
136 [136 [
137 'sharepath/bin/sbuild-package', 'sbuild-package',137 'sharepath/bin/sbuild-package', 'sbuild-package',
138 self.buildid, 'i386', 'warty',138 self.buildid, 'i386', 'warty',
139 '-c', 'chroot:build-' + self.buildid,139 '-c', 'chroot:build-' + self.buildid,
140 '--arch=i386', '--dist=warty', '--nolog',140 '--arch=i386', '--dist=warty', '--nolog',
141 'foo_1.dsc',141 'foo_1.dsc',
142 ], final=True)142 ], final=True)
143 self.assertFalse(self.builder.wasCalled('chrootFail'))143 self.assertFalse(self.builder.wasCalled('chrootFail'))
144144
@@ -490,12 +490,12 @@ class TestBinaryPackageBuildManagerIteration(TestCase):
490 def test_relationMatches_versioned(self):490 def test_relationMatches_versioned(self):
491 # relationMatches handles versioned dependencies correctly.491 # relationMatches handles versioned dependencies correctly.
492 for version, expected in (492 for version, expected in (
493 (("<<", "1"), False), (("<<", "1.1"), True),493 (("<<", "1"), False), (("<<", "1.1"), True),
494 (("<=", "0.9"), False), (("<=", "1"), True),494 (("<=", "0.9"), False), (("<=", "1"), True),
495 (("=", "1"), True), (("=", "2"), False),495 (("=", "1"), True), (("=", "2"), False),
496 ((">=", "1"), True), ((">=", "1.1"), False),496 ((">=", "1"), True), ((">=", "1.1"), False),
497 ((">>", "0.9"), True), ((">>", "1"), False),497 ((">>", "0.9"), True), ((">>", "1"), False),
498 ):498 ):
499 assert_method = self.assertTrue if expected else self.assertFalse499 assert_method = self.assertTrue if expected else self.assertFalse
500 assert_method(self.buildmanager.relationMatches(500 assert_method(self.buildmanager.relationMatches(
501 {"name": "foo", "version": version}, {"foo": set(["1"])}),501 {"name": "foo", "version": version}, {"foo": set(["1"])}),
@@ -505,10 +505,10 @@ class TestBinaryPackageBuildManagerIteration(TestCase):
505 # If multiple versions of a package are present, relationMatches505 # If multiple versions of a package are present, relationMatches
506 # returns True for dependencies that match any of them.506 # returns True for dependencies that match any of them.
507 for version, expected in (507 for version, expected in (
508 (("=", "1"), True),508 (("=", "1"), True),
509 (("=", "1.1"), True),509 (("=", "1.1"), True),
510 (("=", "2"), False),510 (("=", "2"), False),
511 ):511 ):
512 assert_method = self.assertTrue if expected else self.assertFalse512 assert_method = self.assertTrue if expected else self.assertFalse
513 assert_method(self.buildmanager.relationMatches(513 assert_method(self.buildmanager.relationMatches(
514 {"name": "foo", "version": version},514 {"name": "foo", "version": version},
diff --git a/lpbuildd/tests/test_buildrecipe.py b/lpbuildd/tests/test_buildrecipe.py
index 2faa985..de7b50a 100644
--- a/lpbuildd/tests/test_buildrecipe.py
+++ b/lpbuildd/tests/test_buildrecipe.py
@@ -277,12 +277,13 @@ class TestRecipeBuilder(TestCase):
277 os.makedirs(os.path.dirname(control_path))277 os.makedirs(os.path.dirname(control_path))
278 os.makedirs(self.builder.apt_dir)278 os.makedirs(self.builder.apt_dir)
279 with open(control_path, "w") as control:279 with open(control_path, "w") as control:
280 print(dedent("""\280 print(
281 Source: foo281 dedent("""\
282 Build-Depends: debhelper (>= 9~), libfoo-dev282 Source: foo
283 Build-Depends: debhelper (>= 9~), libfoo-dev
283284
284 Package: foo285 Package: foo
285 Depends: ${shlibs:Depends}"""),286 Depends: ${shlibs:Depends}"""),
286 file=control)287 file=control)
287 self.builder.makeDummyDsc("foo")288 self.builder.makeDummyDsc("foo")
288 with open(os.path.join(self.builder.apt_dir, "foo.dsc")) as dsc:289 with open(os.path.join(self.builder.apt_dir, "foo.dsc")) as dsc:
@@ -308,15 +309,16 @@ class TestRecipeBuilder(TestCase):
308 os.makedirs(os.path.dirname(control_path))309 os.makedirs(os.path.dirname(control_path))
309 os.makedirs(self.builder.apt_dir)310 os.makedirs(self.builder.apt_dir)
310 with open(control_path, "w") as control:311 with open(control_path, "w") as control:
311 print(dedent("""\312 print(
312 Source: foo313 dedent("""\
313 Build-Depends: debhelper (>= 9~),314 Source: foo
314 libfoo-dev,315 Build-Depends: debhelper (>= 9~),
315 # comment line316 libfoo-dev,
316 pkg-config317 # comment line
318 pkg-config
317319
318 Package: foo320 Package: foo
319 Depends: ${shlibs:Depends}"""),321 Depends: ${shlibs:Depends}"""),
320 file=control)322 file=control)
321 self.builder.makeDummyDsc("foo")323 self.builder.makeDummyDsc("foo")
322 with open(os.path.join(self.builder.apt_dir, "foo.dsc")) as dsc:324 with open(os.path.join(self.builder.apt_dir, "foo.dsc")) as dsc:
@@ -337,13 +339,14 @@ class TestRecipeBuilder(TestCase):
337 def test_runAptFtparchive(self):339 def test_runAptFtparchive(self):
338 os.makedirs(self.builder.apt_dir)340 os.makedirs(self.builder.apt_dir)
339 with open(os.path.join(self.builder.apt_dir, "foo.dsc"), "w") as dsc:341 with open(os.path.join(self.builder.apt_dir, "foo.dsc"), "w") as dsc:
340 print(dedent("""\342 print(
341 Format: 1.0343 dedent("""\
342 Source: foo344 Format: 1.0
343 Architecture: any345 Source: foo
344 Version: 99:0346 Architecture: any
345 Maintainer: invalid@example.org347 Version: 99:0
346 Build-Depends: debhelper (>= 9~), libfoo-dev"""),348 Maintainer: invalid@example.org
349 Build-Depends: debhelper (>= 9~), libfoo-dev"""),
347 file=dsc)350 file=dsc)
348 self.assertEqual(0, self.builder.runAptFtparchive())351 self.assertEqual(0, self.builder.runAptFtparchive())
349 self.assertEqual(352 self.assertEqual(
@@ -379,12 +382,13 @@ class TestRecipeBuilder(TestCase):
379 # Not a valid changelog, but only the first line matters here.382 # Not a valid changelog, but only the first line matters here.
380 print("foo (1.0-1) bionic; urgency=medium", file=changelog)383 print("foo (1.0-1) bionic; urgency=medium", file=changelog)
381 with open(control_path, "w") as control:384 with open(control_path, "w") as control:
382 print(dedent("""\385 print(
383 Source: foo386 dedent("""\
384 Build-Depends: debhelper (>= 9~), libfoo-dev387 Source: foo
388 Build-Depends: debhelper (>= 9~), libfoo-dev
385389
386 Package: foo390 Package: foo
387 Depends: ${shlibs:Depends}"""),391 Depends: ${shlibs:Depends}"""),
388 file=control)392 file=control)
389 self.assertEqual(0, self.builder.installBuildDeps())393 self.assertEqual(0, self.builder.installBuildDeps())
390 self.assertThat(394 self.assertThat(
diff --git a/lpbuildd/tests/test_charm.py b/lpbuildd/tests/test_charm.py
index 18e01a1..97b4a15 100644
--- a/lpbuildd/tests/test_charm.py
+++ b/lpbuildd/tests/test_charm.py
@@ -101,7 +101,8 @@ class TestCharmBuildManagerIteration(TestCase):
101 "git_path": "master",101 "git_path": "master",
102 }102 }
103 expected_options = [103 expected_options = [
104 "--git-repository", "https://git.launchpad.dev/~example/+git/charm",104 "--git-repository",
105 "https://git.launchpad.dev/~example/+git/charm",
105 "--git-path", "master",106 "--git-path", "master",
106 ]107 ]
107 yield self.startBuild(args, expected_options)108 yield self.startBuild(args, expected_options)
diff --git a/lpbuildd/tests/test_harness.py b/lpbuildd/tests/test_harness.py
index 049ecd1..0ea496b 100644
--- a/lpbuildd/tests/test_harness.py
+++ b/lpbuildd/tests/test_harness.py
@@ -5,6 +5,6 @@ __metaclass__ = type
55
6import doctest6import doctest
77
8
8def test_suite():9def test_suite():
9 return doctest.DocTestSuite('lpbuildd.tests.harness')10 return doctest.DocTestSuite('lpbuildd.tests.harness')
10
diff --git a/lpbuildd/tests/test_sourcepackagerecipe.py b/lpbuildd/tests/test_sourcepackagerecipe.py
index dda21d4..7a2cb48 100644
--- a/lpbuildd/tests/test_sourcepackagerecipe.py
+++ b/lpbuildd/tests/test_sourcepackagerecipe.py
@@ -78,7 +78,7 @@ class TestSourcePackageRecipeBuildManagerIteration(TestCase):
78 'archives': [78 'archives': [
79 'deb http://archive.ubuntu.com/ubuntu maverick main universe',79 'deb http://archive.ubuntu.com/ubuntu maverick main universe',
80 'deb http://ppa.launchpad.net/launchpad/bzr-builder-dev/'80 'deb http://ppa.launchpad.net/launchpad/bzr-builder-dev/'
81 'ubuntu main',81 'ubuntu main',
82 ],82 ],
83 }83 }
84 if git:84 if git:
diff --git a/lpbuildd/tests/test_util.py b/lpbuildd/tests/test_util.py
index 3eb92f9..8b04d44 100644
--- a/lpbuildd/tests/test_util.py
+++ b/lpbuildd/tests/test_util.py
@@ -21,7 +21,8 @@ class TestShellEscape(TestCase):
21 self.assertEqual("' '", shell_escape(" "))21 self.assertEqual("' '", shell_escape(" "))
2222
23 def test_single_quotes(self):23 def test_single_quotes(self):
24 self.assertEqual("'shell'\"'\"'s great'", shell_escape("shell's great"))24 self.assertEqual(
25 "'shell'\"'\"'s great'", shell_escape("shell's great"))
2526
26 def test_bytes(self):27 def test_bytes(self):
27 self.assertEqual(28 self.assertEqual(
diff --git a/setup.py b/setup.py
index 32e4498..aa05864 100755
--- a/setup.py
+++ b/setup.py
@@ -57,7 +57,7 @@ setup(
57 # XXX cjwatson 2015-11-04: This does in fact require python-apt, but57 # XXX cjwatson 2015-11-04: This does in fact require python-apt, but
58 # that's normally shipped as a system package and specifying it here58 # that's normally shipped as a system package and specifying it here
59 # causes problems for Launchpad's build system.59 # causes problems for Launchpad's build system.
60 #'python-apt',60 # 'python-apt',
61 'python-debian>=0.1.23',61 'python-debian>=0.1.23',
62 'requests',62 'requests',
63 'six',63 'six',

Subscribers

People subscribed via source and target branches