Merge ~cjwatson/launchpad:pyupgrade-py3-soyuz into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 14807bb7894c836bd00455eb7485b7f6731135c5
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:pyupgrade-py3-soyuz
Merge into: launchpad:master
Diff against target: 3602 lines (+400/-425)
111 files modified
.git-blame-ignore-revs (+2/-0)
.pre-commit-config.yaml (+1/-0)
lib/lp/soyuz/adapters/overrides.py (+3/-3)
lib/lp/soyuz/adapters/tests/test_archivedependencies.py (+1/-1)
lib/lp/soyuz/adapters/tests/test_buildarch.py (+1/-1)
lib/lp/soyuz/adapters/tests/test_packagelocation.py (+7/-7)
lib/lp/soyuz/browser/archive.py (+10/-10)
lib/lp/soyuz/browser/archivepermission.py (+1/-1)
lib/lp/soyuz/browser/archivesubscription.py (+5/-5)
lib/lp/soyuz/browser/build.py (+1/-1)
lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py (+2/-2)
lib/lp/soyuz/browser/livefs.py (+8/-8)
lib/lp/soyuz/browser/livefsbuild.py (+1/-1)
lib/lp/soyuz/browser/packagerelationship.py (+2/-2)
lib/lp/soyuz/browser/publishing.py (+5/-5)
lib/lp/soyuz/browser/sourceslist.py (+1/-1)
lib/lp/soyuz/browser/tests/test_archive.py (+1/-1)
lib/lp/soyuz/browser/tests/test_archive_admin_view.py (+1/-1)
lib/lp/soyuz/browser/tests/test_archive_packages.py (+3/-3)
lib/lp/soyuz/browser/tests/test_archive_webservice.py (+3/-3)
lib/lp/soyuz/browser/tests/test_archivesubscription.py (+1/-1)
lib/lp/soyuz/browser/tests/test_breadcrumbs.py (+2/-2)
lib/lp/soyuz/browser/tests/test_build_views.py (+1/-1)
lib/lp/soyuz/browser/tests/test_distributionsourcepackagerelease.py (+1/-1)
lib/lp/soyuz/browser/tests/test_distroarchseries_view.py (+1/-1)
lib/lp/soyuz/browser/tests/test_distrosourcepackagerelease.py (+1/-1)
lib/lp/soyuz/browser/tests/test_livefs.py (+6/-6)
lib/lp/soyuz/browser/tests/test_livefsbuild.py (+3/-3)
lib/lp/soyuz/browser/tests/test_publishing.py (+1/-1)
lib/lp/soyuz/browser/tests/test_queue.py (+1/-1)
lib/lp/soyuz/browser/tests/test_sourcepackagerelease.py (+1/-1)
lib/lp/soyuz/interfaces/archive.py (+8/-10)
lib/lp/soyuz/interfaces/distributionjob.py (+2/-2)
lib/lp/soyuz/interfaces/livefs.py (+6/-6)
lib/lp/soyuz/interfaces/publishing.py (+6/-6)
lib/lp/soyuz/interfaces/queue.py (+4/-4)
lib/lp/soyuz/mail/binarypackagebuild.py (+5/-8)
lib/lp/soyuz/mail/livefsbuild.py (+3/-4)
lib/lp/soyuz/mail/packageupload.py (+9/-13)
lib/lp/soyuz/mail/tests/test_packageupload.py (+12/-12)
lib/lp/soyuz/model/archive.py (+13/-13)
lib/lp/soyuz/model/archivedependency.py (+1/-1)
lib/lp/soyuz/model/archivefile.py (+1/-1)
lib/lp/soyuz/model/archivejob.py (+4/-5)
lib/lp/soyuz/model/archivepermission.py (+3/-4)
lib/lp/soyuz/model/binaryandsourcepackagename.py (+1/-2)
lib/lp/soyuz/model/binarypackagebuildbehaviour.py (+1/-2)
lib/lp/soyuz/model/binarypackagename.py (+0/-1)
lib/lp/soyuz/model/binarypackagerelease.py (+2/-2)
lib/lp/soyuz/model/binarysourcereference.py (+1/-1)
lib/lp/soyuz/model/distributionjob.py (+2/-2)
lib/lp/soyuz/model/distroarchseriesfilter.py (+1/-1)
lib/lp/soyuz/model/initializedistroseriesjob.py (+3/-4)
lib/lp/soyuz/model/livefs.py (+1/-1)
lib/lp/soyuz/model/livefsbuild.py (+3/-3)
lib/lp/soyuz/model/livefsbuildbehaviour.py (+1/-2)
lib/lp/soyuz/model/packagecopyjob.py (+5/-5)
lib/lp/soyuz/model/packagediff.py (+1/-2)
lib/lp/soyuz/model/packageset.py (+2/-2)
lib/lp/soyuz/model/processacceptedbugsjob.py (+1/-1)
lib/lp/soyuz/model/publishing.py (+7/-8)
lib/lp/soyuz/model/queue.py (+4/-5)
lib/lp/soyuz/model/sourcepackagerelease.py (+1/-1)
lib/lp/soyuz/scripts/custom_uploads_copier.py (+1/-3)
lib/lp/soyuz/scripts/ftpmasterbase.py (+0/-2)
lib/lp/soyuz/scripts/gina/handlers.py (+1/-3)
lib/lp/soyuz/scripts/gina/runner.py (+1/-1)
lib/lp/soyuz/scripts/packagecopier.py (+1/-2)
lib/lp/soyuz/scripts/populate_archive.py (+1/-1)
lib/lp/soyuz/scripts/ppareport.py (+1/-1)
lib/lp/soyuz/scripts/retrydepwait.py (+1/-1)
lib/lp/soyuz/scripts/tests/test_copypackage.py (+16/-16)
lib/lp/soyuz/scripts/tests/test_expire_archive_files.py (+4/-4)
lib/lp/soyuz/scripts/tests/test_gina.py (+2/-2)
lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py (+80/-80)
lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py (+1/-1)
lib/lp/soyuz/scripts/tests/test_populatearchive.py (+8/-8)
lib/lp/soyuz/scripts/tests/test_ppa_apache_log_parser.py (+1/-1)
lib/lp/soyuz/scripts/tests/test_retrydepwait.py (+2/-2)
lib/lp/soyuz/tests/test_archive.py (+17/-18)
lib/lp/soyuz/tests/test_archive_subscriptions.py (+2/-2)
lib/lp/soyuz/tests/test_binaryandsourcepackagename.py (+1/-1)
lib/lp/soyuz/tests/test_binarypackagebuild.py (+6/-6)
lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py (+2/-2)
lib/lp/soyuz/tests/test_binarypackagename.py (+1/-1)
lib/lp/soyuz/tests/test_binarysourcereference.py (+1/-1)
lib/lp/soyuz/tests/test_build.py (+1/-1)
lib/lp/soyuz/tests/test_build_depwait.py (+1/-1)
lib/lp/soyuz/tests/test_build_notify.py (+1/-1)
lib/lp/soyuz/tests/test_build_privacy.py (+1/-1)
lib/lp/soyuz/tests/test_build_set.py (+5/-5)
lib/lp/soyuz/tests/test_build_start_estimation.py (+1/-1)
lib/lp/soyuz/tests/test_distributionsourcepackagerelease.py (+2/-2)
lib/lp/soyuz/tests/test_distroseriesbinarypackage.py (+1/-1)
lib/lp/soyuz/tests/test_distroseriesdifferencejob.py (+1/-1)
lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py (+1/-1)
lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py (+1/-1)
lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py (+2/-2)
lib/lp/soyuz/tests/test_distroseriesqueue_rosetta_translations.py (+1/-1)
lib/lp/soyuz/tests/test_hasbuildrecords.py (+7/-7)
lib/lp/soyuz/tests/test_livefs.py (+3/-3)
lib/lp/soyuz/tests/test_livefsbuild.py (+4/-4)
lib/lp/soyuz/tests/test_livefsbuildbehaviour.py (+1/-1)
lib/lp/soyuz/tests/test_packagecopyjob.py (+3/-3)
lib/lp/soyuz/tests/test_packageset.py (+5/-5)
lib/lp/soyuz/tests/test_packageupload.py (+4/-4)
lib/lp/soyuz/tests/test_processacceptedbugsjob.py (+3/-3)
lib/lp/soyuz/tests/test_publishing.py (+5/-5)
lib/lp/soyuz/tests/test_publishing_models.py (+1/-1)
lib/lp/soyuz/wsgi/tests/test_archiveauth.py (+1/-1)
lib/lp/soyuz/xmlrpc/tests/test_archive.py (+1/-1)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+413916@code.launchpad.net

Commit message

lp.soyuz: Apply "pyupgrade --py3-plus"

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Self-approving (mechanical).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
index c6458be..7b39f1f 100644
--- a/.git-blame-ignore-revs
+++ b/.git-blame-ignore-revs
@@ -42,3 +42,5 @@ fbed83f22424df8fa5647349493f78937a520db5
42f3f15787ebabe305fbf3e3ae6c0fd8ca7dfb446542f3f15787ebabe305fbf3e3ae6c0fd8ca7dfb4465
43# apply pyupgrade --py3-plus to lp.snappy43# apply pyupgrade --py3-plus to lp.snappy
442cda038936743a2f9271953c23b9fcc98968db63442cda038936743a2f9271953c23b9fcc98968db63
45# apply pyupgrade --py3-plus to lp.soyuz
4621fb5364d9371c0ad2edf41fa6920c4e16ead2b0
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index d70d934..d969ed2 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -56,6 +56,7 @@ repos:
56 |scripts56 |scripts
57 |services57 |services
58 |snappy58 |snappy
59 |soyuz
59 )/60 )/
60- repo: https://github.com/PyCQA/isort61- repo: https://github.com/PyCQA/isort
61 rev: 5.9.262 rev: 5.9.2
diff --git a/lib/lp/soyuz/adapters/overrides.py b/lib/lp/soyuz/adapters/overrides.py
index 3f93f64..f78c769 100644
--- a/lib/lp/soyuz/adapters/overrides.py
+++ b/lib/lp/soyuz/adapters/overrides.py
@@ -127,7 +127,7 @@ class BinaryOverride(Override):
127 def __init__(self, component=None, section=None, priority=None,127 def __init__(self, component=None, section=None, priority=None,
128 phased_update_percentage=None, version=None, new=None,128 phased_update_percentage=None, version=None, new=None,
129 source_override=None):129 source_override=None):
130 super(BinaryOverride, self).__init__(130 super().__init__(
131 component=component, section=section, version=version, new=new)131 component=component, section=section, version=version, new=new)
132 self.priority = priority132 self.priority = priority
133 self.phased_update_percentage = phased_update_percentage133 self.phased_update_percentage = phased_update_percentage
@@ -201,7 +201,7 @@ class BaseOverridePolicy:
201201
202 def __init__(self, archive, distroseries, pocket,202 def __init__(self, archive, distroseries, pocket,
203 phased_update_percentage=None):203 phased_update_percentage=None):
204 super(BaseOverridePolicy, self).__init__()204 super().__init__()
205 self.archive = archive205 self.archive = archive
206 self.distroseries = distroseries206 self.distroseries = distroseries
207 self.pocket = pocket207 self.pocket = pocket
@@ -226,7 +226,7 @@ class FromExistingOverridePolicy(BaseOverridePolicy):
226 def __init__(self, *args, **kwargs):226 def __init__(self, *args, **kwargs):
227 self.any_arch = kwargs.pop('any_arch', False)227 self.any_arch = kwargs.pop('any_arch', False)
228 self.include_deleted = kwargs.pop('include_deleted', False)228 self.include_deleted = kwargs.pop('include_deleted', False)
229 super(FromExistingOverridePolicy, self).__init__(*args, **kwargs)229 super().__init__(*args, **kwargs)
230230
231 def getExistingPublishingStatuses(self, include_deleted):231 def getExistingPublishingStatuses(self, include_deleted):
232 status = list(active_publishing_status)232 status = list(active_publishing_status)
diff --git a/lib/lp/soyuz/adapters/tests/test_archivedependencies.py b/lib/lp/soyuz/adapters/tests/test_archivedependencies.py
index a6374a5..5f49b53 100644
--- a/lib/lp/soyuz/adapters/tests/test_archivedependencies.py
+++ b/lib/lp/soyuz/adapters/tests/test_archivedependencies.py
@@ -139,7 +139,7 @@ class TestSourcesList(TestCaseWithFactory):
139 }139 }
140140
141 def setUp(self):141 def setUp(self):
142 super(TestSourcesList, self).setUp()142 super().setUp()
143 self.publisher = SoyuzTestPublisher()143 self.publisher = SoyuzTestPublisher()
144 self.ubuntu = getUtility(IDistributionSet).getByName("ubuntu")144 self.ubuntu = getUtility(IDistributionSet).getByName("ubuntu")
145 self.hoary = self.ubuntu.getSeries("hoary")145 self.hoary = self.ubuntu.getSeries("hoary")
diff --git a/lib/lp/soyuz/adapters/tests/test_buildarch.py b/lib/lp/soyuz/adapters/tests/test_buildarch.py
index 1427127..50d7bc3 100644
--- a/lib/lp/soyuz/adapters/tests/test_buildarch.py
+++ b/lib/lp/soyuz/adapters/tests/test_buildarch.py
@@ -17,7 +17,7 @@ from lp.testing.fixture import CaptureTimeline
17class TestDpkgArchitectureCache(TestCase):17class TestDpkgArchitectureCache(TestCase):
1818
19 def setUp(self):19 def setUp(self):
20 super(TestDpkgArchitectureCache, self).setUp()20 super().setUp()
21 self.timeline = self.useFixture(CaptureTimeline()).timeline21 self.timeline = self.useFixture(CaptureTimeline()).timeline
2222
23 def assertTimeline(self, expected_details):23 def assertTimeline(self, expected_details):
diff --git a/lib/lp/soyuz/adapters/tests/test_packagelocation.py b/lib/lp/soyuz/adapters/tests/test_packagelocation.py
index 62ac744..3d45f14 100644
--- a/lib/lp/soyuz/adapters/tests/test_packagelocation.py
+++ b/lib/lp/soyuz/adapters/tests/test_packagelocation.py
@@ -84,8 +84,8 @@ class TestPackageLocation(TestCaseWithFactory):
84 self.assertEqual([], location.packagesets)84 self.assertEqual([], location.packagesets)
8585
86 def testSetupLocationWithPackagesets(self):86 def testSetupLocationWithPackagesets(self):
87 packageset_name1 = u"foo-packageset"87 packageset_name1 = "foo-packageset"
88 packageset_name2 = u"bar-packageset"88 packageset_name2 = "bar-packageset"
89 packageset1 = self.factory.makePackageset(name=packageset_name1)89 packageset1 = self.factory.makePackageset(name=packageset_name1)
90 packageset2 = self.factory.makePackageset(name=packageset_name2)90 packageset2 = self.factory.makePackageset(name=packageset_name2)
91 location = self.getPackageLocation(91 location = self.getPackageLocation(
@@ -138,17 +138,17 @@ class TestPackageLocation(TestCaseWithFactory):
138 PackageLocationError,138 PackageLocationError,
139 self.getPackageLocation,139 self.getPackageLocation,
140 distribution_name='debian',140 distribution_name='debian',
141 packageset_names=[u"unknown"])141 packageset_names=["unknown"])
142142
143 def test_build_package_location_when_one_packageset_unknown(self):143 def test_build_package_location_when_one_packageset_unknown(self):
144 """Test that with one of two packagesets unknown."""144 """Test that with one of two packagesets unknown."""
145 packageset_name = u"foo-packageset"145 packageset_name = "foo-packageset"
146 self.factory.makePackageset(name=packageset_name)146 self.factory.makePackageset(name=packageset_name)
147 self.assertRaises(147 self.assertRaises(
148 PackageLocationError,148 PackageLocationError,
149 self.getPackageLocation,149 self.getPackageLocation,
150 distribution_name='debian',150 distribution_name='debian',
151 packageset_names=[packageset_name, u"unknown"])151 packageset_names=[packageset_name, "unknown"])
152152
153 def testSetupLocationPPANotMatchingDistribution(self):153 def testSetupLocationPPANotMatchingDistribution(self):
154 """`PackageLocationError` is raised when PPA does not match the154 """`PackageLocationError` is raised when PPA does not match the
@@ -247,9 +247,9 @@ class TestPackageLocation(TestCaseWithFactory):
247 self.assertEqual(247 self.assertEqual(
248 str(location_ubuntu_partner), 'ubuntu/partner: hoary-RELEASE')248 str(location_ubuntu_partner), 'ubuntu/partner: hoary-RELEASE')
249249
250 self.factory.makePackageset(name=u"foo-packageset")250 self.factory.makePackageset(name="foo-packageset")
251 location_ubuntu_packageset = self.getPackageLocation(251 location_ubuntu_packageset = self.getPackageLocation(
252 packageset_names=[u"foo-packageset"])252 packageset_names=["foo-packageset"])
253 self.assertEqual(253 self.assertEqual(
254 str(location_ubuntu_packageset),254 str(location_ubuntu_packageset),
255 'ubuntu: hoary-RELEASE [foo-packageset]')255 'ubuntu: hoary-RELEASE [foo-packageset]')
diff --git a/lib/lp/soyuz/browser/archive.py b/lib/lp/soyuz/browser/archive.py
index 05066a0..90c5b6e 100644
--- a/lib/lp/soyuz/browser/archive.py
+++ b/lib/lp/soyuz/browser/archive.py
@@ -218,7 +218,7 @@ class DistributionArchiveURL:
218218
219 @property219 @property
220 def path(self):220 def path(self):
221 return u"+archive/%s" % self.context.name221 return "+archive/%s" % self.context.name
222222
223223
224@implementer(ICanonicalUrlData)224@implementer(ICanonicalUrlData)
@@ -235,7 +235,7 @@ class PPAURL:
235235
236 @property236 @property
237 def path(self):237 def path(self):
238 return u"+archive/%s/%s" % (238 return "+archive/%s/%s" % (
239 self.context.distribution.name, self.context.name)239 self.context.distribution.name, self.context.name)
240240
241241
@@ -651,7 +651,7 @@ class ArchiveViewBase(LaunchpadView, SourcesListEntriesWidget):
651 " Since this archive is private, no builds are "651 " Since this archive is private, no builds are "
652 "being dispatched.")652 "being dispatched.")
653 self.request.response.addNotification(structured(notification))653 self.request.response.addNotification(structured(notification))
654 super(ArchiveViewBase, self).initialize()654 super().initialize()
655 # Set properties for SourcesListEntriesWidget.655 # Set properties for SourcesListEntriesWidget.
656 self.archive = self.context656 self.archive = self.context
657 self.sources_list_user = self.user657 self.sources_list_user = self.user
@@ -948,7 +948,7 @@ class ArchiveView(ArchiveSourcePackageListViewBase):
948 self.request.response.redirect(948 self.request.response.redirect(
949 canonical_url(self.context.distribution))949 canonical_url(self.context.distribution))
950 return950 return
951 super(ArchiveView, self).initialize()951 super().initialize()
952952
953 @property953 @property
954 def displayname_edit_widget(self):954 def displayname_edit_widget(self):
@@ -1150,7 +1150,7 @@ class ArchiveSourceSelectionFormView(ArchiveSourcePackageListViewBase):
1150 # batched_sources) but this itself requires the current values of1150 # batched_sources) but this itself requires the current values of
1151 # the filtering widgets. So we setup the widgets, then add the1151 # the filtering widgets. So we setup the widgets, then add the
1152 # extra field and create its widget too.1152 # extra field and create its widget too.
1153 super(ArchiveSourceSelectionFormView, self).setUpWidgets()1153 super().setUpWidgets()
11541154
1155 self.form_fields += self.createSelectedSourcesField()1155 self.form_fields += self.createSelectedSourcesField()
11561156
@@ -2116,12 +2116,12 @@ class ArchiveEditView(BaseArchiveEditView, EnableProcessorsMixin):
21162116
2117 See `createEnabledProcessors` method.2117 See `createEnabledProcessors` method.
2118 """2118 """
2119 super(ArchiveEditView, self).setUpFields()2119 super().setUpFields()
2120 self.form_fields += self.createEnabledProcessors(2120 self.form_fields += self.createEnabledProcessors(
2121 self.context.available_processors,2121 self.context.available_processors,
2122 u"The architectures on which the archive can build. Some "2122 "The architectures on which the archive can build. Some "
2123 u"architectures are restricted and may only be enabled or "2123 "architectures are restricted and may only be enabled or "
2124 u"disabled by administrators.")2124 "disabled by administrators.")
21252125
2126 def validate(self, data):2126 def validate(self, data):
2127 if 'processors' in data:2127 if 'processors' in data:
@@ -2161,7 +2161,7 @@ class ArchiveAdminView(BaseArchiveEditView, EnableProcessorsMixin):
21612161
2162 def validate_save(self, action, data):2162 def validate_save(self, action, data):
2163 """Validate the save action on ArchiveAdminView."""2163 """Validate the save action on ArchiveAdminView."""
2164 super(ArchiveAdminView, self).validate_save(action, data)2164 super().validate_save(action, data)
21652165
2166 if data.get('private') != self.context.private:2166 if data.get('private') != self.context.private:
2167 # The privacy is being switched.2167 # The privacy is being switched.
diff --git a/lib/lp/soyuz/browser/archivepermission.py b/lib/lp/soyuz/browser/archivepermission.py
index 4459fc1..dde0672 100644
--- a/lib/lp/soyuz/browser/archivepermission.py
+++ b/lib/lp/soyuz/browser/archivepermission.py
@@ -56,4 +56,4 @@ class ArchivePermissionURL:
56 "One of component, sourcepackagename or package set should "56 "One of component, sourcepackagename or package set should "
57 "be set")57 "be set")
5858
59 return u"%s/%s?%s" % (perm_type, username, item)59 return "%s/%s?%s" % (perm_type, username, item)
diff --git a/lib/lp/soyuz/browser/archivesubscription.py b/lib/lp/soyuz/browser/archivesubscription.py
index 24059a3..8cff69b 100644
--- a/lib/lp/soyuz/browser/archivesubscription.py
+++ b/lib/lp/soyuz/browser/archivesubscription.py
@@ -149,7 +149,7 @@ class ArchiveSubscribersView(LaunchpadFormView):
149 canonical_url(self.context))149 canonical_url(self.context))
150 return150 return
151151
152 super(ArchiveSubscribersView, self).initialize()152 super().initialize()
153 subscription_set = getUtility(IArchiveSubscriberSet)153 subscription_set = getUtility(IArchiveSubscriberSet)
154 self.subscriptions = subscription_set.getByArchive(self.context)154 self.subscriptions = subscription_set.getByArchive(self.context)
155 self.batchnav = BatchNavigator(155 self.batchnav = BatchNavigator(
@@ -207,7 +207,7 @@ class ArchiveSubscribersView(LaunchpadFormView):
207 self.setFieldError('date_expires',207 self.setFieldError('date_expires',
208 "The expiry date must be in the future.")208 "The expiry date must be in the future.")
209209
210 @action(u"Add", name="add",210 @action("Add", name="add",
211 validator="validate_new_subscription")211 validator="validate_new_subscription")
212 def create_subscription(self, action, data):212 def create_subscription(self, action, data):
213 """Create a subscription for the supplied user."""213 """Create a subscription for the supplied user."""
@@ -272,7 +272,7 @@ class ArchiveSubscriptionEditView(LaunchpadEditFormView):
272 "The expiry date must be in the future.")272 "The expiry date must be in the future.")
273273
274 @action(274 @action(
275 u'Save', name='update', validator="validate_update_subscription")275 'Save', name='update', validator="validate_update_subscription")
276 def update_subscription(self, action, data):276 def update_subscription(self, action, data):
277 """Update the context subscription with the new data."""277 """Update the context subscription with the new data."""
278 # As we present a date selection to the user for expiry, we278 # As we present a date selection to the user for expiry, we
@@ -292,7 +292,7 @@ class ArchiveSubscriptionEditView(LaunchpadEditFormView):
292 self.context.subscriber.displayname)292 self.context.subscriber.displayname)
293 self.request.response.addNotification(notification)293 self.request.response.addNotification(notification)
294294
295 @action(u'Revoke access', name='cancel')295 @action('Revoke access', name='cancel')
296 def cancel_subscription(self, action, data):296 def cancel_subscription(self, action, data):
297 """Cancel the context subscription."""297 """Cancel the context subscription."""
298 self.context.cancel(self.user)298 self.context.cancel(self.user)
@@ -371,7 +371,7 @@ class PersonArchiveSubscriptionView(LaunchpadView, SourcesListEntriesWidget):
371371
372 def initialize(self):372 def initialize(self):
373 """Process any posted actions."""373 """Process any posted actions."""
374 super(PersonArchiveSubscriptionView, self).initialize()374 super().initialize()
375 # Set properties for SourcesListEntriesWidget.375 # Set properties for SourcesListEntriesWidget.
376 self.archive = self.context.archive376 self.archive = self.context.archive
377 self.sources_list_user = self.context.subscriber377 self.sources_list_user = self.context.subscriber
diff --git a/lib/lp/soyuz/browser/build.py b/lib/lp/soyuz/browser/build.py
index e997277..2ff61ac 100644
--- a/lib/lp/soyuz/browser/build.py
+++ b/lib/lp/soyuz/browser/build.py
@@ -121,7 +121,7 @@ class BuildUrl:
121121
122 @property122 @property
123 def path(self):123 def path(self):
124 return u"+build/%d" % self.context.id124 return "+build/%d" % self.context.id
125125
126126
127class BuildNavigation(GetitemNavigation, FileNavigationMixin):127class BuildNavigation(GetitemNavigation, FileNavigationMixin):
diff --git a/lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py b/lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py
index 6cae515..335d278 100644
--- a/lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py
+++ b/lib/lp/soyuz/browser/distroarchseriesbinarypackagerelease.py
@@ -45,5 +45,5 @@ class DistroArchSeriesBinaryPackageReleaseView(LaunchpadView):
45 def phased_update_percentage(self):45 def phased_update_percentage(self):
46 """Return the formatted phased update percentage, or empty."""46 """Return the formatted phased update percentage, or empty."""
47 if self.context.phased_update_percentage is not None:47 if self.context.phased_update_percentage is not None:
48 return u"%d%% of users" % self.context.phased_update_percentage48 return "%d%% of users" % self.context.phased_update_percentage
49 return u""49 return ""
diff --git a/lib/lp/soyuz/browser/livefs.py b/lib/lp/soyuz/browser/livefs.py
index ebfc41f..5409eea 100644
--- a/lib/lp/soyuz/browser/livefs.py
+++ b/lib/lp/soyuz/browser/livefs.py
@@ -191,12 +191,12 @@ class ILiveFSEditSchema(Interface):
191 'keep_binary_files_days',191 'keep_binary_files_days',
192 ])192 ])
193 distro_series = Choice(193 distro_series = Choice(
194 vocabulary='BuildableDistroSeries', title=u'Distribution series')194 vocabulary='BuildableDistroSeries', title='Distribution series')
195 metadata = Text(195 metadata = Text(
196 title=u'Live filesystem build metadata',196 title='Live filesystem build metadata',
197 description=(197 description=(
198 u'A JSON dictionary of data about the image. Entries here will '198 'A JSON dictionary of data about the image. Entries here will '
199 'be passed to the builder.'))199 'be passed to the builder.'))
200200
201201
202class LiveFSMetadataValidatorMixin:202class LiveFSMetadataValidatorMixin:
@@ -223,7 +223,7 @@ class LiveFSAddView(LiveFSMetadataValidatorMixin, LaunchpadFormView):
223 """See `LaunchpadView`."""223 """See `LaunchpadView`."""
224 if not getFeatureFlag(LIVEFS_FEATURE_FLAG):224 if not getFeatureFlag(LIVEFS_FEATURE_FLAG):
225 raise LiveFSFeatureDisabled225 raise LiveFSFeatureDisabled
226 super(LiveFSAddView, self).initialize()226 super().initialize()
227227
228 @property228 @property
229 def initial_values(self):229 def initial_values(self):
@@ -249,7 +249,7 @@ class LiveFSAddView(LiveFSMetadataValidatorMixin, LaunchpadFormView):
249 self.next_url = canonical_url(livefs)249 self.next_url = canonical_url(livefs)
250250
251 def validate(self, data):251 def validate(self, data):
252 super(LiveFSAddView, self).validate(data)252 super().validate(data)
253 owner = data.get('owner', None)253 owner = data.get('owner', None)
254 distro_series = data['distro_series']254 distro_series = data['distro_series']
255 name = data.get('name', None)255 name = data.get('name', None)
@@ -330,11 +330,11 @@ class LiveFSEditView(LiveFSMetadataValidatorMixin, BaseLiveFSEditView):
330 """See `LaunchpadEditFormView`."""330 """See `LaunchpadEditFormView`."""
331 if 'metadata' in data:331 if 'metadata' in data:
332 data['metadata'] = json.loads(data['metadata'])332 data['metadata'] = json.loads(data['metadata'])
333 super(LiveFSEditView, self).updateContextFromData(333 super().updateContextFromData(
334 data, context=context, notify_modified=notify_modified)334 data, context=context, notify_modified=notify_modified)
335335
336 def validate(self, data):336 def validate(self, data):
337 super(LiveFSEditView, self).validate(data)337 super().validate(data)
338 owner = data.get('owner', None)338 owner = data.get('owner', None)
339 distro_series = data['distro_series']339 distro_series = data['distro_series']
340 name = data.get('name', None)340 name = data.get('name', None)
diff --git a/lib/lp/soyuz/browser/livefsbuild.py b/lib/lp/soyuz/browser/livefsbuild.py
index f4b1d93..78c4f1f 100644
--- a/lib/lp/soyuz/browser/livefsbuild.py
+++ b/lib/lp/soyuz/browser/livefsbuild.py
@@ -150,7 +150,7 @@ class LiveFSBuildRescoreView(LaunchpadFormView):
150150
151 def __call__(self):151 def __call__(self):
152 if self.context.can_be_rescored:152 if self.context.can_be_rescored:
153 return super(LiveFSBuildRescoreView, self).__call__()153 return super().__call__()
154 self.request.response.addWarningNotification(154 self.request.response.addWarningNotification(
155 "Cannot rescore this build because it is not queued.")155 "Cannot rescore this build because it is not queued.")
156 self.request.response.redirect(canonical_url(self.context))156 self.request.response.redirect(canonical_url(self.context))
diff --git a/lib/lp/soyuz/browser/packagerelationship.py b/lib/lp/soyuz/browser/packagerelationship.py
index 9816d03..8123efc 100644
--- a/lib/lp/soyuz/browser/packagerelationship.py
+++ b/lib/lp/soyuz/browser/packagerelationship.py
@@ -44,8 +44,8 @@ def relationship_builder(relationship_line, getter):
44 else:44 else:
45 url = None45 url = None
46 if rel['version'] is None:46 if rel['version'] is None:
47 operator = u''47 operator = ''
48 version = u''48 version = ''
49 else:49 else:
50 operator, version = rel['version']50 operator, version = rel['version']
51 relationship_set.add(name, operator, version, url)51 relationship_set.add(name, operator, version, url)
diff --git a/lib/lp/soyuz/browser/publishing.py b/lib/lp/soyuz/browser/publishing.py
index 86bbb19..a6d16c5 100644
--- a/lib/lp/soyuz/browser/publishing.py
+++ b/lib/lp/soyuz/browser/publishing.py
@@ -58,14 +58,14 @@ class SourcePublicationURL(PublicationURLBase):
58 """Dynamic URL declaration for `ISourcePackagePublishingHistory`"""58 """Dynamic URL declaration for `ISourcePackagePublishingHistory`"""
59 @property59 @property
60 def path(self):60 def path(self):
61 return u"+sourcepub/%s" % self.context.id61 return "+sourcepub/%s" % self.context.id
6262
6363
64class BinaryPublicationURL(PublicationURLBase):64class BinaryPublicationURL(PublicationURLBase):
65 """Dynamic URL declaration for `IBinaryPackagePublishingHistory`"""65 """Dynamic URL declaration for `IBinaryPackagePublishingHistory`"""
66 @property66 @property
67 def path(self):67 def path(self):
68 return u"+binarypub/%s" % self.context.id68 return "+binarypub/%s" % self.context.id
6969
7070
71class SourcePackagePublishingHistoryNavigation(Navigation,71class SourcePackagePublishingHistoryNavigation(Navigation,
@@ -188,7 +188,7 @@ class BasePublishingRecordView(LaunchpadView):
188 """Return the removal comment or 'None provided'."""188 """Return the removal comment or 'None provided'."""
189 removal_comment = self.context.removal_comment189 removal_comment = self.context.removal_comment
190 if removal_comment is None or not removal_comment.strip():190 if removal_comment is None or not removal_comment.strip():
191 removal_comment = u'None provided.'191 removal_comment = 'None provided.'
192192
193 return removal_comment193 return removal_comment
194194
@@ -197,8 +197,8 @@ class BasePublishingRecordView(LaunchpadView):
197 """Return the formatted phased update percentage, or empty."""197 """Return the formatted phased update percentage, or empty."""
198 if (self.is_binary and198 if (self.is_binary and
199 self.context.phased_update_percentage is not None):199 self.context.phased_update_percentage is not None):
200 return u"%d%% of users" % self.context.phased_update_percentage200 return "%d%% of users" % self.context.phased_update_percentage
201 return u""201 return ""
202202
203 @property203 @property
204 def linkify_copied_from_archive(self):204 def linkify_copied_from_archive(self):
diff --git a/lib/lp/soyuz/browser/sourceslist.py b/lib/lp/soyuz/browser/sourceslist.py
index 29697aa..6a63a44 100644
--- a/lib/lp/soyuz/browser/sourceslist.py
+++ b/lib/lp/soyuz/browser/sourceslist.py
@@ -41,7 +41,7 @@ class SourcesListEntriesView(LaunchpadView):
41 comment=None):41 comment=None):
42 self._initially_without_selection = initially_without_selection42 self._initially_without_selection = initially_without_selection
43 self.comment = comment43 self.comment = comment
44 super(SourcesListEntriesView, self).__init__(context, request)44 super().__init__(context, request)
4545
46 def initialize(self):46 def initialize(self):
47 self.terms = []47 self.terms = []
diff --git a/lib/lp/soyuz/browser/tests/test_archive.py b/lib/lp/soyuz/browser/tests/test_archive.py
index 9ed6c08..07e8614 100644
--- a/lib/lp/soyuz/browser/tests/test_archive.py
+++ b/lib/lp/soyuz/browser/tests/test_archive.py
@@ -58,7 +58,7 @@ class TestArchiveEditView(TestCaseWithFactory):
58 layer = LaunchpadFunctionalLayer58 layer = LaunchpadFunctionalLayer
5959
60 def setUp(self):60 def setUp(self):
61 super(TestArchiveEditView, self).setUp()61 super().setUp()
62 # None of the Ubuntu series in sampledata have amd64. Add it to62 # None of the Ubuntu series in sampledata have amd64. Add it to
63 # breezy so that it shows up in the list of available processors.63 # breezy so that it shows up in the list of available processors.
64 self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu64 self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
diff --git a/lib/lp/soyuz/browser/tests/test_archive_admin_view.py b/lib/lp/soyuz/browser/tests/test_archive_admin_view.py
index aecf106..7a2abdf 100644
--- a/lib/lp/soyuz/browser/tests/test_archive_admin_view.py
+++ b/lib/lp/soyuz/browser/tests/test_archive_admin_view.py
@@ -17,7 +17,7 @@ class TestArchivePrivacySwitchingView(TestCaseWithFactory):
1717
18 def setUp(self):18 def setUp(self):
19 """Create a ppa for the tests and login as an admin."""19 """Create a ppa for the tests and login as an admin."""
20 super(TestArchivePrivacySwitchingView, self).setUp()20 super().setUp()
21 self.ppa = self.factory.makeArchive()21 self.ppa = self.factory.makeArchive()
22 # Login as an admin to ensure access to the view's context22 # Login as an admin to ensure access to the view's context
23 # object.23 # object.
diff --git a/lib/lp/soyuz/browser/tests/test_archive_packages.py b/lib/lp/soyuz/browser/tests/test_archive_packages.py
index db5f7e2..ea6d517 100644
--- a/lib/lp/soyuz/browser/tests/test_archive_packages.py
+++ b/lib/lp/soyuz/browser/tests/test_archive_packages.py
@@ -54,7 +54,7 @@ class TestP3APackages(TestCaseWithFactory):
54 layer = LaunchpadFunctionalLayer54 layer = LaunchpadFunctionalLayer
5555
56 def setUp(self):56 def setUp(self):
57 super(TestP3APackages, self).setUp()57 super().setUp()
58 self.private_ppa = self.factory.makeArchive(description='Foo')58 self.private_ppa = self.factory.makeArchive(description='Foo')
59 login('admin@canonical.com')59 login('admin@canonical.com')
60 self.private_ppa.private = True60 self.private_ppa.private = True
@@ -333,7 +333,7 @@ class TestPPAPackagesJobNotifications(TestCaseWithFactory):
333 layer = LaunchpadFunctionalLayer333 layer = LaunchpadFunctionalLayer
334334
335 def setUp(self):335 def setUp(self):
336 super(TestPPAPackagesJobNotifications, self).setUp()336 super().setUp()
337 self.ws_version = 'devel'337 self.ws_version = 'devel'
338 self.person = self.factory.makePerson()338 self.person = self.factory.makePerson()
339 self.archive = self.factory.makeArchive(owner=self.person)339 self.archive = self.factory.makeArchive(owner=self.person)
@@ -494,7 +494,7 @@ class TestP3APackagesQueryCount(TestCaseWithFactory):
494 layer = DatabaseFunctionalLayer494 layer = DatabaseFunctionalLayer
495495
496 def setUp(self):496 def setUp(self):
497 super(TestP3APackagesQueryCount, self).setUp()497 super().setUp()
498 self.team = self.factory.makeTeam()498 self.team = self.factory.makeTeam()
499 login_person(self.team.teamowner)499 login_person(self.team.teamowner)
500 self.person = self.factory.makePerson()500 self.person = self.factory.makePerson()
diff --git a/lib/lp/soyuz/browser/tests/test_archive_webservice.py b/lib/lp/soyuz/browser/tests/test_archive_webservice.py
index 87a33a2..352b346 100644
--- a/lib/lp/soyuz/browser/tests/test_archive_webservice.py
+++ b/lib/lp/soyuz/browser/tests/test_archive_webservice.py
@@ -49,7 +49,7 @@ class TestArchiveWebservice(TestCaseWithFactory):
49 layer = DatabaseFunctionalLayer49 layer = DatabaseFunctionalLayer
5050
51 def setUp(self):51 def setUp(self):
52 super(TestArchiveWebservice, self).setUp()52 super().setUp()
53 with admin_logged_in() as _admin:53 with admin_logged_in() as _admin:
54 admin = _admin54 admin = _admin
55 self.archive = self.factory.makeArchive(55 self.archive = self.factory.makeArchive(
@@ -682,7 +682,7 @@ class TestGetPublishedBinaries(TestCaseWithFactory):
682 layer = DatabaseFunctionalLayer682 layer = DatabaseFunctionalLayer
683683
684 def setUp(self):684 def setUp(self):
685 super(TestGetPublishedBinaries, self).setUp()685 super().setUp()
686 self.person = self.factory.makePerson()686 self.person = self.factory.makePerson()
687 self.archive = self.factory.makeArchive()687 self.archive = self.factory.makeArchive()
688 self.person_url = api_url(self.person)688 self.person_url = api_url(self.person)
@@ -817,7 +817,7 @@ class TestRemoveCopyNotification(TestCaseWithFactory):
817 layer = DatabaseFunctionalLayer817 layer = DatabaseFunctionalLayer
818818
819 def setUp(self):819 def setUp(self):
820 super(TestRemoveCopyNotification, self).setUp()820 super().setUp()
821 self.person = self.factory.makePerson()821 self.person = self.factory.makePerson()
822 self.archive = self.factory.makeArchive(owner=self.person)822 self.archive = self.factory.makeArchive(owner=self.person)
823 self.archive_url = api_url(self.archive)823 self.archive_url = api_url(self.archive)
diff --git a/lib/lp/soyuz/browser/tests/test_archivesubscription.py b/lib/lp/soyuz/browser/tests/test_archivesubscription.py
index 24ecb0f..31daf54 100644
--- a/lib/lp/soyuz/browser/tests/test_archivesubscription.py
+++ b/lib/lp/soyuz/browser/tests/test_archivesubscription.py
@@ -29,7 +29,7 @@ class TestArchiveSubscribersView(TestCaseWithFactory):
29 layer = LaunchpadFunctionalLayer29 layer = LaunchpadFunctionalLayer
3030
31 def setUp(self):31 def setUp(self):
32 super(TestArchiveSubscribersView, self).setUp()32 super().setUp()
33 self.p3a_owner = self.factory.makePerson()33 self.p3a_owner = self.factory.makePerson()
34 admin = getUtility(IPersonSet).getByEmail('admin@canonical.com')34 admin = getUtility(IPersonSet).getByEmail('admin@canonical.com')
35 with person_logged_in(admin):35 with person_logged_in(admin):
diff --git a/lib/lp/soyuz/browser/tests/test_breadcrumbs.py b/lib/lp/soyuz/browser/tests/test_breadcrumbs.py
index c3c1789..23875f3 100644
--- a/lib/lp/soyuz/browser/tests/test_breadcrumbs.py
+++ b/lib/lp/soyuz/browser/tests/test_breadcrumbs.py
@@ -16,7 +16,7 @@ from lp.testing.breadcrumbs import BaseBreadcrumbTestCase
16class TestDistroArchSeriesBreadcrumb(BaseBreadcrumbTestCase):16class TestDistroArchSeriesBreadcrumb(BaseBreadcrumbTestCase):
1717
18 def setUp(self):18 def setUp(self):
19 super(TestDistroArchSeriesBreadcrumb, self).setUp()19 super().setUp()
20 self.ubuntu = getUtility(IDistributionSet).getByName('ubuntu')20 self.ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
21 self.hoary = self.ubuntu.getSeries('hoary')21 self.hoary = self.ubuntu.getSeries('hoary')
22 self.hoary_i386 = self.hoary['i386']22 self.hoary_i386 = self.hoary['i386']
@@ -46,7 +46,7 @@ class TestDistroArchSeriesBreadcrumb(BaseBreadcrumbTestCase):
46class TestArchiveSubscriptionBreadcrumb(BaseBreadcrumbTestCase):46class TestArchiveSubscriptionBreadcrumb(BaseBreadcrumbTestCase):
4747
48 def setUp(self):48 def setUp(self):
49 super(TestArchiveSubscriptionBreadcrumb, self).setUp()49 super().setUp()
5050
51 # Create a private ppa51 # Create a private ppa
52 self.ppa = self.factory.makeArchive()52 self.ppa = self.factory.makeArchive()
diff --git a/lib/lp/soyuz/browser/tests/test_build_views.py b/lib/lp/soyuz/browser/tests/test_build_views.py
index 02bb4a1..477a9f6 100644
--- a/lib/lp/soyuz/browser/tests/test_build_views.py
+++ b/lib/lp/soyuz/browser/tests/test_build_views.py
@@ -45,7 +45,7 @@ class TestBuildViews(TestCaseWithFactory):
45 layer = LaunchpadFunctionalLayer45 layer = LaunchpadFunctionalLayer
4646
47 def setUp(self):47 def setUp(self):
48 super(TestBuildViews, self).setUp()48 super().setUp()
49 self.empty_request = LaunchpadTestRequest(form={})49 self.empty_request = LaunchpadTestRequest(form={})
50 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)50 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
5151
diff --git a/lib/lp/soyuz/browser/tests/test_distributionsourcepackagerelease.py b/lib/lp/soyuz/browser/tests/test_distributionsourcepackagerelease.py
index c33246e..e02d995 100644
--- a/lib/lp/soyuz/browser/tests/test_distributionsourcepackagerelease.py
+++ b/lib/lp/soyuz/browser/tests/test_distributionsourcepackagerelease.py
@@ -66,7 +66,7 @@ class TestDistributionSourcePackageReleaseFiles(TestCaseWithFactory):
66 layer = LaunchpadFunctionalLayer66 layer = LaunchpadFunctionalLayer
6767
68 def setUp(self):68 def setUp(self):
69 super(TestDistributionSourcePackageReleaseFiles, self).setUp()69 super().setUp()
70 # SourcePackageRelease itself is contextless, so wrap it in DSPR70 # SourcePackageRelease itself is contextless, so wrap it in DSPR
71 # to give it a URL.71 # to give it a URL.
72 spr = self.factory.makeSourcePackageRelease()72 spr = self.factory.makeSourcePackageRelease()
diff --git a/lib/lp/soyuz/browser/tests/test_distroarchseries_view.py b/lib/lp/soyuz/browser/tests/test_distroarchseries_view.py
index 4357b71..0e5237b 100644
--- a/lib/lp/soyuz/browser/tests/test_distroarchseries_view.py
+++ b/lib/lp/soyuz/browser/tests/test_distroarchseries_view.py
@@ -17,7 +17,7 @@ class TestDistroArchSeriesView(TestCaseWithFactory):
1717
18 def setUp(self):18 def setUp(self):
19 """Create a distroarchseries for the tests and login as an admin."""19 """Create a distroarchseries for the tests and login as an admin."""
20 super(TestDistroArchSeriesView, self).setUp()20 super().setUp()
21 self.das = self.factory.makeDistroArchSeries()21 self.das = self.factory.makeDistroArchSeries()
22 # Login as an admin to ensure access to the view's context22 # Login as an admin to ensure access to the view's context
23 # object.23 # object.
diff --git a/lib/lp/soyuz/browser/tests/test_distrosourcepackagerelease.py b/lib/lp/soyuz/browser/tests/test_distrosourcepackagerelease.py
index b903fef..e80f847 100644
--- a/lib/lp/soyuz/browser/tests/test_distrosourcepackagerelease.py
+++ b/lib/lp/soyuz/browser/tests/test_distrosourcepackagerelease.py
@@ -21,7 +21,7 @@ class TestDistroSourcePackageReleaseFiles(TestCaseWithFactory):
21 layer = LaunchpadFunctionalLayer21 layer = LaunchpadFunctionalLayer
2222
23 def setUp(self):23 def setUp(self):
24 super(TestDistroSourcePackageReleaseFiles, self).setUp()24 super().setUp()
25 # The package must be published for the page to render.25 # The package must be published for the page to render.
26 stp = SoyuzTestPublisher()26 stp = SoyuzTestPublisher()
27 distroseries = stp.setUpDefaultDistroSeries()27 distroseries = stp.setUpDefaultDistroSeries()
diff --git a/lib/lp/soyuz/browser/tests/test_livefs.py b/lib/lp/soyuz/browser/tests/test_livefs.py
index af61b1e..26a020e 100644
--- a/lib/lp/soyuz/browser/tests/test_livefs.py
+++ b/lib/lp/soyuz/browser/tests/test_livefs.py
@@ -66,7 +66,7 @@ class TestLiveFSNavigation(TestCaseWithFactory):
66 layer = DatabaseFunctionalLayer66 layer = DatabaseFunctionalLayer
6767
68 def setUp(self):68 def setUp(self):
69 super(TestLiveFSNavigation, self).setUp()69 super().setUp()
70 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))70 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))
7171
72 def test_canonical_url(self):72 def test_canonical_url(self):
@@ -138,7 +138,7 @@ class TestLiveFSAddView(BrowserTestCase):
138 layer = DatabaseFunctionalLayer138 layer = DatabaseFunctionalLayer
139139
140 def setUp(self):140 def setUp(self):
141 super(TestLiveFSAddView, self).setUp()141 super().setUp()
142 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))142 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))
143 self.useFixture(FakeLogger())143 self.useFixture(FakeLogger())
144 self.person = self.factory.makePerson(144 self.person = self.factory.makePerson(
@@ -217,7 +217,7 @@ class TestLiveFSAdminView(BrowserTestCase):
217 layer = DatabaseFunctionalLayer217 layer = DatabaseFunctionalLayer
218218
219 def setUp(self):219 def setUp(self):
220 super(TestLiveFSAdminView, self).setUp()220 super().setUp()
221 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))221 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))
222 self.useFixture(FakeLogger())222 self.useFixture(FakeLogger())
223 self.person = self.factory.makePerson(223 self.person = self.factory.makePerson(
@@ -272,7 +272,7 @@ class TestLiveFSEditView(BrowserTestCase):
272 layer = DatabaseFunctionalLayer272 layer = DatabaseFunctionalLayer
273273
274 def setUp(self):274 def setUp(self):
275 super(TestLiveFSEditView, self).setUp()275 super().setUp()
276 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))276 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))
277 self.useFixture(FakeLogger())277 self.useFixture(FakeLogger())
278 self.person = self.factory.makePerson(278 self.person = self.factory.makePerson(
@@ -352,7 +352,7 @@ class TestLiveFSDeleteView(BrowserTestCase):
352 layer = LaunchpadFunctionalLayer352 layer = LaunchpadFunctionalLayer
353353
354 def setUp(self):354 def setUp(self):
355 super(TestLiveFSDeleteView, self).setUp()355 super().setUp()
356 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))356 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))
357 self.person = self.factory.makePerson(357 self.person = self.factory.makePerson(
358 name="test-person", displayname="Test Person")358 name="test-person", displayname="Test Person")
@@ -402,7 +402,7 @@ class TestLiveFSView(BrowserTestCase):
402 layer = LaunchpadFunctionalLayer402 layer = LaunchpadFunctionalLayer
403403
404 def setUp(self):404 def setUp(self):
405 super(TestLiveFSView, self).setUp()405 super().setUp()
406 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))406 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))
407 self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu407 self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
408 self.distroseries = self.factory.makeDistroSeries(408 self.distroseries = self.factory.makeDistroSeries(
diff --git a/lib/lp/soyuz/browser/tests/test_livefsbuild.py b/lib/lp/soyuz/browser/tests/test_livefsbuild.py
index 1998d10..6cd5350 100644
--- a/lib/lp/soyuz/browser/tests/test_livefsbuild.py
+++ b/lib/lp/soyuz/browser/tests/test_livefsbuild.py
@@ -43,7 +43,7 @@ class TestCanonicalUrlForLiveFSBuild(TestCaseWithFactory):
43 layer = DatabaseFunctionalLayer43 layer = DatabaseFunctionalLayer
4444
45 def setUp(self):45 def setUp(self):
46 super(TestCanonicalUrlForLiveFSBuild, self).setUp()46 super().setUp()
47 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))47 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))
4848
49 def test_canonical_url(self):49 def test_canonical_url(self):
@@ -68,7 +68,7 @@ class TestLiveFSBuildView(TestCaseWithFactory):
68 layer = LaunchpadFunctionalLayer68 layer = LaunchpadFunctionalLayer
6969
70 def setUp(self):70 def setUp(self):
71 super(TestLiveFSBuildView, self).setUp()71 super().setUp()
72 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))72 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))
7373
74 def test_files(self):74 def test_files(self):
@@ -111,7 +111,7 @@ class TestLiveFSBuildOperations(BrowserTestCase):
111 layer = DatabaseFunctionalLayer111 layer = DatabaseFunctionalLayer
112112
113 def setUp(self):113 def setUp(self):
114 super(TestLiveFSBuildOperations, self).setUp()114 super().setUp()
115 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))115 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))
116 self.useFixture(FakeLogger())116 self.useFixture(FakeLogger())
117 self.build = self.factory.makeLiveFSBuild()117 self.build = self.factory.makeLiveFSBuild()
diff --git a/lib/lp/soyuz/browser/tests/test_publishing.py b/lib/lp/soyuz/browser/tests/test_publishing.py
index 54ad0fc..5d67740 100644
--- a/lib/lp/soyuz/browser/tests/test_publishing.py
+++ b/lib/lp/soyuz/browser/tests/test_publishing.py
@@ -40,7 +40,7 @@ class TestSourcePublicationListingExtra(BrowserTestCase):
40 layer = LaunchpadFunctionalLayer40 layer = LaunchpadFunctionalLayer
4141
42 def setUp(self):42 def setUp(self):
43 super(TestSourcePublicationListingExtra, self).setUp()43 super().setUp()
44 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)44 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
45 # Create everything we need to create builds, such as a45 # Create everything we need to create builds, such as a
46 # DistroArchSeries and a builder.46 # DistroArchSeries and a builder.
diff --git a/lib/lp/soyuz/browser/tests/test_queue.py b/lib/lp/soyuz/browser/tests/test_queue.py
index 1c8109f..012c1b0 100644
--- a/lib/lp/soyuz/browser/tests/test_queue.py
+++ b/lib/lp/soyuz/browser/tests/test_queue.py
@@ -65,7 +65,7 @@ class TestAcceptRejectQueueUploads(TestCaseWithFactory):
65 def setUp(self):65 def setUp(self):
66 """Create two new uploads in the new state and a person with66 """Create two new uploads in the new state and a person with
67 permission to upload to the partner archive."""67 permission to upload to the partner archive."""
68 super(TestAcceptRejectQueueUploads, self).setUp()68 super().setUp()
69 login('admin@canonical.com')69 login('admin@canonical.com')
70 self.test_publisher = SoyuzTestPublisher()70 self.test_publisher = SoyuzTestPublisher()
71 self.test_publisher.prepareBreezyAutotest()71 self.test_publisher.prepareBreezyAutotest()
diff --git a/lib/lp/soyuz/browser/tests/test_sourcepackagerelease.py b/lib/lp/soyuz/browser/tests/test_sourcepackagerelease.py
index c0f7a87..bda8b04 100644
--- a/lib/lp/soyuz/browser/tests/test_sourcepackagerelease.py
+++ b/lib/lp/soyuz/browser/tests/test_sourcepackagerelease.py
@@ -18,7 +18,7 @@ class TestSourcePackageReleaseView(TestCaseWithFactory):
18 layer = DatabaseFunctionalLayer18 layer = DatabaseFunctionalLayer
1919
20 def setUp(self):20 def setUp(self):
21 super(TestSourcePackageReleaseView, self).setUp()21 super().setUp()
22 self.source_package_release = self.factory.makeSourcePackageRelease()22 self.source_package_release = self.factory.makeSourcePackageRelease()
2323
24 def test_highlighted_copyright_is_None(self):24 def test_highlighted_copyright_is_None(self):
diff --git a/lib/lp/soyuz/interfaces/archive.py b/lib/lp/soyuz/interfaces/archive.py
index a3de895..fc7db31 100644
--- a/lib/lp/soyuz/interfaces/archive.py
+++ b/lib/lp/soyuz/interfaces/archive.py
@@ -118,7 +118,7 @@ from lp.soyuz.interfaces.buildrecords import IHasBuildRecords
118from lp.soyuz.interfaces.component import IComponent118from lp.soyuz.interfaces.component import IComponent
119119
120120
121NAMED_AUTH_TOKEN_FEATURE_FLAG = u"soyuz.named_auth_token.allow_new"121NAMED_AUTH_TOKEN_FEATURE_FLAG = "soyuz.named_auth_token.allow_new"
122122
123123
124@error_status(http.client.BAD_REQUEST)124@error_status(http.client.BAD_REQUEST)
@@ -209,7 +209,7 @@ class CannotUploadToArchive(Exception):
209209
210 def __init__(self, **args):210 def __init__(self, **args):
211 """Construct a `CannotUploadToArchive`."""211 """Construct a `CannotUploadToArchive`."""
212 super(CannotUploadToArchive, self).__init__(self._fmt % args)212 super().__init__(self._fmt % args)
213213
214214
215class InvalidPocketForPartnerArchive(CannotUploadToArchive):215class InvalidPocketForPartnerArchive(CannotUploadToArchive):
@@ -223,7 +223,7 @@ class CannotUploadToPocket(Exception):
223 """Returned when a pocket is closed for uploads."""223 """Returned when a pocket is closed for uploads."""
224224
225 def __init__(self, distroseries, pocket):225 def __init__(self, distroseries, pocket):
226 super(CannotUploadToPocket, self).__init__(226 super().__init__(
227 "Not permitted to upload to the %s pocket in a series in the "227 "Not permitted to upload to the %s pocket in a series in the "
228 "'%s' state." % (pocket.name, distroseries.status.name))228 "'%s' state." % (pocket.name, distroseries.status.name))
229229
@@ -271,7 +271,7 @@ class NoRightsForComponent(CannotUploadToArchive):
271 "Signer is not permitted to upload to the component '%(component)s'.")271 "Signer is not permitted to upload to the component '%(component)s'.")
272272
273 def __init__(self, component):273 def __init__(self, component):
274 super(NoRightsForComponent, self).__init__(component=component.name)274 super().__init__(component=component.name)
275275
276276
277class InvalidPocketForPPA(CannotUploadToArchive):277class InvalidPocketForPPA(CannotUploadToArchive):
@@ -286,7 +286,7 @@ class ArchiveDisabled(CannotUploadToArchive):
286 _fmt = ("%(archive_name)s is disabled.")286 _fmt = ("%(archive_name)s is disabled.")
287287
288 def __init__(self, archive_name):288 def __init__(self, archive_name):
289 super(ArchiveDisabled, self).__init__(archive_name=archive_name)289 super().__init__(archive_name=archive_name)
290290
291291
292class CannotUploadToSeries(CannotUploadToArchive):292class CannotUploadToSeries(CannotUploadToArchive):
@@ -295,8 +295,7 @@ class CannotUploadToSeries(CannotUploadToArchive):
295 _fmt = ("%(distroseries)s is obsolete and will not accept new uploads.")295 _fmt = ("%(distroseries)s is obsolete and will not accept new uploads.")
296296
297 def __init__(self, distroseries):297 def __init__(self, distroseries):
298 super(CannotUploadToSeries, self).__init__(298 super().__init__(distroseries=distroseries.name)
299 distroseries=distroseries.name)
300299
301300
302@error_status(http.client.BAD_REQUEST)301@error_status(http.client.BAD_REQUEST)
@@ -318,8 +317,7 @@ class CannotModifyArchiveProcessor(Exception):
318 'by administrators.')317 'by administrators.')
319318
320 def __init__(self, processor):319 def __init__(self, processor):
321 super(CannotModifyArchiveProcessor, self).__init__(320 super().__init__(self._fmt % {'processor': processor.name})
322 self._fmt % {'processor': processor.name})
323321
324322
325@error_status(http.client.CONFLICT)323@error_status(http.client.CONFLICT)
@@ -333,7 +331,7 @@ class NamedAuthTokenFeatureDisabled(Unauthorized):
333 """Only certain users can create named authorization tokens."""331 """Only certain users can create named authorization tokens."""
334332
335 def __init__(self):333 def __init__(self):
336 super(NamedAuthTokenFeatureDisabled, self).__init__(334 super().__init__(
337 "You do not have permission to create named authorization tokens")335 "You do not have permission to create named authorization tokens")
338336
339337
diff --git a/lib/lp/soyuz/interfaces/distributionjob.py b/lib/lp/soyuz/interfaces/distributionjob.py
index 9095f32..2ff19cd 100644
--- a/lib/lp/soyuz/interfaces/distributionjob.py
+++ b/lib/lp/soyuz/interfaces/distributionjob.py
@@ -84,7 +84,7 @@ class InitializationPending(Exception):
84 """84 """
8585
86 def __init__(self, job):86 def __init__(self, job):
87 super(InitializationPending, self).__init__()87 super().__init__()
88 self.job = job88 self.job = job
8989
9090
@@ -95,7 +95,7 @@ class InitializationCompleted(Exception):
95 """95 """
9696
97 def __init__(self, job):97 def __init__(self, job):
98 super(InitializationCompleted, self).__init__()98 super().__init__()
99 self.job = job99 self.job = job
100100
101101
diff --git a/lib/lp/soyuz/interfaces/livefs.py b/lib/lp/soyuz/interfaces/livefs.py
index 5569735..db7f795 100644
--- a/lib/lp/soyuz/interfaces/livefs.py
+++ b/lib/lp/soyuz/interfaces/livefs.py
@@ -73,8 +73,8 @@ from lp.soyuz.interfaces.archive import IArchive
73from lp.soyuz.interfaces.distroarchseries import IDistroArchSeries73from lp.soyuz.interfaces.distroarchseries import IDistroArchSeries
7474
7575
76LIVEFS_FEATURE_FLAG = u"soyuz.livefs.allow_new"76LIVEFS_FEATURE_FLAG = "soyuz.livefs.allow_new"
77LIVEFS_WEBHOOKS_FEATURE_FLAG = u"soyuz.livefs.webhooks.enabled"77LIVEFS_WEBHOOKS_FEATURE_FLAG = "soyuz.livefs.webhooks.enabled"
7878
7979
80@error_status(http.client.BAD_REQUEST)80@error_status(http.client.BAD_REQUEST)
@@ -82,7 +82,7 @@ class LiveFSBuildAlreadyPending(Exception):
82 """A build was requested when an identical build was already pending."""82 """A build was requested when an identical build was already pending."""
8383
84 def __init__(self):84 def __init__(self):
85 super(LiveFSBuildAlreadyPending, self).__init__(85 super().__init__(
86 "An identical build of this live filesystem image is already "86 "An identical build of this live filesystem image is already "
87 "pending.")87 "pending.")
8888
@@ -100,7 +100,7 @@ class LiveFSBuildArchiveOwnerMismatch(Forbidden):
100 """100 """
101101
102 def __init__(self):102 def __init__(self):
103 super(LiveFSBuildArchiveOwnerMismatch, self).__init__(103 super().__init__(
104 "Live filesystem builds against private archives are only "104 "Live filesystem builds against private archives are only "
105 "allowed if the live filesystem owner and the archive owner are "105 "allowed if the live filesystem owner and the archive owner are "
106 "equal.")106 "equal.")
@@ -111,7 +111,7 @@ class LiveFSFeatureDisabled(Unauthorized):
111 """Only certain users can create new LiveFS-related objects."""111 """Only certain users can create new LiveFS-related objects."""
112112
113 def __init__(self):113 def __init__(self):
114 super(LiveFSFeatureDisabled, self).__init__(114 super().__init__(
115 "You do not have permission to create new live filesystems or "115 "You do not have permission to create new live filesystems or "
116 "new live filesystem builds.")116 "new live filesystem builds.")
117117
@@ -121,7 +121,7 @@ class DuplicateLiveFSName(Exception):
121 """Raised for live filesystems with duplicate name/owner/distroseries."""121 """Raised for live filesystems with duplicate name/owner/distroseries."""
122122
123 def __init__(self):123 def __init__(self):
124 super(DuplicateLiveFSName, self).__init__(124 super().__init__(
125 "There is already a live filesystem with the same name, owner, "125 "There is already a live filesystem with the same name, owner, "
126 "and distroseries.")126 "and distroseries.")
127127
diff --git a/lib/lp/soyuz/interfaces/publishing.py b/lib/lp/soyuz/interfaces/publishing.py
index 16667a6..a1d5dc2 100644
--- a/lib/lp/soyuz/interfaces/publishing.py
+++ b/lib/lp/soyuz/interfaces/publishing.py
@@ -570,8 +570,8 @@ class ISourcePackagePublishingHistoryEdit(IPublishingEdit):
570 # _schema_circular_imports.py.570 # _schema_circular_imports.py.
571 @operation_returns_entry(Interface)571 @operation_returns_entry(Interface)
572 @operation_parameters(572 @operation_parameters(
573 new_component=TextLine(title=u"The new component name."),573 new_component=TextLine(title="The new component name."),
574 new_section=TextLine(title=u"The new section name."))574 new_section=TextLine(title="The new section name."))
575 @export_write_operation()575 @export_write_operation()
576 @call_with(creator=REQUEST_USER)576 @call_with(creator=REQUEST_USER)
577 @operation_for_version("devel")577 @operation_for_version("devel")
@@ -870,15 +870,15 @@ class IBinaryPackagePublishingHistoryEdit(IPublishingEdit):
870 # _schema_circular_imports.py.870 # _schema_circular_imports.py.
871 @operation_returns_entry(Interface)871 @operation_returns_entry(Interface)
872 @operation_parameters(872 @operation_parameters(
873 new_component=TextLine(title=u"The new component name."),873 new_component=TextLine(title="The new component name."),
874 new_section=TextLine(title=u"The new section name."),874 new_section=TextLine(title="The new section name."),
875 # XXX cjwatson 20120619: It would be nice to use copy_field here to875 # XXX cjwatson 20120619: It would be nice to use copy_field here to
876 # save manually looking up the priority name, but it doesn't work in876 # save manually looking up the priority name, but it doesn't work in
877 # this case: the title is wrong, and tests fail when a string value877 # this case: the title is wrong, and tests fail when a string value
878 # is passed over the webservice.878 # is passed over the webservice.
879 new_priority=TextLine(title=u"The new priority name."),879 new_priority=TextLine(title="The new priority name."),
880 new_phased_update_percentage=Int(880 new_phased_update_percentage=Int(
881 title=u"The new phased update percentage."))881 title="The new phased update percentage."))
882 @export_write_operation()882 @export_write_operation()
883 @call_with(creator=REQUEST_USER)883 @call_with(creator=REQUEST_USER)
884 @operation_for_version("devel")884 @operation_for_version("devel")
diff --git a/lib/lp/soyuz/interfaces/queue.py b/lib/lp/soyuz/interfaces/queue.py
index a95c982..3afd574 100644
--- a/lib/lp/soyuz/interfaces/queue.py
+++ b/lib/lp/soyuz/interfaces/queue.py
@@ -475,8 +475,8 @@ class IPackageUpload(Interface):
475 """475 """
476476
477 @operation_parameters(477 @operation_parameters(
478 new_component=TextLine(title=u"The new component name."),478 new_component=TextLine(title="The new component name."),
479 new_section=TextLine(title=u"The new section name."))479 new_section=TextLine(title="The new section name."))
480 @call_with(allowed_components=None, user=REQUEST_USER)480 @call_with(allowed_components=None, user=REQUEST_USER)
481 @export_write_operation()481 @export_write_operation()
482 @operation_for_version('devel')482 @operation_for_version('devel')
@@ -505,9 +505,9 @@ class IPackageUpload(Interface):
505505
506 @operation_parameters(506 @operation_parameters(
507 changes=List(507 changes=List(
508 title=u"A sequence of changes to apply.",508 title="A sequence of changes to apply.",
509 description=(509 description=(
510 u"Each item may have a 'name' item which specifies the binary "510 "Each item may have a 'name' item which specifies the binary "
511 "package name to override; otherwise, the change applies to "511 "package name to override; otherwise, the change applies to "
512 "all binaries in the upload. It may also have 'component', "512 "all binaries in the upload. It may also have 'component', "
513 "'section', and 'priority' items which replace the "513 "'section', and 'priority' items which replace the "
diff --git a/lib/lp/soyuz/mail/binarypackagebuild.py b/lib/lp/soyuz/mail/binarypackagebuild.py
index 4f3eb4f..225c16e 100644
--- a/lib/lp/soyuz/mail/binarypackagebuild.py
+++ b/lib/lp/soyuz/mail/binarypackagebuild.py
@@ -61,8 +61,7 @@ class BinaryPackageBuildRecipientReason(RecipientReason):
6161
62 def getReason(self):62 def getReason(self):
63 """See `RecipientReason`."""63 """See `RecipientReason`."""
64 return MailWrapper(width=72).format(64 return MailWrapper(width=72).format(super().getReason())
65 super(BinaryPackageBuildRecipientReason, self).getReason())
6665
6766
68class BinaryPackageBuildMailer(BaseMailer):67class BinaryPackageBuildMailer(BaseMailer):
@@ -143,7 +142,7 @@ class BinaryPackageBuildMailer(BaseMailer):
143142
144 def __init__(self, subject, template_name, recipients, from_address,143 def __init__(self, subject, template_name, recipients, from_address,
145 build, extra_info=None):144 build, extra_info=None):
146 super(BinaryPackageBuildMailer, self).__init__(145 super().__init__(
147 subject, template_name, recipients, from_address,146 subject, template_name, recipients, from_address,
148 notification_type="package-build-status")147 notification_type="package-build-status")
149 self.build = build148 self.build = build
@@ -151,8 +150,7 @@ class BinaryPackageBuildMailer(BaseMailer):
151150
152 def _getHeaders(self, email, recipient):151 def _getHeaders(self, email, recipient):
153 """See `BaseMailer`."""152 """See `BaseMailer`."""
154 headers = super(BinaryPackageBuildMailer, self)._getHeaders(153 headers = super()._getHeaders(email, recipient)
155 email, recipient)
156 build = self.build154 build = self.build
157 headers.update({155 headers.update({
158 "X-Launchpad-Archive": build.archive.reference,156 "X-Launchpad-Archive": build.archive.reference,
@@ -169,13 +167,12 @@ class BinaryPackageBuildMailer(BaseMailer):
169 # The deprecated PPA reference header is included for Ubuntu PPAs to167 # The deprecated PPA reference header is included for Ubuntu PPAs to
170 # avoid breaking existing consumers.168 # avoid breaking existing consumers.
171 if (build.archive.is_ppa and169 if (build.archive.is_ppa and
172 build.archive.distribution.name == u'ubuntu'):170 build.archive.distribution.name == 'ubuntu'):
173 headers["X-Launchpad-PPA"] = get_ppa_reference(build.archive)171 headers["X-Launchpad-PPA"] = get_ppa_reference(build.archive)
174 return headers172 return headers
175173
176 def _getTemplateParams(self, email, recipient):174 def _getTemplateParams(self, email, recipient):
177 params = super(BinaryPackageBuildMailer, self)._getTemplateParams(175 params = super()._getTemplateParams(email, recipient)
178 email, recipient)
179 build = self.build176 build = self.build
180 extra_info = self.extra_info177 extra_info = self.extra_info
181178
diff --git a/lib/lp/soyuz/mail/livefsbuild.py b/lib/lp/soyuz/mail/livefsbuild.py
index f907884..6bfa5e2 100644
--- a/lib/lp/soyuz/mail/livefsbuild.py
+++ b/lib/lp/soyuz/mail/livefsbuild.py
@@ -33,22 +33,21 @@ class LiveFSBuildMailer(BaseMailer):
3333
34 def __init__(self, subject, template_name, recipients, from_address,34 def __init__(self, subject, template_name, recipients, from_address,
35 build):35 build):
36 super(LiveFSBuildMailer, self).__init__(36 super().__init__(
37 subject, template_name, recipients, from_address,37 subject, template_name, recipients, from_address,
38 notification_type="livefs-build-status")38 notification_type="livefs-build-status")
39 self.build = build39 self.build = build
4040
41 def _getHeaders(self, email, recipient):41 def _getHeaders(self, email, recipient):
42 """See `BaseMailer`."""42 """See `BaseMailer`."""
43 headers = super(LiveFSBuildMailer, self)._getHeaders(email, recipient)43 headers = super()._getHeaders(email, recipient)
44 headers["X-Launchpad-Build-State"] = self.build.status.name44 headers["X-Launchpad-Build-State"] = self.build.status.name
45 return headers45 return headers
4646
47 def _getTemplateParams(self, email, recipient):47 def _getTemplateParams(self, email, recipient):
48 """See `BaseMailer`."""48 """See `BaseMailer`."""
49 build = self.build49 build = self.build
50 params = super(LiveFSBuildMailer, self)._getTemplateParams(50 params = super()._getTemplateParams(email, recipient)
51 email, recipient)
52 params.update({51 params.update({
53 "archive_tag": build.archive.reference,52 "archive_tag": build.archive.reference,
54 "build_id": build.id,53 "build_id": build.id,
diff --git a/lib/lp/soyuz/mail/packageupload.py b/lib/lp/soyuz/mail/packageupload.py
index 053a052..8224ebf 100644
--- a/lib/lp/soyuz/mail/packageupload.py
+++ b/lib/lp/soyuz/mail/packageupload.py
@@ -81,8 +81,7 @@ class PackageUploadRecipientReason(RecipientReason):
81 return cls(recipient, recipient, "Announcement", "")81 return cls(recipient, recipient, "Announcement", "")
8282
83 def _getTemplateValues(self):83 def _getTemplateValues(self):
84 template_values = super(84 template_values = super()._getTemplateValues()
85 PackageUploadRecipientReason, self)._getTemplateValues()
86 template_values["lc_entity_has"] = "you have"85 template_values["lc_entity_has"] = "you have"
87 if self.recipient != self.subscriber or self.subscriber.is_team:86 if self.recipient != self.subscriber or self.subscriber.is_team:
88 template_values["lc_entity_has"] = (87 template_values["lc_entity_has"] = (
@@ -92,7 +91,7 @@ class PackageUploadRecipientReason(RecipientReason):
92 def getReason(self):91 def getReason(self):
93 """See `RecipientReason`."""92 """See `RecipientReason`."""
94 return MailWrapper(width=72).format(93 return MailWrapper(width=72).format(
95 super(PackageUploadRecipientReason, self).getReason())94 super().getReason())
9695
9796
98def debug(logger, msg, *args, **kwargs):97def debug(logger, msg, *args, **kwargs):
@@ -110,7 +109,7 @@ def sanitize_string(s):
110 'ascii' codec can't decode byte 0xc4 in position 21: ordinal109 'ascii' codec can't decode byte 0xc4 in position 21: ordinal
111 not in range(128)110 not in range(128)
112 """111 """
113 if isinstance(s, six.text_type):112 if isinstance(s, str):
114 return s113 return s
115 else:114 else:
116 return guess_encoding(s)115 return guess_encoding(s)
@@ -447,7 +446,7 @@ class PackageUploadMailer(BaseMailer):
447 distroseries, pocket, summary_text=None, changes=None,446 distroseries, pocket, summary_text=None, changes=None,
448 changesfile_content=None, announce_from_address=None,447 changesfile_content=None, announce_from_address=None,
449 previous_version=None, logger=None):448 previous_version=None, logger=None):
450 super(PackageUploadMailer, self).__init__(449 super().__init__(
451 subject, template_name, recipients, from_address,450 subject, template_name, recipients, from_address,
452 notification_type="package-upload")451 notification_type="package-upload")
453 self.action = action452 self.action = action
@@ -480,19 +479,17 @@ class PackageUploadMailer(BaseMailer):
480 self.announce_from_address is not None):479 self.announce_from_address is not None):
481 return self.announce_from_address480 return self.announce_from_address
482 else:481 else:
483 return super(PackageUploadMailer, self)._getFromAddress(482 return super()._getFromAddress(email, recipient)
484 email, recipient)
485483
486 def _getHeaders(self, email, recipient):484 def _getHeaders(self, email, recipient):
487 """See `BaseMailer`."""485 """See `BaseMailer`."""
488 headers = super(PackageUploadMailer, self)._getHeaders(486 headers = super()._getHeaders(email, recipient)
489 email, recipient)
490 headers['X-Katie'] = 'Launchpad actually'487 headers['X-Katie'] = 'Launchpad actually'
491 headers['X-Launchpad-Archive'] = self.archive.reference488 headers['X-Launchpad-Archive'] = self.archive.reference
492489
493 # The deprecated PPA reference header is included for Ubuntu PPAs to490 # The deprecated PPA reference header is included for Ubuntu PPAs to
494 # avoid breaking existing consumers.491 # avoid breaking existing consumers.
495 if self.archive.is_ppa and self.archive.distribution.name == u'ubuntu':492 if self.archive.is_ppa and self.archive.distribution.name == 'ubuntu':
496 headers['X-Launchpad-PPA'] = get_ppa_reference(self.archive)493 headers['X-Launchpad-PPA'] = get_ppa_reference(self.archive)
497494
498 # Include a 'X-Launchpad-Component' header with the component and495 # Include a 'X-Launchpad-Component' header with the component and
@@ -541,8 +538,7 @@ class PackageUploadMailer(BaseMailer):
541538
542 def _getTemplateParams(self, email, recipient):539 def _getTemplateParams(self, email, recipient):
543 """See `BaseMailer`."""540 """See `BaseMailer`."""
544 params = super(PackageUploadMailer, self)._getTemplateParams(541 params = super()._getTemplateParams(email, recipient)
545 email, recipient)
546 params.update({542 params.update({
547 'STATUS': ACTION_DESCRIPTIONS[self.action],543 'STATUS': ACTION_DESCRIPTIONS[self.action],
548 'SUMMARY': self.summarystring,544 'SUMMARY': self.summarystring,
@@ -612,7 +608,7 @@ class PackageUploadMailer(BaseMailer):
612608
613 def generateEmail(self, email, recipient, force_no_attachments=False):609 def generateEmail(self, email, recipient, force_no_attachments=False):
614 """See `BaseMailer`."""610 """See `BaseMailer`."""
615 ctrl = super(PackageUploadMailer, self).generateEmail(611 ctrl = super().generateEmail(
616 email, recipient, force_no_attachments=force_no_attachments)612 email, recipient, force_no_attachments=force_no_attachments)
617 debug(self.logger, "Sent a mail:")613 debug(self.logger, "Sent a mail:")
618 debug(self.logger, " Subject: %s" % ctrl.subject)614 debug(self.logger, " Subject: %s" % ctrl.subject)
diff --git a/lib/lp/soyuz/mail/tests/test_packageupload.py b/lib/lp/soyuz/mail/tests/test_packageupload.py
index 2dc2a7a..ae539e2 100644
--- a/lib/lp/soyuz/mail/tests/test_packageupload.py
+++ b/lib/lp/soyuz/mail/tests/test_packageupload.py
@@ -48,14 +48,14 @@ class TestNotificationRequiringLibrarian(TestCaseWithFactory):
48 def test_mail_from_unicode_names(self):48 def test_mail_from_unicode_names(self):
49 # People with unicode in their names should appear correctly in the49 # People with unicode in their names should appear correctly in the
50 # email and not get smashed to ASCII or otherwise transliterated.50 # email and not get smashed to ASCII or otherwise transliterated.
51 creator = self.factory.makePerson(displayname=u"LoĆÆc")51 creator = self.factory.makePerson(displayname="LoĆÆc")
52 spr = self.factory.makeSourcePackageRelease(creator=creator)52 spr = self.factory.makeSourcePackageRelease(creator=creator)
53 self.factory.makeSourcePackageReleaseFile(sourcepackagerelease=spr)53 self.factory.makeSourcePackageReleaseFile(sourcepackagerelease=spr)
54 archive = self.factory.makeArchive(purpose=ArchivePurpose.PRIMARY)54 archive = self.factory.makeArchive(purpose=ArchivePurpose.PRIMARY)
55 pocket = PackagePublishingPocket.RELEASE55 pocket = PackagePublishingPocket.RELEASE
56 distroseries = self.factory.makeDistroSeries()56 distroseries = self.factory.makeDistroSeries()
57 distroseries.changeslist = "blah@example.com"57 distroseries.changeslist = "blah@example.com"
58 blamer = self.factory.makePerson(displayname=u"StƩphane")58 blamer = self.factory.makePerson(displayname="StƩphane")
59 mailer = PackageUploadMailer.forAction(59 mailer = PackageUploadMailer.forAction(
60 "accepted", blamer, spr, [], [], archive, distroseries, pocket)60 "accepted", blamer, spr, [], [], archive, distroseries, pocket)
61 mailer.sendAll()61 mailer.sendAll()
@@ -63,8 +63,8 @@ class TestNotificationRequiringLibrarian(TestCaseWithFactory):
63 self.assertEqual(2, len(notifications))63 self.assertEqual(2, len(notifications))
64 msg = notifications[1].get_payload(0)64 msg = notifications[1].get_payload(0)
65 body = six.ensure_text(msg.get_payload(decode=True))65 body = six.ensure_text(msg.get_payload(decode=True))
66 self.assertIn(u"Changed-By: LoĆÆc", body)66 self.assertIn("Changed-By: LoĆÆc", body)
67 self.assertIn(u"Signed-By: StƩphane", body)67 self.assertIn("Signed-By: StƩphane", body)
6868
69 def test_calculate_subject_customfile(self):69 def test_calculate_subject_customfile(self):
70 lfa = self.factory.makeLibraryFileAlias()70 lfa = self.factory.makeLibraryFileAlias()
@@ -143,7 +143,7 @@ class TestNotificationRequiringLibrarian(TestCaseWithFactory):
143 distroseries.changeslist = "blah@example.com"143 distroseries.changeslist = "blah@example.com"
144 blamer = self.factory.makePerson()144 blamer = self.factory.makePerson()
145 from_person = self.factory.makePerson(145 from_person = self.factory.makePerson(
146 email="loic@example.com", displayname=u"LoĆÆc Motƶrhead")146 email="loic@example.com", displayname="LoĆÆc Motƶrhead")
147 mailer = PackageUploadMailer.forAction(147 mailer = PackageUploadMailer.forAction(
148 "accepted", blamer, spr, [], [], archive, distroseries, pocket,148 "accepted", blamer, spr, [], [], archive, distroseries, pocket,
149 announce_from_person=from_person)149 announce_from_person=from_person)
@@ -215,7 +215,7 @@ class TestNotificationRequiringLibrarian(TestCaseWithFactory):
215 pocket = self.factory.getAnyPocket()215 pocket = self.factory.getAnyPocket()
216 distroseries = self.factory.makeDistroSeries()216 distroseries = self.factory.makeDistroSeries()
217 person = self.factory.makePerson(217 person = self.factory.makePerson(
218 displayname=u'Blamer', email='blamer@example.com')218 displayname='Blamer', email='blamer@example.com')
219 mailer = PackageUploadMailer.forAction(219 mailer = PackageUploadMailer.forAction(
220 "rejected", person, None, [bpr], [], archive, distroseries, pocket,220 "rejected", person, None, [bpr], [], archive, distroseries, pocket,
221 summary_text="Rejected by archive administrator.")221 summary_text="Rejected by archive administrator.")
@@ -262,7 +262,7 @@ class TestNotification(TestCaseWithFactory):
262 info['maintainer'],262 info['maintainer'],
263 ]263 ]
264 for field in fields:264 for field in fields:
265 self.assertEqual((u'Foo Bar', u'foo.bar@example.com'), field)265 self.assertEqual(('Foo Bar', 'foo.bar@example.com'), field)
266 self.assertFalse(info['notify_changed_by'])266 self.assertFalse(info['notify_changed_by'])
267267
268 def test_fetch_information_changes_notify_changed_by(self):268 def test_fetch_information_changes_notify_changed_by(self):
@@ -281,21 +281,21 @@ class TestNotification(TestCaseWithFactory):
281 info['maintainer'],281 info['maintainer'],
282 ]282 ]
283 for field in fields:283 for field in fields:
284 self.assertEqual((u'Foo Bar', u'foo.bar@example.com'), field)284 self.assertEqual(('Foo Bar', 'foo.bar@example.com'), field)
285 self.assertTrue(info['notify_changed_by'])285 self.assertTrue(info['notify_changed_by'])
286286
287 def test_fetch_information_spr(self):287 def test_fetch_information_spr(self):
288 creator = self.factory.makePerson(displayname=u"foĆø")288 creator = self.factory.makePerson(displayname="foĆø")
289 maintainer = self.factory.makePerson(displayname=u"bƦr")289 maintainer = self.factory.makePerson(displayname="bƦr")
290 spr = self.factory.makeSourcePackageRelease(290 spr = self.factory.makeSourcePackageRelease(
291 creator=creator, maintainer=maintainer)291 creator=creator, maintainer=maintainer)
292 info = fetch_information(spr, None, None)292 info = fetch_information(spr, None, None)
293 self.assertEqual(info['date'], spr.dateuploaded)293 self.assertEqual(info['date'], spr.dateuploaded)
294 self.assertEqual(info['changelog'], spr.changelog_entry)294 self.assertEqual(info['changelog'], spr.changelog_entry)
295 self.assertEqual(295 self.assertEqual(
296 (u"foĆø", spr.creator.preferredemail.email), info['changedby'])296 ("foĆø", spr.creator.preferredemail.email), info['changedby'])
297 self.assertEqual(297 self.assertEqual(
298 (u"bƦr", spr.maintainer.preferredemail.email), info['maintainer'])298 ("bƦr", spr.maintainer.preferredemail.email), info['maintainer'])
299 self.assertFalse(info['notify_changed_by'])299 self.assertFalse(info['notify_changed_by'])
300300
301 def test_fetch_information_bprs(self):301 def test_fetch_information_bprs(self):
diff --git a/lib/lp/soyuz/model/archive.py b/lib/lp/soyuz/model/archive.py
index 50ed7aa..b3c7798 100644
--- a/lib/lp/soyuz/model/archive.py
+++ b/lib/lp/soyuz/model/archive.py
@@ -230,10 +230,10 @@ from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
230230
231231
232ARCHIVE_REFERENCE_TEMPLATES = {232ARCHIVE_REFERENCE_TEMPLATES = {
233 ArchivePurpose.PRIMARY: u'%(distribution)s',233 ArchivePurpose.PRIMARY: '%(distribution)s',
234 ArchivePurpose.PPA: u'~%(owner)s/%(distribution)s/%(archive)s',234 ArchivePurpose.PPA: '~%(owner)s/%(distribution)s/%(archive)s',
235 ArchivePurpose.PARTNER: u'%(distribution)s/%(archive)s',235 ArchivePurpose.PARTNER: '%(distribution)s/%(archive)s',
236 ArchivePurpose.COPY: u'%(distribution)s/%(archive)s',236 ArchivePurpose.COPY: '%(distribution)s/%(archive)s',
237 }237 }
238238
239239
@@ -617,7 +617,7 @@ class Archive(SQLBase):
617 SourcePackageName.id)617 SourcePackageName.id)
618618
619 if name is not None:619 if name is not None:
620 if isinstance(name, six.string_types):620 if isinstance(name, str):
621 if exact_match:621 if exact_match:
622 clauses.append(SourcePackageName.name == name)622 clauses.append(SourcePackageName.name == name)
623 else:623 else:
@@ -1162,7 +1162,7 @@ class Archive(SQLBase):
11621162
1163 def _addArchiveDependency(self, dependency, pocket, component=None):1163 def _addArchiveDependency(self, dependency, pocket, component=None):
1164 """See `IArchive`."""1164 """See `IArchive`."""
1165 if isinstance(component, six.string_types):1165 if isinstance(component, str):
1166 try:1166 try:
1167 component = getUtility(IComponentSet)[component]1167 component = getUtility(IComponentSet)[component]
1168 except NotFoundError as e:1168 except NotFoundError as e:
@@ -1417,9 +1417,9 @@ class Archive(SQLBase):
1417 def _checkUpload(self, person, distroseries, sourcepackagename, component,1417 def _checkUpload(self, person, distroseries, sourcepackagename, component,
1418 pocket, strict_component=True):1418 pocket, strict_component=True):
1419 """See `IArchive`."""1419 """See `IArchive`."""
1420 if isinstance(component, six.string_types):1420 if isinstance(component, str):
1421 component = getUtility(IComponentSet)[component]1421 component = getUtility(IComponentSet)[component]
1422 if isinstance(sourcepackagename, six.string_types):1422 if isinstance(sourcepackagename, str):
1423 sourcepackagename = getUtility(1423 sourcepackagename = getUtility(
1424 ISourcePackageNameSet)[sourcepackagename]1424 ISourcePackageNameSet)[sourcepackagename]
1425 reason = self.checkUpload(person, distroseries, sourcepackagename,1425 reason = self.checkUpload(person, distroseries, sourcepackagename,
@@ -1534,7 +1534,7 @@ class Archive(SQLBase):
1534 if self.is_ppa:1534 if self.is_ppa:
1535 if IComponent.providedBy(component_name):1535 if IComponent.providedBy(component_name):
1536 name = component_name.name1536 name = component_name.name
1537 elif isinstance(component_name, six.string_types):1537 elif isinstance(component_name, str):
1538 name = component_name1538 name = component_name
1539 else:1539 else:
1540 name = None1540 name = None
@@ -1970,7 +1970,7 @@ class Archive(SQLBase):
1970 reason = self.checkUploadToPocket(series, pocket, person=person)1970 reason = self.checkUploadToPocket(series, pocket, person=person)
1971 if reason:1971 if reason:
1972 # Wrap any forbidden-pocket error in CannotCopy.1972 # Wrap any forbidden-pocket error in CannotCopy.
1973 raise CannotCopy(six.text_type(reason))1973 raise CannotCopy(str(reason))
19741974
1975 # Perform the copy, may raise CannotCopy. Don't do any further1975 # Perform the copy, may raise CannotCopy. Don't do any further
1976 # permission checking: this method is protected by1976 # permission checking: this method is protected by
@@ -2536,14 +2536,14 @@ class ArchiveSet:
2536 """See `IArchiveSet`."""2536 """See `IArchiveSet`."""
2537 from lp.registry.interfaces.distribution import IDistributionSet2537 from lp.registry.interfaces.distribution import IDistributionSet
25382538
2539 bits = reference.split(u'/')2539 bits = reference.split('/')
2540 if len(bits) < 1:2540 if len(bits) < 1:
2541 return None2541 return None
2542 if bits[0].startswith(u'~') or bits[0].startswith(u'ppa:'):2542 if bits[0].startswith('~') or bits[0].startswith('ppa:'):
2543 # PPA reference (~OWNER/DISTRO/ARCHIVE or ppa:OWNER/DISTRO/ARCHIVE)2543 # PPA reference (~OWNER/DISTRO/ARCHIVE or ppa:OWNER/DISTRO/ARCHIVE)
2544 if len(bits) != 3:2544 if len(bits) != 3:
2545 return None2545 return None
2546 if bits[0].startswith(u'~'):2546 if bits[0].startswith('~'):
2547 first_bit = bits[0][1:]2547 first_bit = bits[0][1:]
2548 else:2548 else:
2549 # ppa:OWNER2549 # ppa:OWNER
diff --git a/lib/lp/soyuz/model/archivedependency.py b/lib/lp/soyuz/model/archivedependency.py
index f880077..5f7b63c 100644
--- a/lib/lp/soyuz/model/archivedependency.py
+++ b/lib/lp/soyuz/model/archivedependency.py
@@ -53,7 +53,7 @@ class ArchiveDependency(StormBase):
53 component = Reference(component_id, 'Component.id')53 component = Reference(component_id, 'Component.id')
5454
55 def __init__(self, parent, dependency, pocket, component=None):55 def __init__(self, parent, dependency, pocket, component=None):
56 super(ArchiveDependency, self).__init__()56 super().__init__()
57 self.parent = parent57 self.parent = parent
58 self.dependency = dependency58 self.dependency = dependency
59 self.pocket = pocket59 self.pocket = pocket
diff --git a/lib/lp/soyuz/model/archivefile.py b/lib/lp/soyuz/model/archivefile.py
index e6b126d..8f4075a 100644
--- a/lib/lp/soyuz/model/archivefile.py
+++ b/lib/lp/soyuz/model/archivefile.py
@@ -66,7 +66,7 @@ class ArchiveFile(Storm):
6666
67 def __init__(self, archive, container, path, library_file):67 def __init__(self, archive, container, path, library_file):
68 """Construct an `ArchiveFile`."""68 """Construct an `ArchiveFile`."""
69 super(ArchiveFile, self).__init__()69 super().__init__()
70 self.archive = archive70 self.archive = archive
71 self.container = container71 self.container = container
72 self.path = path72 self.path = path
diff --git a/lib/lp/soyuz/model/archivejob.py b/lib/lp/soyuz/model/archivejob.py
index 3dcaff2..e6785c6 100644
--- a/lib/lp/soyuz/model/archivejob.py
+++ b/lib/lp/soyuz/model/archivejob.py
@@ -66,7 +66,7 @@ class ArchiveJob(StormBase):
66 :param metadata: the type-specific variables, as a json-compatible66 :param metadata: the type-specific variables, as a json-compatible
67 dict.67 dict.
68 """68 """
69 super(ArchiveJob, self).__init__()69 super().__init__()
70 self.job = Job()70 self.job = Job()
71 self.archive = archive71 self.archive = archive
72 self.job_type = job_type72 self.job_type = job_type
@@ -103,7 +103,7 @@ class ArchiveJobDerived(BaseRunnableJob, metaclass=EnumeratedSubclass):
103103
104 def getOopsVars(self):104 def getOopsVars(self):
105 """See `IRunnableJob`."""105 """See `IRunnableJob`."""
106 vars = super(ArchiveJobDerived, self).getOopsVars()106 vars = super().getOopsVars()
107 vars.extend([107 vars.extend([
108 ('archive_id', self.context.archive.id),108 ('archive_id', self.context.archive.id),
109 ('archive_job_id', self.context.id),109 ('archive_job_id', self.context.id),
@@ -128,12 +128,11 @@ class PackageUploadNotificationJob(ArchiveJobDerived):
128 'packageupload_status': packageupload.status.title,128 'packageupload_status': packageupload.status.title,
129 'summary_text': summary_text,129 'summary_text': summary_text,
130 }130 }
131 return super(PackageUploadNotificationJob, cls).create(131 return super().create(packageupload.archive, metadata)
132 packageupload.archive, metadata)
133132
134 def getOopsVars(self):133 def getOopsVars(self):
135 """See `ArchiveJobDerived`."""134 """See `ArchiveJobDerived`."""
136 vars = super(PackageUploadNotificationJob, self).getOopsVars()135 vars = super().getOopsVars()
137 vars.extend([136 vars.extend([
138 ('packageupload_id', self.metadata['packageupload_id']),137 ('packageupload_id', self.metadata['packageupload_id']),
139 ('packageupload_status', self.metadata['packageupload_status']),138 ('packageupload_status', self.metadata['packageupload_status']),
diff --git a/lib/lp/soyuz/model/archivepermission.py b/lib/lp/soyuz/model/archivepermission.py
index 7c816ec..8c06b7c 100644
--- a/lib/lp/soyuz/model/archivepermission.py
+++ b/lib/lp/soyuz/model/archivepermission.py
@@ -12,7 +12,6 @@ from operator import attrgetter
1212
13from lazr.enum import DBItem13from lazr.enum import DBItem
14import pytz14import pytz
15import six
16from storm.expr import Exists15from storm.expr import Exists
17from storm.locals import (16from storm.locals import (
18 And,17 And,
@@ -106,7 +105,7 @@ class ArchivePermission(StormBase):
106 def __init__(self, archive, permission, person, component=None,105 def __init__(self, archive, permission, person, component=None,
107 sourcepackagename=None, packageset=None, explicit=False,106 sourcepackagename=None, packageset=None, explicit=False,
108 distroseries=None, pocket=None):107 distroseries=None, pocket=None):
109 super(ArchivePermission, self).__init__()108 super().__init__()
110 self.archive = archive109 self.archive = archive
111 self.permission = permission110 self.permission = permission
112 self.person = person111 self.person = person
@@ -202,7 +201,7 @@ class ArchivePermissionSet:
202 def _nameToComponent(self, component):201 def _nameToComponent(self, component):
203 """Helper to convert a possible string component to IComponent"""202 """Helper to convert a possible string component to IComponent"""
204 try:203 try:
205 if isinstance(component, six.string_types):204 if isinstance(component, str):
206 component = getUtility(IComponentSet)[component]205 component = getUtility(IComponentSet)[component]
207 return component206 return component
208 except NotFoundError:207 except NotFoundError:
@@ -210,7 +209,7 @@ class ArchivePermissionSet:
210209
211 def _nameToSourcePackageName(self, sourcepackagename):210 def _nameToSourcePackageName(self, sourcepackagename):
212 """Helper to convert a possible string name to ISourcePackageName."""211 """Helper to convert a possible string name to ISourcePackageName."""
213 if isinstance(sourcepackagename, six.string_types):212 if isinstance(sourcepackagename, str):
214 sourcepackagename = getUtility(213 sourcepackagename = getUtility(
215 ISourcePackageNameSet)[sourcepackagename]214 ISourcePackageNameSet)[sourcepackagename]
216 return sourcepackagename215 return sourcepackagename
diff --git a/lib/lp/soyuz/model/binaryandsourcepackagename.py b/lib/lp/soyuz/model/binaryandsourcepackagename.py
index 566beb7..aa09d28 100644
--- a/lib/lp/soyuz/model/binaryandsourcepackagename.py
+++ b/lib/lp/soyuz/model/binaryandsourcepackagename.py
@@ -58,5 +58,4 @@ class BinaryAndSourcePackageNameVocabulary(NamedStormHugeVocabulary):
58 def getTermByToken(self, token):58 def getTermByToken(self, token):
59 """See `IVocabularyTokenized`."""59 """See `IVocabularyTokenized`."""
60 # package names are always lowercase.60 # package names are always lowercase.
61 super_class = super(BinaryAndSourcePackageNameVocabulary, self)61 return super().getTermByToken(token.lower())
62 return super_class.getTermByToken(token.lower())
diff --git a/lib/lp/soyuz/model/binarypackagebuildbehaviour.py b/lib/lp/soyuz/model/binarypackagebuildbehaviour.py
index fc94d9a..fd6bd96 100644
--- a/lib/lp/soyuz/model/binarypackagebuildbehaviour.py
+++ b/lib/lp/soyuz/model/binarypackagebuildbehaviour.py
@@ -152,8 +152,7 @@ class BinaryPackageBuildBehaviour(BuildFarmJobBehaviourBase):
152 das = build.distro_arch_series152 das = build.distro_arch_series
153153
154 # Build extra arguments.154 # Build extra arguments.
155 args = yield super(BinaryPackageBuildBehaviour, self).extraBuildArgs(155 args = yield super().extraBuildArgs(logger=logger)
156 logger=logger)
157 args['arch_indep'] = build.arch_indep156 args['arch_indep'] = build.arch_indep
158 args['distribution'] = das.distroseries.distribution.name157 args['distribution'] = das.distroseries.distribution.name
159 args['suite'] = das.distroseries.getSuite(build.pocket)158 args['suite'] = das.distroseries.getSuite(build.pocket)
diff --git a/lib/lp/soyuz/model/binarypackagename.py b/lib/lp/soyuz/model/binarypackagename.py
index 90a7cae..fc2af72 100644
--- a/lib/lp/soyuz/model/binarypackagename.py
+++ b/lib/lp/soyuz/model/binarypackagename.py
@@ -25,7 +25,6 @@ from lp.soyuz.interfaces.binarypackagename import (
25from lp.soyuz.interfaces.publishing import active_publishing_status25from lp.soyuz.interfaces.publishing import active_publishing_status
2626
2727
28@six.python_2_unicode_compatible
29@implementer(IBinaryPackageName)28@implementer(IBinaryPackageName)
30class BinaryPackageName(SQLBase):29class BinaryPackageName(SQLBase):
31 _table = 'BinaryPackageName'30 _table = 'BinaryPackageName'
diff --git a/lib/lp/soyuz/model/binarypackagerelease.py b/lib/lp/soyuz/model/binarypackagerelease.py
index 0421e81..7baebb0 100644
--- a/lib/lp/soyuz/model/binarypackagerelease.py
+++ b/lib/lp/soyuz/model/binarypackagerelease.py
@@ -92,7 +92,7 @@ class BinaryPackageRelease(SQLBase):
92 kwargs['_user_defined_fields'] = simplejson.dumps(92 kwargs['_user_defined_fields'] = simplejson.dumps(
93 kwargs['user_defined_fields'])93 kwargs['user_defined_fields'])
94 del kwargs['user_defined_fields']94 del kwargs['user_defined_fields']
95 super(BinaryPackageRelease, self).__init__(*args, **kwargs)95 super().__init__(*args, **kwargs)
9696
97 @cachedproperty97 @cachedproperty
98 def built_using_references(self):98 def built_using_references(self):
@@ -183,7 +183,7 @@ class BinaryPackageReleaseDownloadCount(Storm):
183 count = Int(allow_none=False)183 count = Int(allow_none=False)
184184
185 def __init__(self, archive, binary_package_release, day, country, count):185 def __init__(self, archive, binary_package_release, day, country, count):
186 super(BinaryPackageReleaseDownloadCount, self).__init__()186 super().__init__()
187 self.archive = archive187 self.archive = archive
188 self.binary_package_release = binary_package_release188 self.binary_package_release = binary_package_release
189 self.day = day189 self.day = day
diff --git a/lib/lp/soyuz/model/binarysourcereference.py b/lib/lp/soyuz/model/binarysourcereference.py
index f5f4cde..653419a 100644
--- a/lib/lp/soyuz/model/binarysourcereference.py
+++ b/lib/lp/soyuz/model/binarysourcereference.py
@@ -53,7 +53,7 @@ class BinarySourceReference(StormBase):
53 def __init__(self, binary_package_release, source_package_release,53 def __init__(self, binary_package_release, source_package_release,
54 reference_type):54 reference_type):
55 """Construct a `BinarySourceReference`."""55 """Construct a `BinarySourceReference`."""
56 super(BinarySourceReference, self).__init__()56 super().__init__()
57 self.binary_package_release = binary_package_release57 self.binary_package_release = binary_package_release
58 self.source_package_release = source_package_release58 self.source_package_release = source_package_release
59 self.reference_type = reference_type59 self.reference_type = reference_type
diff --git a/lib/lp/soyuz/model/distributionjob.py b/lib/lp/soyuz/model/distributionjob.py
index 2fb9da3..1c302bf 100644
--- a/lib/lp/soyuz/model/distributionjob.py
+++ b/lib/lp/soyuz/model/distributionjob.py
@@ -54,7 +54,7 @@ class DistributionJob(StormBase):
54 metadata = JSON('json_data')54 metadata = JSON('json_data')
5555
56 def __init__(self, distribution, distroseries, job_type, metadata):56 def __init__(self, distribution, distroseries, job_type, metadata):
57 super(DistributionJob, self).__init__()57 super().__init__()
58 self.job = Job()58 self.job = Job()
59 self.distribution = distribution59 self.distribution = distribution
60 self.distroseries = distroseries60 self.distroseries = distroseries
@@ -100,7 +100,7 @@ class DistributionJobDerived(BaseRunnableJob, metaclass=EnumeratedSubclass):
100100
101 def getOopsVars(self):101 def getOopsVars(self):
102 """See `IRunnableJob`."""102 """See `IRunnableJob`."""
103 vars = super(DistributionJobDerived, self).getOopsVars()103 vars = super().getOopsVars()
104 vars.extend([104 vars.extend([
105 ('distribution_id', self.context.distribution.id),105 ('distribution_id', self.context.distribution.id),
106 ('distroseries_id', self.context.distroseries.id),106 ('distroseries_id', self.context.distroseries.id),
diff --git a/lib/lp/soyuz/model/distroarchseriesfilter.py b/lib/lp/soyuz/model/distroarchseriesfilter.py
index 13e6007..948aed5 100644
--- a/lib/lp/soyuz/model/distroarchseriesfilter.py
+++ b/lib/lp/soyuz/model/distroarchseriesfilter.py
@@ -69,7 +69,7 @@ class DistroArchSeriesFilter(Storm):
69 def __init__(self, distroarchseries, packageset, sense, creator,69 def __init__(self, distroarchseries, packageset, sense, creator,
70 date_created=DEFAULT):70 date_created=DEFAULT):
71 """Construct a `DistroArchSeriesFilter`."""71 """Construct a `DistroArchSeriesFilter`."""
72 super(DistroArchSeriesFilter, self).__init__()72 super().__init__()
73 self.distroarchseries = distroarchseries73 self.distroarchseries = distroarchseries
74 self.packageset = packageset74 self.packageset = packageset
75 self.sense = sense75 self.sense = sense
diff --git a/lib/lp/soyuz/model/initializedistroseriesjob.py b/lib/lp/soyuz/model/initializedistroseriesjob.py
index 0af6d13..dd10c81 100644
--- a/lib/lp/soyuz/model/initializedistroseriesjob.py
+++ b/lib/lp/soyuz/model/initializedistroseriesjob.py
@@ -5,7 +5,6 @@ __all__ = [
5 "InitializeDistroSeriesJob",5 "InitializeDistroSeriesJob",
6]6]
77
8import six
9from zope.interface import (8from zope.interface import (
10 implementer,9 implementer,
11 provider,10 provider,
@@ -216,12 +215,12 @@ class InitializeDistroSeriesJob(DistributionJobDerived):
216 """215 """
217 # This method is called when error is an instance of216 # This method is called when error is an instance of
218 # self.user_error_types.217 # self.user_error_types.
219 super(InitializeDistroSeriesJob, self).notifyUserError(error)218 super().notifyUserError(error)
220 self.metadata = dict(219 self.metadata = dict(
221 self.metadata, error_description=six.text_type(error))220 self.metadata, error_description=str(error))
222221
223 def getOopsVars(self):222 def getOopsVars(self):
224 """See `IRunnableJob`."""223 """See `IRunnableJob`."""
225 vars = super(InitializeDistroSeriesJob, self).getOopsVars()224 vars = super().getOopsVars()
226 vars.append(('parent_distroseries_ids', self.metadata.get("parents")))225 vars.append(('parent_distroseries_ids', self.metadata.get("parents")))
227 return vars226 return vars
diff --git a/lib/lp/soyuz/model/livefs.py b/lib/lp/soyuz/model/livefs.py
index 84e765f..ae3a92f 100644
--- a/lib/lp/soyuz/model/livefs.py
+++ b/lib/lp/soyuz/model/livefs.py
@@ -133,7 +133,7 @@ class LiveFS(Storm, WebhookTargetMixin):
133 """Construct a `LiveFS`."""133 """Construct a `LiveFS`."""
134 if not getFeatureFlag(LIVEFS_FEATURE_FLAG):134 if not getFeatureFlag(LIVEFS_FEATURE_FLAG):
135 raise LiveFSFeatureDisabled135 raise LiveFSFeatureDisabled
136 super(LiveFS, self).__init__()136 super().__init__()
137 self.registrant = registrant137 self.registrant = registrant
138 self.owner = owner138 self.owner = owner
139 self.distro_series = distro_series139 self.distro_series = distro_series
diff --git a/lib/lp/soyuz/model/livefsbuild.py b/lib/lp/soyuz/model/livefsbuild.py
index 7ec3e87..79865ec 100644
--- a/lib/lp/soyuz/model/livefsbuild.py
+++ b/lib/lp/soyuz/model/livefsbuild.py
@@ -92,7 +92,7 @@ class LiveFSFile(Storm):
9292
93 def __init__(self, livefsbuild, libraryfile):93 def __init__(self, livefsbuild, libraryfile):
94 """Construct a `LiveFSFile`."""94 """Construct a `LiveFSFile`."""
95 super(LiveFSFile, self).__init__()95 super().__init__()
96 self.livefsbuild = livefsbuild96 self.livefsbuild = livefsbuild
97 self.libraryfile = libraryfile97 self.libraryfile = libraryfile
9898
@@ -163,7 +163,7 @@ class LiveFSBuild(PackageBuildMixin, Storm):
163 """Construct a `LiveFSBuild`."""163 """Construct a `LiveFSBuild`."""
164 if not getFeatureFlag(LIVEFS_FEATURE_FLAG):164 if not getFeatureFlag(LIVEFS_FEATURE_FLAG):
165 raise LiveFSFeatureDisabled165 raise LiveFSFeatureDisabled
166 super(LiveFSBuild, self).__init__()166 super().__init__()
167 self.build_farm_job = build_farm_job167 self.build_farm_job = build_farm_job
168 self.requester = requester168 self.requester = requester
169 self.livefs = livefs169 self.livefs = livefs
@@ -303,7 +303,7 @@ class LiveFSBuild(PackageBuildMixin, Storm):
303303
304 edited_fields = set()304 edited_fields = set()
305 with notify_modified(self, edited_fields) as previous_obj:305 with notify_modified(self, edited_fields) as previous_obj:
306 super(LiveFSBuild, self).updateStatus(306 super().updateStatus(
307 status, builder=builder, slave_status=slave_status,307 status, builder=builder, slave_status=slave_status,
308 date_started=date_started, date_finished=date_finished,308 date_started=date_started, date_finished=date_finished,
309 force_invalid_transition=force_invalid_transition)309 force_invalid_transition=force_invalid_transition)
diff --git a/lib/lp/soyuz/model/livefsbuildbehaviour.py b/lib/lp/soyuz/model/livefsbuildbehaviour.py
index 700e5c0..510d17c 100644
--- a/lib/lp/soyuz/model/livefsbuildbehaviour.py
+++ b/lib/lp/soyuz/model/livefsbuildbehaviour.py
@@ -92,8 +92,7 @@ class LiveFSBuildBehaviour(BuildFarmJobBehaviourBase):
92 Return the extra arguments required by the slave for the given build.92 Return the extra arguments required by the slave for the given build.
93 """93 """
94 build = self.build94 build = self.build
95 base_args = yield super(LiveFSBuildBehaviour, self).extraBuildArgs(95 base_args = yield super().extraBuildArgs(logger=logger)
96 logger=logger)
97 # Non-trivial metadata values may have been security-wrapped, which96 # Non-trivial metadata values may have been security-wrapped, which
98 # is pointless here and just gets in the way of xmlrpc.client97 # is pointless here and just gets in the way of xmlrpc.client
99 # serialisation.98 # serialisation.
diff --git a/lib/lp/soyuz/model/packagecopyjob.py b/lib/lp/soyuz/model/packagecopyjob.py
index f3a91a8..a3ede41 100644
--- a/lib/lp/soyuz/model/packagecopyjob.py
+++ b/lib/lp/soyuz/model/packagecopyjob.py
@@ -145,7 +145,7 @@ class PackageCopyJob(StormBase):
145 def __init__(self, source_archive, target_archive, target_distroseries,145 def __init__(self, source_archive, target_archive, target_distroseries,
146 job_type, metadata, requester, package_name=None,146 job_type, metadata, requester, package_name=None,
147 copy_policy=None):147 copy_policy=None):
148 super(PackageCopyJob, self).__init__()148 super().__init__()
149 self.job = Job()149 self.job = Job()
150 self.job.requester = requester150 self.job.requester = requester
151 self.job_type = job_type151 self.job_type = job_type
@@ -228,7 +228,7 @@ class PackageCopyJobDerived(BaseRunnableJob, metaclass=EnumeratedSubclass):
228228
229 def getOopsVars(self):229 def getOopsVars(self):
230 """See `IRunnableJob`."""230 """See `IRunnableJob`."""
231 vars = super(PackageCopyJobDerived, self).getOopsVars()231 vars = super().getOopsVars()
232 vars.extend([232 vars.extend([
233 ('source_archive_id', self.context.source_archive_id),233 ('source_archive_id', self.context.source_archive_id),
234 ('target_archive_id', self.context.target_archive_id),234 ('target_archive_id', self.context.target_archive_id),
@@ -581,7 +581,7 @@ class PlainPackageCopyJob(PackageCopyJobDerived):
581 " package. It was logged with id %s. Sorry for the"581 " package. It was logged with id %s. Sorry for the"
582 " inconvenience." % oops["id"])582 " inconvenience." % oops["id"])
583 transaction.commit()583 transaction.commit()
584 super(PlainPackageCopyJob, self).notifyOops(oops)584 super().notifyOops(oops)
585585
586 @property586 @property
587 def _advisory_lock_id(self):587 def _advisory_lock_id(self):
@@ -624,7 +624,7 @@ class PlainPackageCopyJob(PackageCopyJobDerived):
624 target_archive_purpose = self.target_archive.purpose624 target_archive_purpose = self.target_archive.purpose
625 self.logger.info("Job:\n%s\nraised CannotCopy:\n%s" % (self, e))625 self.logger.info("Job:\n%s\nraised CannotCopy:\n%s" % (self, e))
626 self.abort() # Abort the txn.626 self.abort() # Abort the txn.
627 self.reportFailure(six.text_type(e))627 self.reportFailure(str(e))
628628
629 # If there is an associated PackageUpload we need to reject it,629 # If there is an associated PackageUpload we need to reject it,
630 # else it will sit in ACCEPTED forever.630 # else it will sit in ACCEPTED forever.
@@ -663,7 +663,7 @@ class PlainPackageCopyJob(PackageCopyJobDerived):
663 person=self.requester)663 person=self.requester)
664 if reason:664 if reason:
665 # Wrap any forbidden-pocket error in CannotCopy.665 # Wrap any forbidden-pocket error in CannotCopy.
666 raise CannotCopy(six.text_type(reason))666 raise CannotCopy(str(reason))
667667
668 if self.silent and not self.requester_can_admin_target:668 if self.silent and not self.requester_can_admin_target:
669 raise CannotCopy(669 raise CannotCopy(
diff --git a/lib/lp/soyuz/model/packagediff.py b/lib/lp/soyuz/model/packagediff.py
index c9ad7a3..90d2170 100644
--- a/lib/lp/soyuz/model/packagediff.py
+++ b/lib/lp/soyuz/model/packagediff.py
@@ -15,7 +15,6 @@ import shutil
15import subprocess15import subprocess
16import tempfile16import tempfile
1717
18import six
19from storm.expr import Desc18from storm.expr import Desc
20from storm.store import EmptyResultSet19from storm.store import EmptyResultSet
21from zope.component import getUtility20from zope.component import getUtility
@@ -215,7 +214,7 @@ class PackageDiff(SQLBase):
215 zip(directions, (self.from_source, self.to_source)))214 zip(directions, (self.from_source, self.to_source)))
216215
217 # Iterate over the packages to be diff'ed.216 # Iterate over the packages to be diff'ed.
218 for direction, package in six.iteritems(packages):217 for direction, package in packages.items():
219 # Create distinct directory locations for218 # Create distinct directory locations for
220 # 'from' and 'to' files.219 # 'from' and 'to' files.
221 absolute_path = os.path.join(tmp_dir, direction)220 absolute_path = os.path.join(tmp_dir, direction)
diff --git a/lib/lp/soyuz/model/packageset.py b/lib/lp/soyuz/model/packageset.py
index 1aea015..d135b97 100644
--- a/lib/lp/soyuz/model/packageset.py
+++ b/lib/lp/soyuz/model/packageset.py
@@ -299,7 +299,7 @@ class Packageset(Storm):
299299
300 def addSources(self, names):300 def addSources(self, names):
301 """See `IPackageset`."""301 """See `IPackageset`."""
302 if isinstance(names, six.string_types):302 if isinstance(names, str):
303 names = [six.ensure_text(names, 'ASCII')]303 names = [six.ensure_text(names, 'ASCII')]
304 clauses = (SourcePackageName, SourcePackageName.name.is_in(names))304 clauses = (SourcePackageName, SourcePackageName.name.is_in(names))
305 self._api_add_or_remove(clauses, self._addSourcePackageNames)305 self._api_add_or_remove(clauses, self._addSourcePackageNames)
@@ -417,7 +417,7 @@ class PackagesetSet:
417417
418 def _nameToSourcePackageName(self, source_name):418 def _nameToSourcePackageName(self, source_name):
419 """Helper to convert a possible string name to ISourcePackageName."""419 """Helper to convert a possible string name to ISourcePackageName."""
420 if isinstance(source_name, six.string_types):420 if isinstance(source_name, str):
421 source_name = getUtility(ISourcePackageNameSet)[source_name]421 source_name = getUtility(ISourcePackageNameSet)[source_name]
422 return source_name422 return source_name
423423
diff --git a/lib/lp/soyuz/model/processacceptedbugsjob.py b/lib/lp/soyuz/model/processacceptedbugsjob.py
index cfcb7f1..95c69a8 100644
--- a/lib/lp/soyuz/model/processacceptedbugsjob.py
+++ b/lib/lp/soyuz/model/processacceptedbugsjob.py
@@ -238,7 +238,7 @@ class ProcessAcceptedBugsJob(StormBase, BaseRunnableJob):
238 self.distroseries = distroseries238 self.distroseries = distroseries
239 self.sourcepackagerelease = sourcepackagerelease239 self.sourcepackagerelease = sourcepackagerelease
240 self.metadata = {"bug_ids": list(bug_ids)}240 self.metadata = {"bug_ids": list(bug_ids)}
241 super(ProcessAcceptedBugsJob, self).__init__()241 super().__init__()
242242
243 @property243 @property
244 def bug_ids(self):244 def bug_ids(self):
diff --git a/lib/lp/soyuz/model/publishing.py b/lib/lp/soyuz/model/publishing.py
index 6141c93..421e649 100644
--- a/lib/lp/soyuz/model/publishing.py
+++ b/lib/lp/soyuz/model/publishing.py
@@ -20,7 +20,6 @@ import os
20import sys20import sys
2121
22import pytz22import pytz
23import six
24from storm.expr import (23from storm.expr import (
25 And,24 And,
26 Cast,25 Cast,
@@ -485,11 +484,11 @@ class SourcePackagePublishingHistory(SQLBase, ArchivePublisherBase):
485 # Check there is a change to make484 # Check there is a change to make
486 if new_component is None:485 if new_component is None:
487 new_component = self.component486 new_component = self.component
488 elif isinstance(new_component, six.string_types):487 elif isinstance(new_component, str):
489 new_component = getUtility(IComponentSet)[new_component]488 new_component = getUtility(IComponentSet)[new_component]
490 if new_section is None:489 if new_section is None:
491 new_section = self.section490 new_section = self.section
492 elif isinstance(new_section, six.string_types):491 elif isinstance(new_section, str):
493 new_section = getUtility(ISectionSet)[new_section]492 new_section = getUtility(ISectionSet)[new_section]
494493
495 if new_component == self.component and new_section == self.section:494 if new_component == self.component and new_section == self.section:
@@ -754,7 +753,7 @@ class BinaryPackagePublishingHistory(SQLBase, ArchivePublisherBase):
754 if self.is_debug and not self.archive.publish_debug_symbols:753 if self.is_debug and not self.archive.publish_debug_symbols:
755 self.setPublished()754 self.setPublished()
756 else:755 else:
757 super(BinaryPackagePublishingHistory, self).publish(diskpool, log)756 super().publish(diskpool, log)
758757
759 def getOtherPublications(self):758 def getOtherPublications(self):
760 """See `IBinaryPackagePublishingHistory`."""759 """See `IBinaryPackagePublishingHistory`."""
@@ -843,15 +842,15 @@ class BinaryPackagePublishingHistory(SQLBase, ArchivePublisherBase):
843 # Check there is a change to make842 # Check there is a change to make
844 if new_component is None:843 if new_component is None:
845 new_component = self.component844 new_component = self.component
846 elif isinstance(new_component, six.string_types):845 elif isinstance(new_component, str):
847 new_component = getUtility(IComponentSet)[new_component]846 new_component = getUtility(IComponentSet)[new_component]
848 if new_section is None:847 if new_section is None:
849 new_section = self.section848 new_section = self.section
850 elif isinstance(new_section, six.string_types):849 elif isinstance(new_section, str):
851 new_section = getUtility(ISectionSet)[new_section]850 new_section = getUtility(ISectionSet)[new_section]
852 if new_priority is None:851 if new_priority is None:
853 new_priority = self.priority852 new_priority = self.priority
854 elif isinstance(new_priority, six.string_types):853 elif isinstance(new_priority, str):
855 new_priority = name_priority_map[new_priority]854 new_priority = name_priority_map[new_priority]
856 if new_phased_update_percentage is None:855 if new_phased_update_percentage is None:
857 new_phased_update_percentage = self.phased_update_percentage856 new_phased_update_percentage = self.phased_update_percentage
@@ -1031,7 +1030,7 @@ def expand_binary_requests(distroseries, binaries):
1031 arch_map = {arch.architecturetag: arch for arch in archs}1030 arch_map = {arch.architecturetag: arch for arch in archs}
10321031
1033 expanded = []1032 expanded = []
1034 for bpr, overrides in six.iteritems(binaries):1033 for bpr, overrides in binaries.items():
1035 if bpr.architecturespecific:1034 if bpr.architecturespecific:
1036 # Find the DAS in this series corresponding to the original1035 # Find the DAS in this series corresponding to the original
1037 # build arch tag. If it does not exist or is disabled, we should1036 # build arch tag. If it does not exist or is disabled, we should
diff --git a/lib/lp/soyuz/model/queue.py b/lib/lp/soyuz/model/queue.py
index babe57a..712dd7a 100644
--- a/lib/lp/soyuz/model/queue.py
+++ b/lib/lp/soyuz/model/queue.py
@@ -16,7 +16,6 @@ from itertools import chain
16from operator import attrgetter16from operator import attrgetter
1717
18import pytz18import pytz
19import six
20from storm.expr import Cast19from storm.expr import Cast
21from storm.locals import (20from storm.locals import (
22 And,21 And,
@@ -206,7 +205,7 @@ class PackageUpload(SQLBase):
206 joinColumn='packageupload')205 joinColumn='packageupload')
207206
208 def __init__(self, *args, **kwargs):207 def __init__(self, *args, **kwargs):
209 super(PackageUpload, self).__init__(*args, **kwargs)208 super().__init__(*args, **kwargs)
210 # searchable_{name,version}s are set for the other cases when209 # searchable_{name,version}s are set for the other cases when
211 # add{Source,Build,Custom} are called.210 # add{Source,Build,Custom} are called.
212 if self.package_copy_job:211 if self.package_copy_job:
@@ -973,7 +972,7 @@ class PackageUpload(SQLBase):
973 def _nameToComponent(self, component):972 def _nameToComponent(self, component):
974 """Helper to convert a possible string component to IComponent."""973 """Helper to convert a possible string component to IComponent."""
975 try:974 try:
976 if isinstance(component, six.string_types):975 if isinstance(component, str):
977 component = getUtility(IComponentSet)[component]976 component = getUtility(IComponentSet)[component]
978 return component977 return component
979 except NotFoundError:978 except NotFoundError:
@@ -982,7 +981,7 @@ class PackageUpload(SQLBase):
982 def _nameToSection(self, section):981 def _nameToSection(self, section):
983 """Helper to convert a possible string section to ISection."""982 """Helper to convert a possible string section to ISection."""
984 try:983 try:
985 if isinstance(section, six.string_types):984 if isinstance(section, str):
986 section = getUtility(ISectionSet)[section]985 section = getUtility(ISectionSet)[section]
987 return section986 return section
988 except NotFoundError:987 except NotFoundError:
@@ -991,7 +990,7 @@ class PackageUpload(SQLBase):
991 def _nameToPriority(self, priority):990 def _nameToPriority(self, priority):
992 """Helper to convert a possible string priority to its enum."""991 """Helper to convert a possible string priority to its enum."""
993 try:992 try:
994 if isinstance(priority, six.string_types):993 if isinstance(priority, str):
995 priority = name_priority_map[priority]994 priority = name_priority_map[priority]
996 return priority995 return priority
997 except KeyError:996 except KeyError:
diff --git a/lib/lp/soyuz/model/sourcepackagerelease.py b/lib/lp/soyuz/model/sourcepackagerelease.py
index 8b07ecc..64086c3 100644
--- a/lib/lp/soyuz/model/sourcepackagerelease.py
+++ b/lib/lp/soyuz/model/sourcepackagerelease.py
@@ -145,7 +145,7 @@ class SourcePackageRelease(SQLBase):
145 # loaded every time. Set it separately.145 # loaded every time. Set it separately.
146 if 'copyright' in kwargs:146 if 'copyright' in kwargs:
147 copyright = kwargs.pop('copyright')147 copyright = kwargs.pop('copyright')
148 super(SourcePackageRelease, self).__init__(*args, **kwargs)148 super().__init__(*args, **kwargs)
149 # PostgresSQL text columns can't contain null149 # PostgresSQL text columns can't contain null
150 # characters, so remove them as this is only150 # characters, so remove them as this is only
151 # used for display151 # used for display
diff --git a/lib/lp/soyuz/scripts/custom_uploads_copier.py b/lib/lp/soyuz/scripts/custom_uploads_copier.py
index 55cd1c7..43a0128 100644
--- a/lib/lp/soyuz/scripts/custom_uploads_copier.py
+++ b/lib/lp/soyuz/scripts/custom_uploads_copier.py
@@ -13,8 +13,6 @@ __all__ = [
1313
14from operator import attrgetter14from operator import attrgetter
1515
16import six
17
18from lp.archivepublisher.ddtp_tarball import DdtpTarballUpload16from lp.archivepublisher.ddtp_tarball import DdtpTarballUpload
19from lp.archivepublisher.debian_installer import DebianInstallerUpload17from lp.archivepublisher.debian_installer import DebianInstallerUpload
20from lp.archivepublisher.dist_upgrader import DistUpgraderUpload18from lp.archivepublisher.dist_upgrader import DistUpgraderUpload
@@ -164,7 +162,7 @@ class CustomUploadsCopier:
164 self.target_series, source_pocket=self.target_pocket)162 self.target_series, source_pocket=self.target_pocket)
165 source_uploads = self.getLatestUploads(163 source_uploads = self.getLatestUploads(
166 source_series, source_pocket=source_pocket)164 source_series, source_pocket=source_pocket)
167 for upload in six.itervalues(source_uploads):165 for upload in source_uploads.values():
168 if (not self.isObsolete(upload, target_uploads) and166 if (not self.isObsolete(upload, target_uploads) and
169 self.isForValidDAS(upload)):167 self.isForValidDAS(upload)):
170 self.copyUpload(upload)168 self.copyUpload(upload)
diff --git a/lib/lp/soyuz/scripts/ftpmasterbase.py b/lib/lp/soyuz/scripts/ftpmasterbase.py
index 0b3aa2e..7a1fe88 100644
--- a/lib/lp/soyuz/scripts/ftpmasterbase.py
+++ b/lib/lp/soyuz/scripts/ftpmasterbase.py
@@ -11,8 +11,6 @@ __all__ = [
11 'SoyuzScript',11 'SoyuzScript',
12 ]12 ]
1313
14from six.moves import input
15
16from lp.services.scripts.base import (14from lp.services.scripts.base import (
17 LaunchpadScript,15 LaunchpadScript,
18 LaunchpadScriptFailure,16 LaunchpadScriptFailure,
diff --git a/lib/lp/soyuz/scripts/gina/handlers.py b/lib/lp/soyuz/scripts/gina/handlers.py
index b527ab7..483af39 100644
--- a/lib/lp/soyuz/scripts/gina/handlers.py
+++ b/lib/lp/soyuz/scripts/gina/handlers.py
@@ -22,7 +22,6 @@ import io
22import os22import os
23import re23import re
2424
25import six
26from storm.exceptions import NotOneError25from storm.exceptions import NotOneError
27from storm.expr import (26from storm.expr import (
28 Cast,27 Cast,
@@ -504,8 +503,7 @@ class SourcePackageHandler:
504 sp_version, sp_component))503 sp_version, sp_component))
505 dsc_contents = parse_tagfile(dsc_path)504 dsc_contents = parse_tagfile(dsc_path)
506 dsc_contents = {505 dsc_contents = {
507 name.lower(): value for506 name.lower(): value for (name, value) in dsc_contents.items()}
508 (name, value) in six.iteritems(dsc_contents)}
509507
510 # Since the dsc doesn't know, we add in the directory, package508 # Since the dsc doesn't know, we add in the directory, package
511 # component and section509 # component and section
diff --git a/lib/lp/soyuz/scripts/gina/runner.py b/lib/lp/soyuz/scripts/gina/runner.py
index df60215..fbdecf5 100644
--- a/lib/lp/soyuz/scripts/gina/runner.py
+++ b/lib/lp/soyuz/scripts/gina/runner.py
@@ -165,7 +165,7 @@ def import_sourcepackages(distro, packages_map, package_root,
165165
166def do_one_sourcepackage(distro, source, package_root, importer_handler):166def do_one_sourcepackage(distro, source, package_root, importer_handler):
167 source_data = SourcePackageData(**source)167 source_data = SourcePackageData(**source)
168 skip_key = u'%s/%s/%s' % (distro, source_data.package, source_data.version)168 skip_key = '%s/%s/%s' % (distro, source_data.package, source_data.version)
169 skip_list = getFeatureFlag('soyuz.gina.skip_source_versions')169 skip_list = getFeatureFlag('soyuz.gina.skip_source_versions')
170 if skip_list is not None and skip_key in skip_list.split():170 if skip_list is not None and skip_key in skip_list.split():
171 log.info(171 log.info(
diff --git a/lib/lp/soyuz/scripts/packagecopier.py b/lib/lp/soyuz/scripts/packagecopier.py
index c1fb6cb..d5388d3 100644
--- a/lib/lp/soyuz/scripts/packagecopier.py
+++ b/lib/lp/soyuz/scripts/packagecopier.py
@@ -259,8 +259,7 @@ class CopyChecker:
259 def getCheckedCopies(self):259 def getCheckedCopies(self):
260 """Return a list of copies allowed to be performed."""260 """Return a list of copies allowed to be performed."""
261 for copies in self._inventory.values():261 for copies in self._inventory.values():
262 for copy in copies:262 yield from copies
263 yield copy
264263
265 def getConflicts(self, candidate):264 def getConflicts(self, candidate):
266 """Conflicting `CheckedCopy` objects in the inventory.265 """Conflicting `CheckedCopy` objects in the inventory.
diff --git a/lib/lp/soyuz/scripts/populate_archive.py b/lib/lp/soyuz/scripts/populate_archive.py
index 0eb4f68..1b9b12b 100644
--- a/lib/lp/soyuz/scripts/populate_archive.py
+++ b/lib/lp/soyuz/scripts/populate_archive.py
@@ -36,7 +36,7 @@ def specified(option):
36 """36 """
37 if option is None:37 if option is None:
38 return False38 return False
39 if isinstance(option, six.string_types) and option.strip() == '':39 if isinstance(option, str) and option.strip() == '':
40 return False40 return False
41 return True41 return True
4242
diff --git a/lib/lp/soyuz/scripts/ppareport.py b/lib/lp/soyuz/scripts/ppareport.py
index 94914fe..c9e106c 100644
--- a/lib/lp/soyuz/scripts/ppareport.py
+++ b/lib/lp/soyuz/scripts/ppareport.py
@@ -186,7 +186,7 @@ class PPAReportScript(LaunchpadScript):
186 sorted_people_to_email = sorted(186 sorted_people_to_email = sorted(
187 people_to_email, key=operator.attrgetter('name'))187 people_to_email, key=operator.attrgetter('name'))
188 for user in sorted_people_to_email:188 for user in sorted_people_to_email:
189 line = u"%s | %s | %s\n" % (189 line = "%s | %s | %s\n" % (
190 user.name, user.displayname, user.preferredemail.email)190 user.name, user.displayname, user.preferredemail.email)
191 self.output.write(six.ensure_str(line))191 self.output.write(six.ensure_str(line))
192 self.output.write('\n')192 self.output.write('\n')
diff --git a/lib/lp/soyuz/scripts/retrydepwait.py b/lib/lp/soyuz/scripts/retrydepwait.py
index a6a41af..9f86c24 100644
--- a/lib/lp/soyuz/scripts/retrydepwait.py
+++ b/lib/lp/soyuz/scripts/retrydepwait.py
@@ -33,7 +33,7 @@ class RetryDepwaitTunableLoop(TunableLoop):
33 maximum_chunk_size = 500033 maximum_chunk_size = 5000
3434
35 def __init__(self, log, dry_run, abort_time=None):35 def __init__(self, log, dry_run, abort_time=None):
36 super(RetryDepwaitTunableLoop, self).__init__(log, abort_time)36 super().__init__(log, abort_time)
37 self.dry_run = dry_run37 self.dry_run = dry_run
38 self.start_at = 138 self.start_at = 1
39 self.store = IStore(BinaryPackageBuild)39 self.store = IStore(BinaryPackageBuild)
diff --git a/lib/lp/soyuz/scripts/tests/test_copypackage.py b/lib/lp/soyuz/scripts/tests/test_copypackage.py
index 62ced33..223f697 100644
--- a/lib/lp/soyuz/scripts/tests/test_copypackage.py
+++ b/lib/lp/soyuz/scripts/tests/test_copypackage.py
@@ -440,7 +440,7 @@ class CopyCheckerQueries(TestCaseWithFactory,
440 layer = LaunchpadZopelessLayer440 layer = LaunchpadZopelessLayer
441441
442 def setUp(self):442 def setUp(self):
443 super(CopyCheckerQueries, self).setUp()443 super().setUp()
444 self.test_publisher = SoyuzTestPublisher()444 self.test_publisher = SoyuzTestPublisher()
445 self.test_publisher.prepareBreezyAutotest()445 self.test_publisher.prepareBreezyAutotest()
446 self.source = self.test_publisher.getPubSource()446 self.source = self.test_publisher.getPubSource()
@@ -458,8 +458,8 @@ class CopyCheckerQueries(TestCaseWithFactory,
458 sources = []458 sources = []
459 for i in range(nb_of_sources):459 for i in range(nb_of_sources):
460 source = self.test_publisher.getPubSource(460 source = self.test_publisher.getPubSource(
461 version=u'%d' % self.factory.getUniqueInteger(),461 version='%d' % self.factory.getUniqueInteger(),
462 sourcename=u'name-%d' % self.factory.getUniqueInteger())462 sourcename='name-%d' % self.factory.getUniqueInteger())
463 sources.append(source)463 sources.append(source)
464 return sources464 return sources
465465
@@ -486,7 +486,7 @@ class CopyCheckerQueries(TestCaseWithFactory,
486 recorder0 = self._recordCopyCheck(0, self.person, True)486 recorder0 = self._recordCopyCheck(0, self.person, True)
487 self.addDetail(487 self.addDetail(
488 "statement-count-0-sources",488 "statement-count-0-sources",
489 text_content(u"%d" % recorder0.count))489 text_content("%d" % recorder0.count))
490 self.assertThat(recorder0, HasQueryCount(Equals(0)))490 self.assertThat(recorder0, HasQueryCount(Equals(0)))
491491
492 # Compare the number of queries issued by calling checkCopy with492 # Compare the number of queries issued by calling checkCopy with
@@ -495,12 +495,12 @@ class CopyCheckerQueries(TestCaseWithFactory,
495 recorder1 = self._recordCopyCheck(nb_of_sources, self.person, True)495 recorder1 = self._recordCopyCheck(nb_of_sources, self.person, True)
496 self.addDetail(496 self.addDetail(
497 "statement-count-%d-sources" % nb_of_sources,497 "statement-count-%d-sources" % nb_of_sources,
498 text_content(u"%d" % recorder1.count))498 text_content("%d" % recorder1.count))
499 recorder2 = self._recordCopyCheck(499 recorder2 = self._recordCopyCheck(
500 nb_of_sources + 1, self.person, True)500 nb_of_sources + 1, self.person, True)
501 self.addDetail(501 self.addDetail(
502 "statement-count-%d-sources" % (nb_of_sources + 1),502 "statement-count-%d-sources" % (nb_of_sources + 1),
503 text_content(u"%d" % recorder2.count))503 text_content("%d" % recorder2.count))
504504
505 statement_count_per_source = 13505 statement_count_per_source = 13
506 self.assertThat(506 self.assertThat(
@@ -518,7 +518,7 @@ class CopyCheckerQueries(TestCaseWithFactory,
518 (recorder2.count - recorder1.count) / float(nb_of_sources))518 (recorder2.count - recorder1.count) / float(nb_of_sources))
519 self.addDetail(519 self.addDetail(
520 "added-statement-count-perm-check",520 "added-statement-count-perm-check",
521 text_content(u"%.3f" % added_statement_count_per_source))521 text_content("%.3f" % added_statement_count_per_source))
522522
523 perm_check_statement_count = 3523 perm_check_statement_count = 3
524 self.assertThat(524 self.assertThat(
@@ -531,7 +531,7 @@ class CopyCheckerSameArchiveHarness(TestCaseWithFactory,
531 layer = LaunchpadZopelessLayer531 layer = LaunchpadZopelessLayer
532532
533 def setUp(self):533 def setUp(self):
534 super(CopyCheckerSameArchiveHarness, self).setUp()534 super().setUp()
535 self.test_publisher = SoyuzTestPublisher()535 self.test_publisher = SoyuzTestPublisher()
536 self.test_publisher.prepareBreezyAutotest()536 self.test_publisher.prepareBreezyAutotest()
537 self.source = self.test_publisher.getPubSource()537 self.source = self.test_publisher.getPubSource()
@@ -609,7 +609,7 @@ class CopyCheckerDifferentArchiveHarness(TestCaseWithFactory,
609 layer = LaunchpadZopelessLayer609 layer = LaunchpadZopelessLayer
610610
611 def setUp(self):611 def setUp(self):
612 super(CopyCheckerDifferentArchiveHarness, self).setUp()612 super().setUp()
613 self.test_publisher = SoyuzTestPublisher()613 self.test_publisher = SoyuzTestPublisher()
614 self.test_publisher.prepareBreezyAutotest()614 self.test_publisher.prepareBreezyAutotest()
615 self.source = self.test_publisher.getPubSource()615 self.source = self.test_publisher.getPubSource()
@@ -825,7 +825,7 @@ class CopyCheckerTestCase(TestCaseWithFactory):
825 layer = LaunchpadZopelessLayer825 layer = LaunchpadZopelessLayer
826826
827 def setUp(self):827 def setUp(self):
828 super(CopyCheckerTestCase, self).setUp()828 super().setUp()
829 self.test_publisher = SoyuzTestPublisher()829 self.test_publisher = SoyuzTestPublisher()
830 self.test_publisher.prepareBreezyAutotest()830 self.test_publisher.prepareBreezyAutotest()
831831
@@ -1051,7 +1051,7 @@ class BaseDoCopyTests:
1051 layer = LaunchpadZopelessLayer1051 layer = LaunchpadZopelessLayer
10521052
1053 def setUp(self):1053 def setUp(self):
1054 super(BaseDoCopyTests, self).setUp()1054 super().setUp()
1055 for arch in ('i386', 'hppa'):1055 for arch in ('i386', 'hppa'):
1056 self.factory.makeProcessor(name='my_%s' % arch)1056 self.factory.makeProcessor(name='my_%s' % arch)
10571057
@@ -1130,14 +1130,14 @@ class BaseDoCopyTests:
1130class TestDoDirectCopy(BaseDoCopyTests, TestCaseWithFactory):1130class TestDoDirectCopy(BaseDoCopyTests, TestCaseWithFactory):
11311131
1132 def setUp(self):1132 def setUp(self):
1133 super(TestDoDirectCopy, self).setUp()1133 super().setUp()
1134 self.test_publisher = SoyuzTestPublisher()1134 self.test_publisher = SoyuzTestPublisher()
1135 self.test_publisher.prepareBreezyAutotest()1135 self.test_publisher.prepareBreezyAutotest()
11361136
1137 def assertCopied(self, copies, series, arch_tags):1137 def assertCopied(self, copies, series, arch_tags):
1138 self.assertEqual(1138 self.assertEqual(
1139 [u'foo 666 in %s' % series.name] +1139 ['foo 666 in %s' % series.name] +
1140 [u'foo-bin 666 in %s %s' % (series.name, arch_tag)1140 ['foo-bin 666 in %s %s' % (series.name, arch_tag)
1141 for arch_tag in arch_tags],1141 for arch_tag in arch_tags],
1142 [copy.displayname for copy in copies])1142 [copy.displayname for copy in copies])
11431143
@@ -1782,7 +1782,7 @@ class TestCopyBuildRecords(TestCaseWithFactory):
1782 layer = LaunchpadZopelessLayer1782 layer = LaunchpadZopelessLayer
17831783
1784 def setUp(self):1784 def setUp(self):
1785 super(TestCopyBuildRecords, self).setUp()1785 super().setUp()
1786 self.test_publisher = SoyuzTestPublisher()1786 self.test_publisher = SoyuzTestPublisher()
1787 self.test_publisher.prepareBreezyAutotest()1787 self.test_publisher.prepareBreezyAutotest()
1788 self.primary = self.test_publisher.ubuntutest.main_archive1788 self.primary = self.test_publisher.ubuntutest.main_archive
@@ -2047,7 +2047,7 @@ class TestCopyClosesBugs(TestCaseWithFactory):
2047 layer = LaunchpadZopelessLayer2047 layer = LaunchpadZopelessLayer
20482048
2049 def setUp(self):2049 def setUp(self):
2050 super(TestCopyClosesBugs, self).setUp()2050 super().setUp()
2051 self.test_publisher = SoyuzTestPublisher()2051 self.test_publisher = SoyuzTestPublisher()
2052 self.test_publisher.prepareBreezyAutotest()2052 self.test_publisher.prepareBreezyAutotest()
2053 self.ubuntutest = self.test_publisher.ubuntutest2053 self.ubuntutest = self.test_publisher.ubuntutest
diff --git a/lib/lp/soyuz/scripts/tests/test_expire_archive_files.py b/lib/lp/soyuz/scripts/tests/test_expire_archive_files.py
index fefef02..a5d381d 100644
--- a/lib/lp/soyuz/scripts/tests/test_expire_archive_files.py
+++ b/lib/lp/soyuz/scripts/tests/test_expire_archive_files.py
@@ -28,7 +28,7 @@ class ArchiveExpiryTestBase(TestCaseWithFactory):
2828
29 def setUp(self):29 def setUp(self):
30 """Set up some test publications."""30 """Set up some test publications."""
31 super(ArchiveExpiryTestBase, self).setUp()31 super().setUp()
32 # Configure the test publisher.32 # Configure the test publisher.
33 switch_dbuser("launchpad")33 switch_dbuser("launchpad")
34 self.stp = SoyuzTestPublisher()34 self.stp = SoyuzTestPublisher()
@@ -100,7 +100,7 @@ class ArchiveExpiryTestBase(TestCaseWithFactory):
100 "lfa.expires should be None, but it's not.")100 "lfa.expires should be None, but it's not.")
101101
102102
103class ArchiveExpiryCommonTests(object):103class ArchiveExpiryCommonTests:
104 """Common source/binary expiration test cases.104 """Common source/binary expiration test cases.
105105
106 These will be shared irrespective of archive type (ppa/partner).106 These will be shared irrespective of archive type (ppa/partner).
@@ -233,7 +233,7 @@ class TestPPAExpiry(ArchiveExpiryTestBase, ArchiveExpiryCommonTests):
233233
234 def setUp(self):234 def setUp(self):
235 """Set up some test publications."""235 """Set up some test publications."""
236 super(TestPPAExpiry, self).setUp()236 super().setUp()
237 # Prepare two PPAs for the tests to use.237 # Prepare two PPAs for the tests to use.
238 self.archive = self.factory.makeArchive(238 self.archive = self.factory.makeArchive(
239 distribution=getUtility(IDistributionSet)['ubuntutest'])239 distribution=getUtility(IDistributionSet)['ubuntutest'])
@@ -287,7 +287,7 @@ class TestPartnerExpiry(ArchiveExpiryTestBase, ArchiveExpiryCommonTests):
287287
288 def setUp(self):288 def setUp(self):
289 """Set up the partner archives under test."""289 """Set up the partner archives under test."""
290 super(TestPartnerExpiry, self).setUp()290 super().setUp()
291 # Prepare two partner archives for the tests to use.291 # Prepare two partner archives for the tests to use.
292 self.archive = getUtility(IDistributionSet)[292 self.archive = getUtility(IDistributionSet)[
293 'ubuntutest'].getArchiveByComponent('partner')293 'ubuntutest'].getArchiveByComponent('partner')
diff --git a/lib/lp/soyuz/scripts/tests/test_gina.py b/lib/lp/soyuz/scripts/tests/test_gina.py
index 69720b1..f8174f3 100644
--- a/lib/lp/soyuz/scripts/tests/test_gina.py
+++ b/lib/lp/soyuz/scripts/tests/test_gina.py
@@ -248,7 +248,7 @@ class TestSourcePackageData(TestCaseWithFactory):
248 # called in such a way as to cope with non-UTF-8 file names on248 # called in such a way as to cope with non-UTF-8 file names on
249 # Python 2. See249 # Python 2. See
250 # https://bugs.launchpad.net/launchpad/+bug/1917449.250 # https://bugs.launchpad.net/launchpad/+bug/1917449.
251 orig_tar.add_file(u"Ć­slenska.alias", b"Non-UTF-8 file name")251 orig_tar.add_file("Ć­slenska.alias", b"Non-UTF-8 file name")
252 orig_tar.close()252 orig_tar.close()
253 buffer.seek(0)253 buffer.seek(0)
254 orig_tar_contents = buffer.read()254 orig_tar_contents = buffer.read()
@@ -309,7 +309,7 @@ class TestSourcePackageData(TestCaseWithFactory):
309 # called in such a way as to cope with non-UTF-8 file names on309 # called in such a way as to cope with non-UTF-8 file names on
310 # Python 2. See310 # Python 2. See
311 # https://bugs.launchpad.net/launchpad/+bug/1917449.311 # https://bugs.launchpad.net/launchpad/+bug/1917449.
312 orig_tar.add_file(u"Ć­slenska.alias", b"Non-UTF-8 file name")312 orig_tar.add_file("Ć­slenska.alias", b"Non-UTF-8 file name")
313 orig_tar.close()313 orig_tar.close()
314 buffer.seek(0)314 buffer.seek(0)
315 orig_tar_contents = buffer.read()315 orig_tar_contents = buffer.read()
diff --git a/lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py b/lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py
index b3edb46..f3fa2cc 100644
--- a/lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py
+++ b/lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py
@@ -194,10 +194,10 @@ class InitializationHelperTestCase(TestCaseWithFactory):
194 # Setup the environment for testing the packaging links194 # Setup the environment for testing the packaging links
195 self.parent, self.parent_das = self.setupParent()195 self.parent, self.parent_das = self.setupParent()
196 test1 = getUtility(IPackagesetSet).new(196 test1 = getUtility(IPackagesetSet).new(
197 u'test1', u'test 1 packageset', self.parent.owner,197 'test1', 'test 1 packageset', self.parent.owner,
198 distroseries=self.parent)198 distroseries=self.parent)
199 test2 = getUtility(IPackagesetSet).new(199 test2 = getUtility(IPackagesetSet).new(
200 u'test2', u'test 2 packageset', self.parent.owner,200 'test2', 'test 2 packageset', self.parent.owner,
201 distroseries=self.parent)201 distroseries=self.parent)
202 packages_test1 = ['udev', 'chromium', 'libc6']202 packages_test1 = ['udev', 'chromium', 'libc6']
203 packages_test2 = ['postgresql', 'vim']203 packages_test2 = ['postgresql', 'vim']
@@ -351,9 +351,9 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
351 # packagesets selected for the copy will make the queue check fail.351 # packagesets selected for the copy will make the queue check fail.
352 parent, parent_das = self.setupParent()352 parent, parent_das = self.setupParent()
353 p1, packageset1, unsed = self.createPackageInPackageset(353 p1, packageset1, unsed = self.createPackageInPackageset(
354 parent, u'p1', u'packageset1', True)354 parent, 'p1', 'packageset1', True)
355 p2, packageset2, unsed = self.createPackageInPackageset(355 p2, packageset2, unsed = self.createPackageInPackageset(
356 parent, u'p2', u'packageset2', False)356 parent, 'p2', 'packageset2', False)
357357
358 child = self.factory.makeDistroSeries(358 child = self.factory.makeDistroSeries(
359 distribution=parent.distribution, previous_series=parent)359 distribution=parent.distribution, previous_series=parent)
@@ -371,9 +371,9 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
371 # packagesets selected for the copy won't make the queue check fail.371 # packagesets selected for the copy won't make the queue check fail.
372 parent, parent_das = self.setupParent()372 parent, parent_das = self.setupParent()
373 p1, packageset1, unused = self.createPackageInPackageset(373 p1, packageset1, unused = self.createPackageInPackageset(
374 parent, u'p1', u'packageset1', True)374 parent, 'p1', 'packageset1', True)
375 p2, packageset2, unused = self.createPackageInPackageset(375 p2, packageset2, unused = self.createPackageInPackageset(
376 parent, u'p2', u'packageset2', False)376 parent, 'p2', 'packageset2', False)
377377
378 child = self.factory.makeDistroSeries(378 child = self.factory.makeDistroSeries(
379 distribution=parent.distribution, previous_series=parent)379 distribution=parent.distribution, previous_series=parent)
@@ -596,9 +596,9 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
596 # initialize.596 # initialize.
597 parent, parent_das = self.setupParent()597 parent, parent_das = self.setupParent()
598 p1, packageset1, spr1 = self.createPackageInPackageset(598 p1, packageset1, spr1 = self.createPackageInPackageset(
599 parent, u'p1', u'packageset1', False)599 parent, 'p1', 'packageset1', False)
600 p2, packageset2, spr2 = self.createPackageInPackageset(600 p2, packageset2, spr2 = self.createPackageInPackageset(
601 parent, u'p2', u'packageset2', False)601 parent, 'p2', 'packageset2', False)
602602
603 # Create a binary package upload for the package 'p2' inside603 # Create a binary package upload for the package 'p2' inside
604 # packageset 'packageset2'.604 # packageset 'packageset2'.
@@ -622,7 +622,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
622 # initialize.622 # initialize.
623 parent, parent_das = self.setupParent()623 parent, parent_das = self.setupParent()
624 p1, packageset1, spr1 = self.createPackageInPackageset(624 p1, packageset1, spr1 = self.createPackageInPackageset(
625 parent, u'p1', u'packageset1', False)625 parent, 'p1', 'packageset1', False)
626626
627 # Create a binary package upload for the package 'p2' inside627 # Create a binary package upload for the package 'p2' inside
628 # packageset 'packageset2'.628 # packageset 'packageset2'.
@@ -648,31 +648,31 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
648 child_pocket=PackagePublishingPocket.RELEASE):648 child_pocket=PackagePublishingPocket.RELEASE):
649 # Check that 'udev' has been copied correctly.649 # Check that 'udev' has been copied correctly.
650 parent_udev_pubs = parent.main_archive.getPublishedSources(650 parent_udev_pubs = parent.main_archive.getPublishedSources(
651 u'udev', distroseries=parent)651 'udev', distroseries=parent)
652 child_udev_pubs = child.main_archive.getPublishedSources(652 child_udev_pubs = child.main_archive.getPublishedSources(
653 u'udev', distroseries=child)653 'udev', distroseries=child)
654 self.assertEqual(654 self.assertEqual(
655 parent_udev_pubs.count(), child_udev_pubs.count())655 parent_udev_pubs.count(), child_udev_pubs.count())
656 self.assertEqual(656 self.assertEqual(
657 {child_pocket}, {pub.pocket for pub in child_udev_pubs})657 {child_pocket}, {pub.pocket for pub in child_udev_pubs})
658 parent_arch_udev_pubs = parent.main_archive.getAllPublishedBinaries(658 parent_arch_udev_pubs = parent.main_archive.getAllPublishedBinaries(
659 distroarchseries=parent[parent_das.architecturetag], name=u'udev')659 distroarchseries=parent[parent_das.architecturetag], name='udev')
660 child_arch_udev_pubs = child.main_archive.getAllPublishedBinaries(660 child_arch_udev_pubs = child.main_archive.getAllPublishedBinaries(
661 distroarchseries=child[parent_das.architecturetag], name=u'udev')661 distroarchseries=child[parent_das.architecturetag], name='udev')
662 self.assertEqual(662 self.assertEqual(
663 parent_arch_udev_pubs.count(), child_arch_udev_pubs.count())663 parent_arch_udev_pubs.count(), child_arch_udev_pubs.count())
664 self.assertEqual(664 self.assertEqual(
665 {child_pocket}, {pub.pocket for pub in child_arch_udev_pubs})665 {child_pocket}, {pub.pocket for pub in child_arch_udev_pubs})
666 # And the binary package, and linked source package look fine too.666 # And the binary package, and linked source package look fine too.
667 udev_bin = child_arch_udev_pubs[0].binarypackagerelease667 udev_bin = child_arch_udev_pubs[0].binarypackagerelease
668 self.assertEqual(udev_bin.title, u'udev-0.1-1')668 self.assertEqual(udev_bin.title, 'udev-0.1-1')
669 self.assertEqual(669 self.assertEqual(
670 udev_bin.build.title,670 udev_bin.build.title,
671 u'%s build of udev 0.1-1 in %s %s RELEASE' % (671 '%s build of udev 0.1-1 in %s %s RELEASE' % (
672 parent_das.architecturetag, parent.parent.name,672 parent_das.architecturetag, parent.parent.name,
673 parent.name))673 parent.name))
674 udev_src = udev_bin.build.source_package_release674 udev_src = udev_bin.build.source_package_release
675 self.assertEqual(udev_src.title, u'udev - 0.1-1')675 self.assertEqual(udev_src.title, 'udev - 0.1-1')
676 # The build of udev 0.1-1 has been copied across.676 # The build of udev 0.1-1 has been copied across.
677 bpbs = getUtility(IBinaryPackageBuildSet)677 bpbs = getUtility(IBinaryPackageBuildSet)
678 child_udev = bpbs.findBuiltOrPublishedBySourceAndArchive(678 child_udev = bpbs.findBuiltOrPublishedBySourceAndArchive(
@@ -721,22 +721,22 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
721 self.parent, self.parent_das = self.setupParent()721 self.parent, self.parent_das = self.setupParent()
722 uploader = self.factory.makePerson()722 uploader = self.factory.makePerson()
723 test1 = getUtility(IPackagesetSet).new(723 test1 = getUtility(IPackagesetSet).new(
724 u'test1', u'test 1 packageset', self.parent.owner,724 'test1', 'test 1 packageset', self.parent.owner,
725 distroseries=self.parent)725 distroseries=self.parent)
726 test2 = getUtility(IPackagesetSet).new(726 test2 = getUtility(IPackagesetSet).new(
727 u'test2', u'test 2 packageset', self.parent.owner,727 'test2', 'test 2 packageset', self.parent.owner,
728 distroseries=self.parent)728 distroseries=self.parent)
729 test3 = getUtility(IPackagesetSet).new(729 test3 = getUtility(IPackagesetSet).new(
730 u'test3', u'test 3 packageset', self.parent.owner,730 'test3', 'test 3 packageset', self.parent.owner,
731 distroseries=self.parent, related_set=test2)731 distroseries=self.parent, related_set=test2)
732 test1.addSources('udev')732 test1.addSources('udev')
733 getUtility(IArchivePermissionSet).newPackagesetUploader(733 getUtility(IArchivePermissionSet).newPackagesetUploader(
734 self.parent.main_archive, uploader, test1)734 self.parent.main_archive, uploader, test1)
735 child = self._fullInitialize([self.parent])735 child = self._fullInitialize([self.parent])
736 # We can fetch the copied sets from the child.736 # We can fetch the copied sets from the child.
737 child_test1 = getUtility(IPackagesetSet).getByName(child, u'test1')737 child_test1 = getUtility(IPackagesetSet).getByName(child, 'test1')
738 child_test2 = getUtility(IPackagesetSet).getByName(child, u'test2')738 child_test2 = getUtility(IPackagesetSet).getByName(child, 'test2')
739 child_test3 = getUtility(IPackagesetSet).getByName(child, u'test3')739 child_test3 = getUtility(IPackagesetSet).getByName(child, 'test3')
740 # And we can see they are exact copies, with the related_set for the740 # And we can see they are exact copies, with the related_set for the
741 # copies pointing to the packageset in the parent.741 # copies pointing to the packageset in the parent.
742 self.assertEqual(test1.description, child_test1.description)742 self.assertEqual(test1.description, child_test1.description)
@@ -765,7 +765,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
765 packages={'firefox': '3.1'})765 packages={'firefox': '3.1'})
766 uploader = self.factory.makePerson()766 uploader = self.factory.makePerson()
767 test1 = getUtility(IPackagesetSet).new(767 test1 = getUtility(IPackagesetSet).new(
768 u'test1', u'test 1 packageset', self.parent1.owner,768 'test1', 'test 1 packageset', self.parent1.owner,
769 distroseries=self.parent1)769 distroseries=self.parent1)
770 test1.addSources('udev')770 test1.addSources('udev')
771 test1.addSources('firefox')771 test1.addSources('firefox')
@@ -782,7 +782,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
782 s.sourcepackagerelease.version)782 s.sourcepackagerelease.version)
783 for s in published_sources)783 for s in published_sources)
784 self.assertContentEqual(784 self.assertContentEqual(
785 [(u'udev', u'0.1-1'), (u'firefox', u'2.1')],785 [('udev', '0.1-1'), ('firefox', '2.1')],
786 pub_sources)786 pub_sources)
787787
788 def test_copying_packagesets_no_duplication(self):788 def test_copying_packagesets_no_duplication(self):
@@ -792,7 +792,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
792 parent = self._fullInitialize([previous_parent])792 parent = self._fullInitialize([previous_parent])
793 self.factory.makeSourcePackagePublishingHistory(distroseries=parent)793 self.factory.makeSourcePackagePublishingHistory(distroseries=parent)
794 p1, parent_packageset, _ = self.createPackageInPackageset(794 p1, parent_packageset, _ = self.createPackageInPackageset(
795 parent, u"p1", u"packageset")795 parent, "p1", "packageset")
796 uploader1 = self.factory.makePerson()796 uploader1 = self.factory.makePerson()
797 getUtility(IArchivePermissionSet).newPackagesetUploader(797 getUtility(IArchivePermissionSet).newPackagesetUploader(
798 parent.main_archive, uploader1, parent_packageset)798 parent.main_archive, uploader1, parent_packageset)
@@ -802,8 +802,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
802 # Make sure the child's packageset has disjoint packages and802 # Make sure the child's packageset has disjoint packages and
803 # permissions.803 # permissions.
804 p2, child_packageset, _ = self.createPackageInPackageset(804 p2, child_packageset, _ = self.createPackageInPackageset(
805 child, u"p2", u"packageset")805 child, "p2", "packageset")
806 child_packageset.removeSources([u"p1"])806 child_packageset.removeSources(["p1"])
807 uploader2 = self.factory.makePerson()807 uploader2 = self.factory.makePerson()
808 getUtility(IArchivePermissionSet).newPackagesetUploader(808 getUtility(IArchivePermissionSet).newPackagesetUploader(
809 child.main_archive, uploader2, child_packageset)809 child.main_archive, uploader2, child_packageset)
@@ -834,7 +834,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
834 uploader = self.factory.makePerson()834 uploader = self.factory.makePerson()
835 releaser = self.factory.makePerson()835 releaser = self.factory.makePerson()
836 test1 = self.factory.makePackageset(836 test1 = self.factory.makePackageset(
837 u'test1', u'test 1 packageset', parent.owner,837 'test1', 'test 1 packageset', parent.owner,
838 distroseries=parent)838 distroseries=parent)
839 #test1 = getUtility(IPackagesetSet).new(839 #test1 = getUtility(IPackagesetSet).new(
840 # u'test1', u'test 1 packageset', self.parent.owner,840 # u'test1', u'test 1 packageset', self.parent.owner,
@@ -876,7 +876,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
876 uploader = self.factory.makePerson()876 uploader = self.factory.makePerson()
877 releaser = self.factory.makePerson()877 releaser = self.factory.makePerson()
878 test1 = getUtility(IPackagesetSet).new(878 test1 = getUtility(IPackagesetSet).new(
879 u'test1', u'test 1 packageset', self.parent.owner,879 'test1', 'test 1 packageset', self.parent.owner,
880 distroseries=self.parent)880 distroseries=self.parent)
881 test1.addSources('udev')881 test1.addSources('udev')
882 archive_permset = getUtility(IArchivePermissionSet)882 archive_permset = getUtility(IArchivePermissionSet)
@@ -1030,10 +1030,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1030 self.parent, self.parent_das = self.setupParent(packages={})1030 self.parent, self.parent_das = self.setupParent(packages={})
1031 ps_owner = self.factory.makePerson()1031 ps_owner = self.factory.makePerson()
1032 getUtility(IPackagesetSet).new(1032 getUtility(IPackagesetSet).new(
1033 u'ps', u'packageset', ps_owner, distroseries=self.parent)1033 'ps', 'packageset', ps_owner, distroseries=self.parent)
1034 child = self._fullInitialize(1034 child = self._fullInitialize(
1035 [self.parent], distribution=self.parent.distribution)1035 [self.parent], distribution=self.parent.distribution)
1036 child_ps = getUtility(IPackagesetSet).getByName(child, u'ps')1036 child_ps = getUtility(IPackagesetSet).getByName(child, 'ps')
1037 self.assertEqual(ps_owner, child_ps.owner)1037 self.assertEqual(ps_owner, child_ps.owner)
10381038
1039 def test_packageset_owner_not_preserved_cross_distro(self):1039 def test_packageset_owner_not_preserved_cross_distro(self):
@@ -1041,10 +1041,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1041 # packagesets are owned by the new distro owner.1041 # packagesets are owned by the new distro owner.
1042 self.parent, self.parent_das = self.setupParent()1042 self.parent, self.parent_das = self.setupParent()
1043 getUtility(IPackagesetSet).new(1043 getUtility(IPackagesetSet).new(
1044 u'ps', u'packageset', self.factory.makePerson(),1044 'ps', 'packageset', self.factory.makePerson(),
1045 distroseries=self.parent)1045 distroseries=self.parent)
1046 child = self._fullInitialize([self.parent])1046 child = self._fullInitialize([self.parent])
1047 child_ps = getUtility(IPackagesetSet).getByName(child, u'ps')1047 child_ps = getUtility(IPackagesetSet).getByName(child, 'ps')
1048 self.assertEqual(child.owner, child_ps.owner)1048 self.assertEqual(child.owner, child_ps.owner)
10491049
1050 def test_copy_limit_packagesets(self):1050 def test_copy_limit_packagesets(self):
@@ -1052,23 +1052,23 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1052 # want to copy.1052 # want to copy.
1053 self.parent, self.parent_das = self.setupParent()1053 self.parent, self.parent_das = self.setupParent()
1054 test1 = getUtility(IPackagesetSet).new(1054 test1 = getUtility(IPackagesetSet).new(
1055 u'test1', u'test 1 packageset', self.parent.owner,1055 'test1', 'test 1 packageset', self.parent.owner,
1056 distroseries=self.parent)1056 distroseries=self.parent)
1057 getUtility(IPackagesetSet).new(1057 getUtility(IPackagesetSet).new(
1058 u'test2', u'test 2 packageset', self.parent.owner,1058 'test2', 'test 2 packageset', self.parent.owner,
1059 distroseries=self.parent)1059 distroseries=self.parent)
1060 packages = ('udev', 'chromium', 'libc6')1060 packages = ('udev', 'chromium', 'libc6')
1061 for pkg in packages:1061 for pkg in packages:
1062 test1.addSources(pkg)1062 test1.addSources(pkg)
1063 packageset1 = getUtility(IPackagesetSet).getByName(1063 packageset1 = getUtility(IPackagesetSet).getByName(
1064 self.parent, u'test1')1064 self.parent, 'test1')
1065 child = self._fullInitialize(1065 child = self._fullInitialize(
1066 [self.parent], packagesets=(str(packageset1.id),))1066 [self.parent], packagesets=(str(packageset1.id),))
1067 child_test1 = getUtility(IPackagesetSet).getByName(child, u'test1')1067 child_test1 = getUtility(IPackagesetSet).getByName(child, 'test1')
1068 self.assertEqual(test1.description, child_test1.description)1068 self.assertEqual(test1.description, child_test1.description)
1069 self.assertRaises(1069 self.assertRaises(
1070 NoSuchPackageSet, getUtility(IPackagesetSet).getByName,1070 NoSuchPackageSet, getUtility(IPackagesetSet).getByName,
1071 child, u'test2')1071 child, 'test2')
1072 parent_srcs = test1.getSourcesIncluded(direct_inclusion=True)1072 parent_srcs = test1.getSourcesIncluded(direct_inclusion=True)
1073 child_srcs = child_test1.getSourcesIncluded(1073 child_srcs = child_test1.getSourcesIncluded(
1074 direct_inclusion=True)1074 direct_inclusion=True)
@@ -1081,10 +1081,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1081 # If a parent series has packagesets, we don't want to copy any of them1081 # If a parent series has packagesets, we don't want to copy any of them
1082 self.parent, self.parent_das = self.setupParent()1082 self.parent, self.parent_das = self.setupParent()
1083 test1 = getUtility(IPackagesetSet).new(1083 test1 = getUtility(IPackagesetSet).new(
1084 u'test1', u'test 1 packageset', self.parent.owner,1084 'test1', 'test 1 packageset', self.parent.owner,
1085 distroseries=self.parent)1085 distroseries=self.parent)
1086 getUtility(IPackagesetSet).new(1086 getUtility(IPackagesetSet).new(
1087 u'test2', u'test 2 packageset', self.parent.owner,1087 'test2', 'test 2 packageset', self.parent.owner,
1088 distroseries=self.parent)1088 distroseries=self.parent)
1089 packages = ('udev', 'chromium', 'libc6')1089 packages = ('udev', 'chromium', 'libc6')
1090 for pkg in packages:1090 for pkg in packages:
@@ -1093,10 +1093,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1093 [self.parent], packagesets=[])1093 [self.parent], packagesets=[])
1094 self.assertRaises(1094 self.assertRaises(
1095 NoSuchPackageSet, getUtility(IPackagesetSet).getByName,1095 NoSuchPackageSet, getUtility(IPackagesetSet).getByName,
1096 child, u'test1')1096 child, 'test1')
1097 self.assertRaises(1097 self.assertRaises(
1098 NoSuchPackageSet, getUtility(IPackagesetSet).getByName,1098 NoSuchPackageSet, getUtility(IPackagesetSet).getByName,
1099 child, u'test2')1099 child, 'test2')
1100 self.assertEqual(child.sourcecount, 0)1100 self.assertEqual(child.sourcecount, 0)
1101 self.assertEqual(child.binarycount, 0)1101 self.assertEqual(child.binarycount, 0)
11021102
@@ -1104,10 +1104,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1104 # If a parent series has packagesets, we want to copy all of them1104 # If a parent series has packagesets, we want to copy all of them
1105 self.parent, self.parent_das = self.setupParent()1105 self.parent, self.parent_das = self.setupParent()
1106 test1 = getUtility(IPackagesetSet).new(1106 test1 = getUtility(IPackagesetSet).new(
1107 u'test1', u'test 1 packageset', self.parent.owner,1107 'test1', 'test 1 packageset', self.parent.owner,
1108 distroseries=self.parent)1108 distroseries=self.parent)
1109 test2 = getUtility(IPackagesetSet).new(1109 test2 = getUtility(IPackagesetSet).new(
1110 u'test2', u'test 2 packageset', self.parent.owner,1110 'test2', 'test 2 packageset', self.parent.owner,
1111 distroseries=self.parent)1111 distroseries=self.parent)
1112 packages_test1 = ('udev', 'chromium', 'libc6')1112 packages_test1 = ('udev', 'chromium', 'libc6')
1113 packages_test2 = ('postgresql', 'vim')1113 packages_test2 = ('postgresql', 'vim')
@@ -1117,8 +1117,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1117 test2.addSources(pkg)1117 test2.addSources(pkg)
1118 child = self._fullInitialize(1118 child = self._fullInitialize(
1119 [self.parent], packagesets=None)1119 [self.parent], packagesets=None)
1120 child_test1 = getUtility(IPackagesetSet).getByName(child, u'test1')1120 child_test1 = getUtility(IPackagesetSet).getByName(child, 'test1')
1121 child_test2 = getUtility(IPackagesetSet).getByName(child, u'test2')1121 child_test2 = getUtility(IPackagesetSet).getByName(child, 'test2')
1122 self.assertEqual(test1.description, child_test1.description)1122 self.assertEqual(test1.description, child_test1.description)
1123 self.assertEqual(test2.description, child_test2.description)1123 self.assertEqual(test2.description, child_test2.description)
1124 parent_srcs_test1 = test1.getSourcesIncluded(direct_inclusion=True)1124 parent_srcs_test1 = test1.getSourcesIncluded(direct_inclusion=True)
@@ -1139,7 +1139,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1139 # the packaging links for the copied packages are copied.1139 # the packaging links for the copied packages are copied.
1140 packages_test1, packages_test2 = self.setupPackagingTesting()1140 packages_test1, packages_test2 = self.setupPackagingTesting()
1141 packageset1 = getUtility(IPackagesetSet).getByName(1141 packageset1 = getUtility(IPackagesetSet).getByName(
1142 self.parent, u'test1')1142 self.parent, 'test1')
1143 child = self._fullInitialize(1143 child = self._fullInitialize(
1144 [self.parent], packagesets=(str(packageset1.id),))1144 [self.parent], packagesets=(str(packageset1.id),))
1145 packagings = child.getMostRecentlyLinkedPackagings()1145 packagings = child.getMostRecentlyLinkedPackagings()
@@ -1197,10 +1197,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1197 # for the copied source will be created.1197 # for the copied source will be created.
1198 self.parent, self.parent_das = self.setupParent()1198 self.parent, self.parent_das = self.setupParent()
1199 test1 = getUtility(IPackagesetSet).new(1199 test1 = getUtility(IPackagesetSet).new(
1200 u'test1', u'test 1 packageset', self.parent.owner,1200 'test1', 'test 1 packageset', self.parent.owner,
1201 distroseries=self.parent)1201 distroseries=self.parent)
1202 getUtility(IPackagesetSet).new(1202 getUtility(IPackagesetSet).new(
1203 u'test2', u'test 2 packageset', self.parent.owner,1203 'test2', 'test 2 packageset', self.parent.owner,
1204 distroseries=self.parent)1204 distroseries=self.parent)
1205 packages = ('udev', 'chromium')1205 packages = ('udev', 'chromium')
1206 for pkg in packages:1206 for pkg in packages:
@@ -1331,10 +1331,10 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1331 uploader1 = self.factory.makePerson()1331 uploader1 = self.factory.makePerson()
1332 uploader2 = self.factory.makePerson()1332 uploader2 = self.factory.makePerson()
1333 test1_parent1 = getUtility(IPackagesetSet).new(1333 test1_parent1 = getUtility(IPackagesetSet).new(
1334 u'test1', u'test 1 packageset', self.parent1.owner,1334 'test1', 'test 1 packageset', self.parent1.owner,
1335 distroseries=self.parent1)1335 distroseries=self.parent1)
1336 test1_parent2 = getUtility(IPackagesetSet).new(1336 test1_parent2 = getUtility(IPackagesetSet).new(
1337 u'test1', u'test 1 packageset', self.parent2.owner,1337 'test1', 'test 1 packageset', self.parent2.owner,
1338 distroseries=self.parent2)1338 distroseries=self.parent2)
1339 test1_parent1.addSources('chromium')1339 test1_parent1.addSources('chromium')
1340 test1_parent1.addSources('udev')1340 test1_parent1.addSources('udev')
@@ -1347,7 +1347,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1347 child = self._fullInitialize([self.parent1, self.parent2])1347 child = self._fullInitialize([self.parent1, self.parent2])
13481348
1349 # In the child, the identical packagesets are merged into one.1349 # In the child, the identical packagesets are merged into one.
1350 child_test1 = getUtility(IPackagesetSet).getByName(child, u'test1')1350 child_test1 = getUtility(IPackagesetSet).getByName(child, 'test1')
1351 child_srcs = child_test1.getSourcesIncluded(1351 child_srcs = child_test1.getSourcesIncluded(
1352 direct_inclusion=True)1352 direct_inclusion=True)
1353 parent1_srcs = test1_parent1.getSourcesIncluded(direct_inclusion=True)1353 parent1_srcs = test1_parent1.getSourcesIncluded(direct_inclusion=True)
@@ -1449,8 +1449,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1449 # If the series to be initialized is in a distribution with1449 # If the series to be initialized is in a distribution with
1450 # initialized series, the series is *derived* from1450 # initialized series, the series is *derived* from
1451 # the previous_series' parents.1451 # the previous_series' parents.
1452 previous_parent1, unused = self.setupParent(packages={u'p1': u'1.2'})1452 previous_parent1, unused = self.setupParent(packages={'p1': '1.2'})
1453 previous_parent2, unused = self.setupParent(packages={u'p2': u'1.5'})1453 previous_parent2, unused = self.setupParent(packages={'p2': '1.5'})
1454 child = self.setUpSeriesWithPreviousSeries(1454 child = self.setUpSeriesWithPreviousSeries(
1455 previous_parents=[previous_parent1, previous_parent2])1455 previous_parents=[previous_parent1, previous_parent2])
1456 parent, unused = self.setupParent()1456 parent, unused = self.setupParent()
@@ -1471,14 +1471,14 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1471 s.sourcepackagerelease.version)1471 s.sourcepackagerelease.version)
1472 for s in published_sources)1472 for s in published_sources)
1473 self.assertEqual(1473 self.assertEqual(
1474 [(u'p1', u'1.2'), (u'p2', u'1.5')],1474 [('p1', '1.2'), ('p2', '1.5')],
1475 pub_sources)1475 pub_sources)
14761476
1477 def test_derive_from_previous_parents_empty_parents(self):1477 def test_derive_from_previous_parents_empty_parents(self):
1478 # If an empty list is passed to InitializeDistroSeries, the1478 # If an empty list is passed to InitializeDistroSeries, the
1479 # parents of the previous series are used as parents.1479 # parents of the previous series are used as parents.
1480 previous_parent1, unused = self.setupParent(packages={u'p1': u'1.2'})1480 previous_parent1, unused = self.setupParent(packages={'p1': '1.2'})
1481 previous_parent2, unused = self.setupParent(packages={u'p2': u'1.5'})1481 previous_parent2, unused = self.setupParent(packages={'p2': '1.5'})
1482 child = self.setUpSeriesWithPreviousSeries(1482 child = self.setUpSeriesWithPreviousSeries(
1483 previous_parents=[previous_parent1, previous_parent2])1483 previous_parents=[previous_parent1, previous_parent2])
1484 # Initialize from an empty list of parents.1484 # Initialize from an empty list of parents.
@@ -1491,7 +1491,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1491 def test_derive_empty_parents_distribution_not_initialized(self):1491 def test_derive_empty_parents_distribution_not_initialized(self):
1492 # Initializing a series with an empty parent list if the series'1492 # Initializing a series with an empty parent list if the series'
1493 # distribution has no initialized series triggers an error.1493 # distribution has no initialized series triggers an error.
1494 previous_parent1, unused = self.setupParent(packages={u'p1': u'1.2'})1494 previous_parent1, unused = self.setupParent(packages={'p1': '1.2'})
1495 child = self.setUpSeriesWithPreviousSeries(1495 child = self.setUpSeriesWithPreviousSeries(
1496 previous_parents=[previous_parent1],1496 previous_parents=[previous_parent1],
1497 publish_in_distribution=False,1497 publish_in_distribution=False,
@@ -1601,7 +1601,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1601 # The new publishings, copied over from the parents, have their1601 # The new publishings, copied over from the parents, have their
1602 # 'creator' field set to None. This tests that behaviour when1602 # 'creator' field set to None. This tests that behaviour when
1603 # the cloner is used to perform the initialization.1603 # the cloner is used to perform the initialization.
1604 parent, unused = self.setupParent(packages={u'p1': u'1.2'})1604 parent, unused = self.setupParent(packages={'p1': '1.2'})
1605 child = self.setUpSeriesWithPreviousSeries(previous_parents=[parent])1605 child = self.setUpSeriesWithPreviousSeries(previous_parents=[parent])
1606 self.factory.makeSourcePackagePublishingHistory(distroseries=child)1606 self.factory.makeSourcePackagePublishingHistory(distroseries=child)
1607 self._fullInitialize([parent], child=child)1607 self._fullInitialize([parent], child=child)
@@ -1614,7 +1614,7 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1614 # The new publishings, copied over from the parents, have their1614 # The new publishings, copied over from the parents, have their
1615 # 'creator' field set to None. This tests that behaviour when1615 # 'creator' field set to None. This tests that behaviour when
1616 # the copier is used to perform the initialization.1616 # the copier is used to perform the initialization.
1617 parent, unused = self.setupParent(packages={u'p1': u'1.2'})1617 parent, unused = self.setupParent(packages={'p1': '1.2'})
1618 child = self.setUpSeriesWithPreviousSeries(previous_parents=[parent])1618 child = self.setUpSeriesWithPreviousSeries(previous_parents=[parent])
1619 self._fullInitialize([parent], child=child)1619 self._fullInitialize([parent], child=child)
16201620
@@ -1626,8 +1626,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1626 # IDS._has_same_parents_as_previous_series returns True if the1626 # IDS._has_same_parents_as_previous_series returns True if the
1627 # parents for the series to be initialized are the same as1627 # parents for the series to be initialized are the same as
1628 # previous_series' parents.1628 # previous_series' parents.
1629 prev_parent1, unused = self.setupParent(packages={u'p1': u'1.2'})1629 prev_parent1, unused = self.setupParent(packages={'p1': '1.2'})
1630 prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'})1630 prev_parent2, unused = self.setupParent(packages={'p2': '1.5'})
1631 child = self.setUpSeriesWithPreviousSeries(1631 child = self.setUpSeriesWithPreviousSeries(
1632 previous_parents=[prev_parent1, prev_parent2])1632 previous_parents=[prev_parent1, prev_parent2])
1633 # The same parents can be explicitely set.1633 # The same parents can be explicitely set.
@@ -1640,8 +1640,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1640 # IDS._has_same_parents_as_previous_series returns True if the1640 # IDS._has_same_parents_as_previous_series returns True if the
1641 # parents for the series to be initialized are the same as1641 # parents for the series to be initialized are the same as
1642 # previous_series' parents.1642 # previous_series' parents.
1643 prev_parent1, unused = self.setupParent(packages={u'p1': u'1.2'})1643 prev_parent1, unused = self.setupParent(packages={'p1': '1.2'})
1644 prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'})1644 prev_parent2, unused = self.setupParent(packages={'p2': '1.5'})
1645 child = self.setUpSeriesWithPreviousSeries(1645 child = self.setUpSeriesWithPreviousSeries(
1646 previous_parents=[prev_parent1, prev_parent2])1646 previous_parents=[prev_parent1, prev_parent2])
1647 # If no parents are provided, the parents from previous_series1647 # If no parents are provided, the parents from previous_series
@@ -1654,8 +1654,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1654 # IDS._has_same_parents_as_previous_series returns False if the1654 # IDS._has_same_parents_as_previous_series returns False if the
1655 # parents for the series to be initialized are *not* the same as1655 # parents for the series to be initialized are *not* the same as
1656 # previous_series' parents.1656 # previous_series' parents.
1657 prev_parent1, unused = self.setupParent(packages={u'p1': u'1.2'})1657 prev_parent1, unused = self.setupParent(packages={'p1': '1.2'})
1658 prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'})1658 prev_parent2, unused = self.setupParent(packages={'p2': '1.5'})
1659 child = self.setUpSeriesWithPreviousSeries(1659 child = self.setUpSeriesWithPreviousSeries(
1660 previous_parents=[prev_parent1, prev_parent2])1660 previous_parents=[prev_parent1, prev_parent2])
1661 parent3 = self.factory.makeDistroSeries()1661 parent3 = self.factory.makeDistroSeries()
@@ -1668,24 +1668,24 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1668 # Post-first initialization of a series with the same parents1668 # Post-first initialization of a series with the same parents
1669 # than those of the previous_series causes a copy of1669 # than those of the previous_series causes a copy of
1670 # previous_series' DSDs.1670 # previous_series' DSDs.
1671 prev_parent1, unused = self.setupParent(packages={u'p1': u'1.2'})1671 prev_parent1, unused = self.setupParent(packages={'p1': '1.2'})
1672 prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'})1672 prev_parent2, unused = self.setupParent(packages={'p2': '1.5'})
1673 child = self.setUpSeriesWithPreviousSeries(1673 child = self.setUpSeriesWithPreviousSeries(
1674 previous_parents=[prev_parent1, prev_parent2])1674 previous_parents=[prev_parent1, prev_parent2])
1675 self.factory.makeDistroSeriesDifference()1675 self.factory.makeDistroSeriesDifference()
1676 self.factory.makeDistroSeriesDifference(1676 self.factory.makeDistroSeriesDifference(
1677 derived_series=child.previous_series,1677 derived_series=child.previous_series,
1678 source_package_name_str=u'p1')1678 source_package_name_str='p1')
1679 self.factory.makeDistroSeriesDifference(1679 self.factory.makeDistroSeriesDifference(
1680 derived_series=child.previous_series,1680 derived_series=child.previous_series,
1681 source_package_name_str=u'p2')1681 source_package_name_str='p2')
1682 dsd_source = getUtility(IDistroSeriesDifferenceSource)1682 dsd_source = getUtility(IDistroSeriesDifferenceSource)
1683 # No DSDs for the child yet.1683 # No DSDs for the child yet.
1684 self.assertEqual(0, dsd_source.getForDistroSeries(child).count())1684 self.assertEqual(0, dsd_source.getForDistroSeries(child).count())
1685 self._fullInitialize([], child=child)1685 self._fullInitialize([], child=child)
16861686
1687 self.assertContentEqual(1687 self.assertContentEqual(
1688 [u'p1', u'p2'],1688 ['p1', 'p2'],
1689 [1689 [
1690 diff.source_package_name.name1690 diff.source_package_name.name
1691 for diff in dsd_source.getForDistroSeries(child)])1691 for diff in dsd_source.getForDistroSeries(child)])
@@ -1704,8 +1704,8 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1704 def test_initialization_first_deriv_create_dsdjs(self):1704 def test_initialization_first_deriv_create_dsdjs(self):
1705 # A first initialization of a series creates the creation1705 # A first initialization of a series creates the creation
1706 # of the DSDJs with all the parents.1706 # of the DSDJs with all the parents.
1707 parent1, unused = self.setupParent(packages={u'p1': u'1.2'})1707 parent1, unused = self.setupParent(packages={'p1': '1.2'})
1708 parent2, unused = self.setupParent(packages={u'p2': u'1.5'})1708 parent2, unused = self.setupParent(packages={'p2': '1.5'})
1709 child = self._fullInitialize([parent1, parent2])1709 child = self._fullInitialize([parent1, parent2])
17101710
1711 self.assertNotEqual([], self.getWaitingJobs(child, 'p1', parent1))1711 self.assertNotEqual([], self.getWaitingJobs(child, 'p1', parent1))
@@ -1715,12 +1715,12 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1715 # Post-first initialization of a series with different parents1715 # Post-first initialization of a series with different parents
1716 # than those of the previous_series creates the DSDJs to1716 # than those of the previous_series creates the DSDJs to
1717 # compute the DSDs with the parents.1717 # compute the DSDs with the parents.
1718 prev_parent1, unused = self.setupParent(packages={u'p1': u'1.2'})1718 prev_parent1, unused = self.setupParent(packages={'p1': '1.2'})
1719 prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'})1719 prev_parent2, unused = self.setupParent(packages={'p2': '1.5'})
1720 child = self.setUpSeriesWithPreviousSeries(1720 child = self.setUpSeriesWithPreviousSeries(
1721 previous_parents=[prev_parent1, prev_parent2])1721 previous_parents=[prev_parent1, prev_parent2])
1722 parent3, unused = self.setupParent(1722 parent3, unused = self.setupParent(
1723 packages={u'p2': u'2.5', u'p3': u'1.1'})1723 packages={'p2': '2.5', 'p3': '1.1'})
1724 self._fullInitialize(1724 self._fullInitialize(
1725 [prev_parent1, prev_parent2, parent3], child=child)1725 [prev_parent1, prev_parent2, parent3], child=child)
17261726
@@ -1736,16 +1736,16 @@ class TestInitializeDistroSeries(InitializationHelperTestCase):
1736 # packagesets creates the DSDJs for the packages inside these1736 # packagesets creates the DSDJs for the packages inside these
1737 # packagesets.1737 # packagesets.
1738 prev_parent1, unused = self.setupParent(1738 prev_parent1, unused = self.setupParent(
1739 packages={u'p1': u'1.2', u'p11': u'3.1'})1739 packages={'p1': '1.2', 'p11': '3.1'})
1740 prev_parent2, unused = self.setupParent(packages={u'p2': u'1.5'})1740 prev_parent2, unused = self.setupParent(packages={'p2': '1.5'})
1741 child = self.setUpSeriesWithPreviousSeries(1741 child = self.setUpSeriesWithPreviousSeries(
1742 previous_parents=[prev_parent1, prev_parent2])1742 previous_parents=[prev_parent1, prev_parent2])
1743 test1 = getUtility(IPackagesetSet).new(1743 test1 = getUtility(IPackagesetSet).new(
1744 u'test1', u'test 1 packageset', child.previous_series.owner,1744 'test1', 'test 1 packageset', child.previous_series.owner,
1745 distroseries=child.previous_series)1745 distroseries=child.previous_series)
1746 test1.addSources('p1')1746 test1.addSources('p1')
1747 parent3, unused = self.setupParent(1747 parent3, unused = self.setupParent(
1748 packages={u'p1': u'2.5', u'p3': u'4.4'})1748 packages={'p1': '2.5', 'p3': '4.4'})
1749 self._fullInitialize(1749 self._fullInitialize(
1750 [prev_parent1, prev_parent2, parent3], child=child,1750 [prev_parent1, prev_parent2, parent3], child=child,
1751 packagesets=(str(test1.id),))1751 packagesets=(str(test1.id),))
diff --git a/lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py b/lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py
index 166f5db..f296c35 100644
--- a/lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py
+++ b/lib/lp/soyuz/scripts/tests/test_obsoletedistroseries.py
@@ -71,7 +71,7 @@ class TestObsoleteDistroseries(TestCaseWithFactory):
7171
72 def setUp(self):72 def setUp(self):
73 """Set up test data common to all test cases."""73 """Set up test data common to all test cases."""
74 super(TestObsoleteDistroseries, self).setUp()74 super().setUp()
75 self.warty = getUtility(IDistributionSet)['ubuntu']['warty']75 self.warty = getUtility(IDistributionSet)['ubuntu']['warty']
7676
77 # Re-process the returned list otherwise it ends up being a list77 # Re-process the returned list otherwise it ends up being a list
diff --git a/lib/lp/soyuz/scripts/tests/test_populatearchive.py b/lib/lp/soyuz/scripts/tests/test_populatearchive.py
index c3b810f..d2826a3 100644
--- a/lib/lp/soyuz/scripts/tests/test_populatearchive.py
+++ b/lib/lp/soyuz/scripts/tests/test_populatearchive.py
@@ -46,14 +46,14 @@ class TestPopulateArchiveScript(TestCaseWithFactory):
4646
47 layer = LaunchpadZopelessLayer47 layer = LaunchpadZopelessLayer
48 expected_build_spns = [48 expected_build_spns = [
49 u'alsa-utils', u'cnews', u'evolution', u'libstdc++',49 'alsa-utils', 'cnews', 'evolution', 'libstdc++',
50 u'linux-source-2.6.15', u'netapplet']50 'linux-source-2.6.15', 'netapplet']
51 expected_src_names = [51 expected_src_names = [
52 u'alsa-utils 1.0.9a-4ubuntu1 in hoary',52 'alsa-utils 1.0.9a-4ubuntu1 in hoary',
53 u'cnews cr.g7-37 in hoary', u'evolution 1.0 in hoary',53 'cnews cr.g7-37 in hoary', 'evolution 1.0 in hoary',
54 u'libstdc++ b8p in hoary',54 'libstdc++ b8p in hoary',
55 u'linux-source-2.6.15 2.6.15.3 in hoary',55 'linux-source-2.6.15 2.6.15.3 in hoary',
56 u'netapplet 1.0-1 in hoary', u'pmount 0.1-2 in hoary']56 'netapplet 1.0-1 in hoary', 'pmount 0.1-2 in hoary']
57 pending_statuses = (57 pending_statuses = (
58 PackagePublishingStatus.PENDING,58 PackagePublishingStatus.PENDING,
59 PackagePublishingStatus.PUBLISHED)59 PackagePublishingStatus.PUBLISHED)
@@ -675,7 +675,7 @@ class TestPopulateArchiveScript(TestCaseWithFactory):
675 archive=ubuntu.main_archive)675 archive=ubuntu.main_archive)
676 sources = ubuntu.main_archive.getPublishedSources(676 sources = ubuntu.main_archive.getPublishedSources(
677 distroseries=hoary, status=self.pending_statuses,677 distroseries=hoary, status=self.pending_statuses,
678 name=u'alsa-utils')678 name='alsa-utils')
679 for src in sources:679 for src in sources:
680 if src.source_package_version != '2.0':680 if src.source_package_version != '2.0':
681 src.supersede()681 src.supersede()
diff --git a/lib/lp/soyuz/scripts/tests/test_ppa_apache_log_parser.py b/lib/lp/soyuz/scripts/tests/test_ppa_apache_log_parser.py
index 50db145..c56a4ab 100644
--- a/lib/lp/soyuz/scripts/tests/test_ppa_apache_log_parser.py
+++ b/lib/lp/soyuz/scripts/tests/test_ppa_apache_log_parser.py
@@ -71,7 +71,7 @@ class TestScriptRunning(TestCaseWithFactory):
71 layer = LaunchpadZopelessLayer71 layer = LaunchpadZopelessLayer
7272
73 def setUp(self):73 def setUp(self):
74 super(TestScriptRunning, self).setUp()74 super().setUp()
75 self.publisher = SoyuzTestPublisher()75 self.publisher = SoyuzTestPublisher()
76 self.publisher.prepareBreezyAutotest()76 self.publisher.prepareBreezyAutotest()
7777
diff --git a/lib/lp/soyuz/scripts/tests/test_retrydepwait.py b/lib/lp/soyuz/scripts/tests/test_retrydepwait.py
index 26b518e..24b2462 100644
--- a/lib/lp/soyuz/scripts/tests/test_retrydepwait.py
+++ b/lib/lp/soyuz/scripts/tests/test_retrydepwait.py
@@ -23,7 +23,7 @@ class TestRetryDepwait(TestCaseWithFactory):
23 layer = ZopelessDatabaseLayer23 layer = ZopelessDatabaseLayer
2424
25 def setUp(self):25 def setUp(self):
26 super(TestRetryDepwait, self).setUp()26 super().setUp()
27 self.chroot = getUtility(ILibraryFileAliasSet)[1]27 self.chroot = getUtility(ILibraryFileAliasSet)[1]
28 self.build = removeSecurityProxy(28 self.build = removeSecurityProxy(
29 self.factory.makeBinaryPackageBuild(29 self.factory.makeBinaryPackageBuild(
@@ -48,7 +48,7 @@ class TestRetryDepwait(TestCaseWithFactory):
48 # Builds with unsatisfied dependencies are not retried.48 # Builds with unsatisfied dependencies are not retried.
49 self.build.updateStatus(49 self.build.updateStatus(
50 BuildStatus.MANUALDEPWAIT,50 BuildStatus.MANUALDEPWAIT,
51 slave_status={'dependencies': u'something'})51 slave_status={'dependencies': 'something'})
52 self.assertStatusAfterLoop(BuildStatus.MANUALDEPWAIT)52 self.assertStatusAfterLoop(BuildStatus.MANUALDEPWAIT)
53 self.assertEqual(1, self.build.updateDependencies.call_count)53 self.assertEqual(1, self.build.updateDependencies.call_count)
5454
diff --git a/lib/lp/soyuz/tests/test_archive.py b/lib/lp/soyuz/tests/test_archive.py
index ac1fb04..9e7be9a 100644
--- a/lib/lp/soyuz/tests/test_archive.py
+++ b/lib/lp/soyuz/tests/test_archive.py
@@ -15,7 +15,6 @@ import os.path
15from aptsources.sourceslist import SourceEntry15from aptsources.sourceslist import SourceEntry
16from pytz import UTC16from pytz import UTC
17import responses17import responses
18import six
19from six.moves.urllib.parse import urlsplit18from six.moves.urllib.parse import urlsplit
20from storm.store import Store19from storm.store import Store
21from testtools.matchers import (20from testtools.matchers import (
@@ -1048,7 +1047,7 @@ class TestUpdatePackageDownloadCount(TestCaseWithFactory):
1048 layer = LaunchpadZopelessLayer1047 layer = LaunchpadZopelessLayer
10491048
1050 def setUp(self):1049 def setUp(self):
1051 super(TestUpdatePackageDownloadCount, self).setUp()1050 super().setUp()
1052 self.publisher = SoyuzTestPublisher()1051 self.publisher = SoyuzTestPublisher()
1053 self.publisher.prepareBreezyAutotest()1052 self.publisher.prepareBreezyAutotest()
10541053
@@ -1155,7 +1154,7 @@ class TestProcessors(TestCaseWithFactory):
11551154
1156 def setUp(self):1155 def setUp(self):
1157 """Setup an archive with relevant publications."""1156 """Setup an archive with relevant publications."""
1158 super(TestProcessors, self).setUp(user='foo.bar@canonical.com')1157 super().setUp(user='foo.bar@canonical.com')
1159 self.publisher = SoyuzTestPublisher()1158 self.publisher = SoyuzTestPublisher()
1160 self.publisher.prepareBreezyAutotest()1159 self.publisher.prepareBreezyAutotest()
1161 self.archive = self.factory.makeArchive()1160 self.archive = self.factory.makeArchive()
@@ -1287,7 +1286,7 @@ class TestArchiveTokens(TestCaseWithFactory):
1287 layer = LaunchpadZopelessLayer1286 layer = LaunchpadZopelessLayer
12881287
1289 def setUp(self):1288 def setUp(self):
1290 super(TestArchiveTokens, self).setUp()1289 super().setUp()
1291 owner = self.factory.makePerson()1290 owner = self.factory.makePerson()
1292 self.private_ppa = self.factory.makeArchive(owner=owner, private=True)1291 self.private_ppa = self.factory.makeArchive(owner=owner, private=True)
1293 self.joe = self.factory.makePerson(name='joe')1292 self.joe = self.factory.makePerson(name='joe')
@@ -1454,7 +1453,7 @@ class TestGetBinaryPackageRelease(TestCaseWithFactory):
14541453
1455 def setUp(self):1454 def setUp(self):
1456 """Setup an archive with relevant publications."""1455 """Setup an archive with relevant publications."""
1457 super(TestGetBinaryPackageRelease, self).setUp()1456 super().setUp()
1458 self.publisher = SoyuzTestPublisher()1457 self.publisher = SoyuzTestPublisher()
1459 self.publisher.prepareBreezyAutotest()1458 self.publisher.prepareBreezyAutotest()
14601459
@@ -1549,7 +1548,7 @@ class TestGetBinaryPackageReleaseByFileName(TestCaseWithFactory):
15491548
1550 def setUp(self):1549 def setUp(self):
1551 """Setup an archive with relevant publications."""1550 """Setup an archive with relevant publications."""
1552 super(TestGetBinaryPackageReleaseByFileName, self).setUp()1551 super().setUp()
1553 self.publisher = SoyuzTestPublisher()1552 self.publisher = SoyuzTestPublisher()
1554 self.publisher.prepareBreezyAutotest()1553 self.publisher.prepareBreezyAutotest()
15551554
@@ -1730,7 +1729,7 @@ class TestBuildDebugSymbols(TestCaseWithFactory):
1730 layer = DatabaseFunctionalLayer1729 layer = DatabaseFunctionalLayer
17311730
1732 def setUp(self):1731 def setUp(self):
1733 super(TestBuildDebugSymbols, self).setUp()1732 super().setUp()
1734 self.archive = self.factory.makeArchive()1733 self.archive = self.factory.makeArchive()
17351734
1736 def test_build_debug_symbols_is_public(self):1735 def test_build_debug_symbols_is_public(self):
@@ -1887,7 +1886,7 @@ class TestFindDepCandidates(TestCaseWithFactory):
1887 layer = LaunchpadZopelessLayer1886 layer = LaunchpadZopelessLayer
18881887
1889 def setUp(self):1888 def setUp(self):
1890 super(TestFindDepCandidates, self).setUp()1889 super().setUp()
1891 self.archive = self.factory.makeArchive()1890 self.archive = self.factory.makeArchive()
1892 self.publisher = SoyuzTestPublisher()1891 self.publisher = SoyuzTestPublisher()
1893 login('admin@canonical.com')1892 login('admin@canonical.com')
@@ -2052,12 +2051,12 @@ class TestOverlays(TestCaseWithFactory):
2052 overlay=True, arch_tag='i386',2051 overlay=True, arch_tag='i386',
2053 publish_base_url='http://archive.launchpad.test/'):2052 publish_base_url='http://archive.launchpad.test/'):
2054 # Helper to create a parent/child relationship.2053 # Helper to create a parent/child relationship.
2055 if isinstance(parent_distro, six.string_types):2054 if isinstance(parent_distro, str):
2056 depdistro = self.factory.makeDistribution(parent_distro,2055 depdistro = self.factory.makeDistribution(parent_distro,
2057 publish_base_url=publish_base_url)2056 publish_base_url=publish_base_url)
2058 else:2057 else:
2059 depdistro = parent_distro2058 depdistro = parent_distro
2060 if isinstance(parent_series, six.string_types):2059 if isinstance(parent_series, str):
2061 depseries = self.factory.makeDistroSeries(2060 depseries = self.factory.makeDistroSeries(
2062 name=parent_series, distribution=depdistro)2061 name=parent_series, distribution=depdistro)
2063 self.factory.makeDistroArchSeries(2062 self.factory.makeDistroArchSeries(
@@ -2195,7 +2194,7 @@ class TestValidatePPA(TestCaseWithFactory):
2195 layer = DatabaseFunctionalLayer2194 layer = DatabaseFunctionalLayer
21962195
2197 def setUp(self):2196 def setUp(self):
2198 super(TestValidatePPA, self).setUp()2197 super().setUp()
2199 self.ubuntu = getUtility(IDistributionSet)['ubuntu']2198 self.ubuntu = getUtility(IDistributionSet)['ubuntu']
2200 self.ubuntutest = getUtility(IDistributionSet)['ubuntutest']2199 self.ubuntutest = getUtility(IDistributionSet)['ubuntutest']
2201 with admin_logged_in():2200 with admin_logged_in():
@@ -2324,7 +2323,7 @@ class TestGetComponentsForSeries(TestCaseWithFactory):
2324 layer = DatabaseFunctionalLayer2323 layer = DatabaseFunctionalLayer
23252324
2326 def setUp(self):2325 def setUp(self):
2327 super(TestGetComponentsForSeries, self).setUp()2326 super().setUp()
2328 self.series = self.factory.makeDistroSeries()2327 self.series = self.factory.makeDistroSeries()
2329 self.comp1 = self.factory.makeComponent()2328 self.comp1 = self.factory.makeComponent()
2330 self.comp2 = self.factory.makeComponent()2329 self.comp2 = self.factory.makeComponent()
@@ -2401,7 +2400,7 @@ class TestGetFileByName(TestCaseWithFactory):
2401 layer = LaunchpadZopelessLayer2400 layer = LaunchpadZopelessLayer
24022401
2403 def setUp(self):2402 def setUp(self):
2404 super(TestGetFileByName, self).setUp()2403 super().setUp()
2405 self.archive = self.factory.makeArchive()2404 self.archive = self.factory.makeArchive()
24062405
2407 def test_unknown_file_is_not_found(self):2406 def test_unknown_file_is_not_found(self):
@@ -2510,7 +2509,7 @@ class TestGetSourceFileByName(TestCaseWithFactory):
2510 layer = LaunchpadZopelessLayer2509 layer = LaunchpadZopelessLayer
25112510
2512 def setUp(self):2511 def setUp(self):
2513 super(TestGetSourceFileByName, self).setUp()2512 super().setUp()
2514 self.archive = self.factory.makeArchive()2513 self.archive = self.factory.makeArchive()
25152514
2516 def test_source_file_is_found(self):2515 def test_source_file_is_found(self):
@@ -3701,7 +3700,7 @@ class TestGetPPAOwnedByPerson(TestCaseWithFactory):
3701 layer = DatabaseFunctionalLayer3700 layer = DatabaseFunctionalLayer
37023701
3703 def setUp(self):3702 def setUp(self):
3704 super(TestGetPPAOwnedByPerson, self).setUp()3703 super().setUp()
3705 self.set = getUtility(IArchiveSet)3704 self.set = getUtility(IArchiveSet)
37063705
3707 def test_person(self):3706 def test_person(self):
@@ -3758,7 +3757,7 @@ class TestPPALookup(TestCaseWithFactory):
3758 layer = DatabaseFunctionalLayer3757 layer = DatabaseFunctionalLayer
37593758
3760 def setUp(self):3759 def setUp(self):
3761 super(TestPPALookup, self).setUp()3760 super().setUp()
3762 self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu3761 self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
3763 self.notbuntu = self.factory.makeDistribution()3762 self.notbuntu = self.factory.makeDistribution()
3764 self.person = self.factory.makePerson()3763 self.person = self.factory.makePerson()
@@ -3847,7 +3846,7 @@ class TestArchiveSetGetByReference(TestCaseWithFactory):
3847 layer = DatabaseFunctionalLayer3846 layer = DatabaseFunctionalLayer
38483847
3849 def setUp(self):3848 def setUp(self):
3850 super(TestArchiveSetGetByReference, self).setUp()3849 super().setUp()
3851 self.set = getUtility(IArchiveSet)3850 self.set = getUtility(IArchiveSet)
38523851
3853 def test_ppa(self):3852 def test_ppa(self):
@@ -4206,7 +4205,7 @@ class TestArchiveGetOverridePolicy(TestCaseWithFactory):
4206 layer = DatabaseFunctionalLayer4205 layer = DatabaseFunctionalLayer
42074206
4208 def setUp(self):4207 def setUp(self):
4209 super(TestArchiveGetOverridePolicy, self).setUp()4208 super().setUp()
4210 self.series = self.factory.makeDistroSeries()4209 self.series = self.factory.makeDistroSeries()
4211 with admin_logged_in():4210 with admin_logged_in():
4212 self.series.nominatedarchindep = self.amd64 = (4211 self.series.nominatedarchindep = self.amd64 = (
diff --git a/lib/lp/soyuz/tests/test_archive_subscriptions.py b/lib/lp/soyuz/tests/test_archive_subscriptions.py
index 04fa7bb..516fcd7 100644
--- a/lib/lp/soyuz/tests/test_archive_subscriptions.py
+++ b/lib/lp/soyuz/tests/test_archive_subscriptions.py
@@ -44,7 +44,7 @@ class TestArchiveSubscriptions(TestCaseWithFactory):
4444
45 def setUp(self):45 def setUp(self):
46 """Create a test archive."""46 """Create a test archive."""
47 super(TestArchiveSubscriptions, self).setUp()47 super().setUp()
48 self.owner = self.factory.makePerson()48 self.owner = self.factory.makePerson()
49 self.private_team = self.factory.makeTeam(49 self.private_team = self.factory.makeTeam(
50 visibility=PersonVisibility.PRIVATE,50 visibility=PersonVisibility.PRIVATE,
@@ -136,7 +136,7 @@ class PrivateArtifactsViewTestCase(BrowserTestCase):
136136
137 def setUp(self):137 def setUp(self):
138 """Create a test archive."""138 """Create a test archive."""
139 super(PrivateArtifactsViewTestCase, self).setUp()139 super().setUp()
140 self.owner = self.factory.makePerson()140 self.owner = self.factory.makePerson()
141 self.private_team = self.factory.makeTeam(141 self.private_team = self.factory.makeTeam(
142 visibility=PersonVisibility.PRIVATE,142 visibility=PersonVisibility.PRIVATE,
diff --git a/lib/lp/soyuz/tests/test_binaryandsourcepackagename.py b/lib/lp/soyuz/tests/test_binaryandsourcepackagename.py
index ccec886..7fbccb3 100644
--- a/lib/lp/soyuz/tests/test_binaryandsourcepackagename.py
+++ b/lib/lp/soyuz/tests/test_binaryandsourcepackagename.py
@@ -18,7 +18,7 @@ class TestBinaryAndSourcePackageNameVocabulary(TestCaseWithFactory):
18 layer = DatabaseFunctionalLayer18 layer = DatabaseFunctionalLayer
1919
20 def setUp(self):20 def setUp(self):
21 super(TestBinaryAndSourcePackageNameVocabulary, self).setUp()21 super().setUp()
22 self.vocabulary = BinaryAndSourcePackageNameVocabulary()22 self.vocabulary = BinaryAndSourcePackageNameVocabulary()
23 spn = self.factory.makeSourcePackageName(name='bedbugs')23 spn = self.factory.makeSourcePackageName(name='bedbugs')
24 self.bspn = Store.of(spn).find(24 self.bspn = Store.of(spn).find(
diff --git a/lib/lp/soyuz/tests/test_binarypackagebuild.py b/lib/lp/soyuz/tests/test_binarypackagebuild.py
index 3a3f21a..9bfbb41 100644
--- a/lib/lp/soyuz/tests/test_binarypackagebuild.py
+++ b/lib/lp/soyuz/tests/test_binarypackagebuild.py
@@ -77,7 +77,7 @@ class TestBinaryPackageBuild(TestCaseWithFactory):
77 layer = LaunchpadZopelessLayer77 layer = LaunchpadZopelessLayer
7878
79 def setUp(self):79 def setUp(self):
80 super(TestBinaryPackageBuild, self).setUp()80 super().setUp()
81 self.build = self.factory.makeBinaryPackageBuild(81 self.build = self.factory.makeBinaryPackageBuild(
82 archive=self.factory.makeArchive(purpose=ArchivePurpose.PRIMARY))82 archive=self.factory.makeArchive(purpose=ArchivePurpose.PRIMARY))
8383
@@ -404,7 +404,7 @@ class BaseTestCaseWithThreeBuilds(TestCaseWithFactory):
404404
405 def setUp(self):405 def setUp(self):
406 """Publish some builds for the test archive."""406 """Publish some builds for the test archive."""
407 super(BaseTestCaseWithThreeBuilds, self).setUp()407 super().setUp()
408 self.ds = self.factory.makeDistroSeries()408 self.ds = self.factory.makeDistroSeries()
409 i386_das = self.factory.makeDistroArchSeries(409 i386_das = self.factory.makeDistroArchSeries(
410 distroseries=self.ds, architecturetag='i386')410 distroseries=self.ds, architecturetag='i386')
@@ -457,7 +457,7 @@ class TestBuildSetGetBuildsForArchive(BaseTestCaseWithThreeBuilds):
457457
458 def setUp(self):458 def setUp(self):
459 """Publish some builds for the test archive."""459 """Publish some builds for the test archive."""
460 super(TestBuildSetGetBuildsForArchive, self).setUp()460 super().setUp()
461461
462 # Short-cuts for our tests.462 # Short-cuts for our tests.
463 self.archive = self.ds.main_archive463 self.archive = self.ds.main_archive
@@ -479,7 +479,7 @@ class TestBuildSetGetBuildsForArchive(BaseTestCaseWithThreeBuilds):
479class TestBuildSetGetBuildsForBuilder(BaseTestCaseWithThreeBuilds):479class TestBuildSetGetBuildsForBuilder(BaseTestCaseWithThreeBuilds):
480480
481 def setUp(self):481 def setUp(self):
482 super(TestBuildSetGetBuildsForBuilder, self).setUp()482 super().setUp()
483483
484 # Short-cuts for our tests.484 # Short-cuts for our tests.
485 self.build_set = getUtility(IBinaryPackageBuildSet)485 self.build_set = getUtility(IBinaryPackageBuildSet)
@@ -524,7 +524,7 @@ class TestBinaryPackageBuildWebservice(TestCaseWithFactory):
524 layer = DatabaseFunctionalLayer524 layer = DatabaseFunctionalLayer
525525
526 def setUp(self):526 def setUp(self):
527 super(TestBinaryPackageBuildWebservice, self).setUp()527 super().setUp()
528 self.ppa = self.factory.makeArchive(purpose=ArchivePurpose.PPA)528 self.ppa = self.factory.makeArchive(purpose=ArchivePurpose.PPA)
529 self.build = self.factory.makeBinaryPackageBuild(archive=self.ppa)529 self.build = self.factory.makeBinaryPackageBuild(archive=self.ppa)
530 self.webservice = webservice_for_person(530 self.webservice = webservice_for_person(
@@ -929,7 +929,7 @@ class TestBinaryPackageBuildMacaroonIssuer(
929 layer = LaunchpadZopelessLayer929 layer = LaunchpadZopelessLayer
930930
931 def setUp(self):931 def setUp(self):
932 super(TestBinaryPackageBuildMacaroonIssuer, self).setUp()932 super().setUp()
933 self.pushConfig(933 self.pushConfig(
934 "launchpad", internal_macaroon_secret_key="some-secret")934 "launchpad", internal_macaroon_secret_key="some-secret")
935935
diff --git a/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py b/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py
index 5239946..4f06427 100644
--- a/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py
+++ b/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py
@@ -94,7 +94,7 @@ class TestBinaryBuildPackageBehaviour(StatsMixin, TestCaseWithFactory):
94 timeout=30)94 timeout=30)
9595
96 def setUp(self):96 def setUp(self):
97 super(TestBinaryBuildPackageBehaviour, self).setUp()97 super().setUp()
98 switch_dbuser('testadmin')98 switch_dbuser('testadmin')
99 self.setUpStats()99 self.setUpStats()
100100
@@ -534,7 +534,7 @@ class TestBinaryBuildPackageBehaviourBuildCollection(TestCaseWithFactory):
534 shutil.rmtree(config.builddmaster.root)534 shutil.rmtree(config.builddmaster.root)
535535
536 def setUp(self):536 def setUp(self):
537 super(TestBinaryBuildPackageBehaviourBuildCollection, self).setUp()537 super().setUp()
538 switch_dbuser('testadmin')538 switch_dbuser('testadmin')
539539
540 self.builder = self.factory.makeBuilder()540 self.builder = self.factory.makeBuilder()
diff --git a/lib/lp/soyuz/tests/test_binarypackagename.py b/lib/lp/soyuz/tests/test_binarypackagename.py
index 9137864..e9564ee 100644
--- a/lib/lp/soyuz/tests/test_binarypackagename.py
+++ b/lib/lp/soyuz/tests/test_binarypackagename.py
@@ -17,7 +17,7 @@ class TestBinaryPackageNameSet(TestCaseWithFactory):
17 layer = DatabaseFunctionalLayer17 layer = DatabaseFunctionalLayer
1818
19 def setUp(self):19 def setUp(self):
20 super(TestBinaryPackageNameSet, self).setUp()20 super().setUp()
21 self.name_set = getUtility(IBinaryPackageNameSet)21 self.name_set = getUtility(IBinaryPackageNameSet)
2222
23 def test___getitem__found(self):23 def test___getitem__found(self):
diff --git a/lib/lp/soyuz/tests/test_binarysourcereference.py b/lib/lp/soyuz/tests/test_binarysourcereference.py
index ddb05f8..944c35b 100644
--- a/lib/lp/soyuz/tests/test_binarysourcereference.py
+++ b/lib/lp/soyuz/tests/test_binarysourcereference.py
@@ -30,7 +30,7 @@ class TestBinarySourceReference(TestCaseWithFactory):
30 layer = DatabaseFunctionalLayer30 layer = DatabaseFunctionalLayer
3131
32 def setUp(self):32 def setUp(self):
33 super(TestBinarySourceReference, self).setUp()33 super().setUp()
34 self.reference_set = getUtility(IBinarySourceReferenceSet)34 self.reference_set = getUtility(IBinarySourceReferenceSet)
3535
36 def test_createFromRelationship_empty(self):36 def test_createFromRelationship_empty(self):
diff --git a/lib/lp/soyuz/tests/test_build.py b/lib/lp/soyuz/tests/test_build.py
index 8181a2d..36bb5a3 100644
--- a/lib/lp/soyuz/tests/test_build.py
+++ b/lib/lp/soyuz/tests/test_build.py
@@ -38,7 +38,7 @@ class TestBuild(TestCaseWithFactory):
38 layer = LaunchpadFunctionalLayer38 layer = LaunchpadFunctionalLayer
3939
40 def setUp(self):40 def setUp(self):
41 super(TestBuild, self).setUp()41 super().setUp()
42 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)42 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
43 self.processor = self.factory.makeProcessor(supports_virtualized=True)43 self.processor = self.factory.makeProcessor(supports_virtualized=True)
44 self.distroseries = self.factory.makeDistroSeries()44 self.distroseries = self.factory.makeDistroSeries()
diff --git a/lib/lp/soyuz/tests/test_build_depwait.py b/lib/lp/soyuz/tests/test_build_depwait.py
index dd57b39..f4d9567 100644
--- a/lib/lp/soyuz/tests/test_build_depwait.py
+++ b/lib/lp/soyuz/tests/test_build_depwait.py
@@ -25,7 +25,7 @@ class TestBuildDepWait(TestCaseWithFactory):
25 layer = LaunchpadFunctionalLayer25 layer = LaunchpadFunctionalLayer
2626
27 def setUp(self):27 def setUp(self):
28 super(TestBuildDepWait, self).setUp()28 super().setUp()
29 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)29 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
30 # Create everything we need to create builds, such as a30 # Create everything we need to create builds, such as a
31 # DistroArchSeries and a builder.31 # DistroArchSeries and a builder.
diff --git a/lib/lp/soyuz/tests/test_build_notify.py b/lib/lp/soyuz/tests/test_build_notify.py
index 3621091..fa90f02 100644
--- a/lib/lp/soyuz/tests/test_build_notify.py
+++ b/lib/lp/soyuz/tests/test_build_notify.py
@@ -46,7 +46,7 @@ class TestBuildNotify(TestCaseWithFactory):
46 layer = LaunchpadZopelessLayer46 layer = LaunchpadZopelessLayer
4747
48 def setUp(self):48 def setUp(self):
49 super(TestBuildNotify, self).setUp()49 super().setUp()
50 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)50 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
51 # Create all of the items we need to create builds51 # Create all of the items we need to create builds
52 self.processor = self.factory.makeProcessor(supports_virtualized=True)52 self.processor = self.factory.makeProcessor(supports_virtualized=True)
diff --git a/lib/lp/soyuz/tests/test_build_privacy.py b/lib/lp/soyuz/tests/test_build_privacy.py
index 3004a0d..85ebaaf 100644
--- a/lib/lp/soyuz/tests/test_build_privacy.py
+++ b/lib/lp/soyuz/tests/test_build_privacy.py
@@ -20,7 +20,7 @@ class TestBuildPrivacy(TestCaseWithFactory):
20 layer = LaunchpadFunctionalLayer20 layer = LaunchpadFunctionalLayer
2121
22 def setUp(self):22 def setUp(self):
23 super(TestBuildPrivacy, self).setUp()23 super().setUp()
24 # Add everything we need to create builds.24 # Add everything we need to create builds.
25 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)25 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
26 processor = self.factory.makeProcessor(supports_virtualized=True)26 processor = self.factory.makeProcessor(supports_virtualized=True)
diff --git a/lib/lp/soyuz/tests/test_build_set.py b/lib/lp/soyuz/tests/test_build_set.py
index 84f57eb..6dcf9fd 100644
--- a/lib/lp/soyuz/tests/test_build_set.py
+++ b/lib/lp/soyuz/tests/test_build_set.py
@@ -42,7 +42,7 @@ class TestBuildSet(TestCaseWithFactory):
42 layer = LaunchpadFunctionalLayer42 layer = LaunchpadFunctionalLayer
4343
44 def setUp(self):44 def setUp(self):
45 super(TestBuildSet, self).setUp()45 super().setUp()
46 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)46 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
47 self.processor_one = self.factory.makeProcessor(47 self.processor_one = self.factory.makeProcessor(
48 supports_virtualized=True)48 supports_virtualized=True)
@@ -269,7 +269,7 @@ class TestGetAllowedArchitectures(TestCaseWithFactory):
269 layer = ZopelessDatabaseLayer269 layer = ZopelessDatabaseLayer
270270
271 def setUp(self):271 def setUp(self):
272 super(TestGetAllowedArchitectures, self).setUp()272 super().setUp()
273 self.avr = self.factory.makeProcessor(273 self.avr = self.factory.makeProcessor(
274 name="avr2001", supports_virtualized=True)274 name="avr2001", supports_virtualized=True)
275 self.sparc = self.factory.makeProcessor(275 self.sparc = self.factory.makeProcessor(
@@ -347,7 +347,7 @@ class BuildRecordCreationTests(TestNativePublishingBase):
347 """Test the creation of build records."""347 """Test the creation of build records."""
348348
349 def setUp(self):349 def setUp(self):
350 super(BuildRecordCreationTests, self).setUp()350 super().setUp()
351 self.distro = self.factory.makeDistribution()351 self.distro = self.factory.makeDistribution()
352 self.avr = self.factory.makeProcessor(352 self.avr = self.factory.makeProcessor(
353 name="avr2001", supports_virtualized=True)353 name="avr2001", supports_virtualized=True)
@@ -386,7 +386,7 @@ class BuildRecordCreationTests(TestNativePublishingBase):
386 :param architecturehintlist: Architecture hint list386 :param architecturehintlist: Architecture hint list
387 (e.g. "i386 amd64")387 (e.g. "i386 amd64")
388 """388 """
389 return super(BuildRecordCreationTests, self).getPubSource(389 return super().getPubSource(
390 archive=self.factory.makeArchive(), distroseries=self.distroseries,390 archive=self.factory.makeArchive(), distroseries=self.distroseries,
391 architecturehintlist=architecturehintlist)391 architecturehintlist=architecturehintlist)
392392
@@ -588,7 +588,7 @@ class TestFindBuiltOrPublishedBySourceAndArchive(TestCaseWithFactory):
588 layer = ZopelessDatabaseLayer588 layer = ZopelessDatabaseLayer
589589
590 def setUp(self):590 def setUp(self):
591 super(TestFindBuiltOrPublishedBySourceAndArchive, self).setUp()591 super().setUp()
592 self.bpbs = getUtility(IBinaryPackageBuildSet)592 self.bpbs = getUtility(IBinaryPackageBuildSet)
593593
594 def test_trivial(self):594 def test_trivial(self):
diff --git a/lib/lp/soyuz/tests/test_build_start_estimation.py b/lib/lp/soyuz/tests/test_build_start_estimation.py
index b26dae1..07f625e 100644
--- a/lib/lp/soyuz/tests/test_build_start_estimation.py
+++ b/lib/lp/soyuz/tests/test_build_start_estimation.py
@@ -29,7 +29,7 @@ class TestBuildStartEstimation(TestCaseWithFactory):
29 layer = LaunchpadFunctionalLayer29 layer = LaunchpadFunctionalLayer
3030
31 def setUp(self):31 def setUp(self):
32 super(TestBuildStartEstimation, self).setUp()32 super().setUp()
33 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)33 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
34 with person_logged_in(self.admin):34 with person_logged_in(self.admin):
35 self.publisher = SoyuzTestPublisher()35 self.publisher = SoyuzTestPublisher()
diff --git a/lib/lp/soyuz/tests/test_distributionsourcepackagerelease.py b/lib/lp/soyuz/tests/test_distributionsourcepackagerelease.py
index 5abdd67..38dcc3e 100644
--- a/lib/lp/soyuz/tests/test_distributionsourcepackagerelease.py
+++ b/lib/lp/soyuz/tests/test_distributionsourcepackagerelease.py
@@ -29,7 +29,7 @@ class TestDistributionSourcePackageRelease(TestCaseWithFactory):
29 layer = DatabaseFunctionalLayer29 layer = DatabaseFunctionalLayer
3030
31 def setUp(self):31 def setUp(self):
32 super(TestDistributionSourcePackageRelease, self).setUp()32 super().setUp()
33 self.sourcepackagerelease = self.factory.makeSourcePackageRelease()33 self.sourcepackagerelease = self.factory.makeSourcePackageRelease()
34 self.distroarchseries = self.factory.makeDistroArchSeries(34 self.distroarchseries = self.factory.makeDistroArchSeries(
35 distroseries=self.sourcepackagerelease.upload_distroseries)35 distroseries=self.sourcepackagerelease.upload_distroseries)
@@ -159,7 +159,7 @@ class TestGetBinariesForSeries(TestCaseWithFactory):
159 layer = DatabaseFunctionalLayer159 layer = DatabaseFunctionalLayer
160160
161 def setUp(self):161 def setUp(self):
162 super(TestGetBinariesForSeries, self).setUp()162 super().setUp()
163 self.sourcepackagerelease = self.factory.makeSourcePackageRelease()163 self.sourcepackagerelease = self.factory.makeSourcePackageRelease()
164 self.distroarchseries = self.factory.makeDistroArchSeries(164 self.distroarchseries = self.factory.makeDistroArchSeries(
165 distroseries=self.sourcepackagerelease.upload_distroseries)165 distroseries=self.sourcepackagerelease.upload_distroseries)
diff --git a/lib/lp/soyuz/tests/test_distroseriesbinarypackage.py b/lib/lp/soyuz/tests/test_distroseriesbinarypackage.py
index 2b61058..682d7db 100644
--- a/lib/lp/soyuz/tests/test_distroseriesbinarypackage.py
+++ b/lib/lp/soyuz/tests/test_distroseriesbinarypackage.py
@@ -32,7 +32,7 @@ class TestDistroSeriesBinaryPackage(TestCaseWithFactory):
3232
33 def setUp(self):33 def setUp(self):
34 """Create a distroseriesbinarypackage to play with."""34 """Create a distroseriesbinarypackage to play with."""
35 super(TestDistroSeriesBinaryPackage, self).setUp()35 super().setUp()
36 self.publisher = SoyuzTestPublisher()36 self.publisher = SoyuzTestPublisher()
37 self.publisher.prepareBreezyAutotest()37 self.publisher.prepareBreezyAutotest()
38 self.distroseries = self.publisher.distroseries38 self.distroseries = self.publisher.distroseries
diff --git a/lib/lp/soyuz/tests/test_distroseriesdifferencejob.py b/lib/lp/soyuz/tests/test_distroseriesdifferencejob.py
index e9f007d..220fc9f 100644
--- a/lib/lp/soyuz/tests/test_distroseriesdifferencejob.py
+++ b/lib/lp/soyuz/tests/test_distroseriesdifferencejob.py
@@ -607,7 +607,7 @@ class TestDistroSeriesDifferenceJobEndToEnd(TestCaseWithFactory):
607 layer = LaunchpadZopelessLayer607 layer = LaunchpadZopelessLayer
608608
609 def setUp(self):609 def setUp(self):
610 super(TestDistroSeriesDifferenceJobEndToEnd, self).setUp()610 super().setUp()
611 self.store = IMasterStore(DistroSeriesDifference)611 self.store = IMasterStore(DistroSeriesDifference)
612612
613 def getJobSource(self):613 def getJobSource(self):
diff --git a/lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py b/lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py
index 5c41eac..3f1c664 100644
--- a/lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py
+++ b/lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py
@@ -34,7 +34,7 @@ from lp.testing.gpgkeys import import_public_test_keys
34class TestDistroSeriesQueueDdtpTarball(TestNativePublishingBase):34class TestDistroSeriesQueueDdtpTarball(TestNativePublishingBase):
3535
36 def setUp(self):36 def setUp(self):
37 super(TestDistroSeriesQueueDdtpTarball, self).setUp()37 super().setUp()
38 import_public_test_keys()38 import_public_test_keys()
39 # CustomUpload.installFiles requires a umask of 0o022.39 # CustomUpload.installFiles requires a umask of 0o022.
40 old_umask = os.umask(0o022)40 old_umask = os.umask(0o022)
diff --git a/lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py b/lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py
index 326be48..3338d1a 100644
--- a/lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py
+++ b/lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py
@@ -27,7 +27,7 @@ from lp.testing.gpgkeys import import_public_test_keys
27class TestDistroSeriesQueueDebianInstaller(TestNativePublishingBase):27class TestDistroSeriesQueueDebianInstaller(TestNativePublishingBase):
2828
29 def setUp(self):29 def setUp(self):
30 super(TestDistroSeriesQueueDebianInstaller, self).setUp()30 super().setUp()
31 import_public_test_keys()31 import_public_test_keys()
32 # CustomUpload.installFiles requires a umask of 0o022.32 # CustomUpload.installFiles requires a umask of 0o022.
33 old_umask = os.umask(0o022)33 old_umask = os.umask(0o022)
diff --git a/lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py b/lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py
index 6dac873..8620c42 100644
--- a/lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py
+++ b/lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py
@@ -30,7 +30,7 @@ from lp.testing.gpgkeys import import_public_test_keys
30class TestDistroSeriesQueueDistUpgrader(TestNativePublishingBase):30class TestDistroSeriesQueueDistUpgrader(TestNativePublishingBase):
3131
32 def setUp(self):32 def setUp(self):
33 super(TestDistroSeriesQueueDistUpgrader, self).setUp()33 super().setUp()
34 import_public_test_keys()34 import_public_test_keys()
35 # CustomUpload.installFiles requires a umask of 0o022.35 # CustomUpload.installFiles requires a umask of 0o022.
36 old_umask = os.umask(0o022)36 old_umask = os.umask(0o022)
@@ -42,7 +42,7 @@ class TestDistroSeriesQueueDistUpgrader(TestNativePublishingBase):
42 self.logger = DevNullLogger()42 self.logger = DevNullLogger()
4343
44 def tearDown(self):44 def tearDown(self):
45 super(TestDistroSeriesQueueDistUpgrader, self).tearDown()45 super().tearDown()
46 if os.path.exists(config.personalpackagearchive.root):46 if os.path.exists(config.personalpackagearchive.root):
47 shutil.rmtree(config.personalpackagearchive.root)47 shutil.rmtree(config.personalpackagearchive.root)
4848
diff --git a/lib/lp/soyuz/tests/test_distroseriesqueue_rosetta_translations.py b/lib/lp/soyuz/tests/test_distroseriesqueue_rosetta_translations.py
index 7cfcf54..b13658b 100644
--- a/lib/lp/soyuz/tests/test_distroseriesqueue_rosetta_translations.py
+++ b/lib/lp/soyuz/tests/test_distroseriesqueue_rosetta_translations.py
@@ -51,7 +51,7 @@ class TestDistroSeriesQueueRosettaTranslationsTarball(
51 layer = LaunchpadZopelessLayer51 layer = LaunchpadZopelessLayer
5252
53 def setUp(self):53 def setUp(self):
54 super(TestDistroSeriesQueueRosettaTranslationsTarball, self).setUp()54 super().setUp()
55 import_public_test_keys()55 import_public_test_keys()
56 self.logger = DevNullLogger()56 self.logger = DevNullLogger()
57 self.absolutely_anything_policy = getPolicy(57 self.absolutely_anything_policy = getPolicy(
diff --git a/lib/lp/soyuz/tests/test_hasbuildrecords.py b/lib/lp/soyuz/tests/test_hasbuildrecords.py
index 94c146b..bcb15f1 100644
--- a/lib/lp/soyuz/tests/test_hasbuildrecords.py
+++ b/lib/lp/soyuz/tests/test_hasbuildrecords.py
@@ -45,7 +45,7 @@ class TestHasBuildRecordsInterface(BaseTestCaseWithThreeBuilds):
4545
46 def setUp(self):46 def setUp(self):
47 """Use `SoyuzTestPublisher` to publish some sources in archives."""47 """Use `SoyuzTestPublisher` to publish some sources in archives."""
48 super(TestHasBuildRecordsInterface, self).setUp()48 super().setUp()
49 self.context = self.ds.distribution49 self.context = self.ds.distribution
5050
51 def testProvidesHasBuildRecords(self):51 def testProvidesHasBuildRecords(self):
@@ -73,7 +73,7 @@ class TestDistributionHasBuildRecords(TestCaseWithFactory):
73 layer = LaunchpadZopelessLayer73 layer = LaunchpadZopelessLayer
7474
75 def setUp(self):75 def setUp(self):
76 super(TestDistributionHasBuildRecords, self).setUp()76 super().setUp()
77 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)77 self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
78 # Create the machinery we need to create builds, such as78 # Create the machinery we need to create builds, such as
79 # DistroArchSeries and builders.79 # DistroArchSeries and builders.
@@ -127,7 +127,7 @@ class TestDistroSeriesHasBuildRecords(TestHasBuildRecordsInterface):
127 """Test the DistroSeries implementation of IHasBuildRecords."""127 """Test the DistroSeries implementation of IHasBuildRecords."""
128128
129 def setUp(self):129 def setUp(self):
130 super(TestDistroSeriesHasBuildRecords, self).setUp()130 super().setUp()
131 self.context = self.ds131 self.context = self.ds
132132
133133
@@ -137,7 +137,7 @@ class TestDistroArchSeriesHasBuildRecords(TestDistributionHasBuildRecords):
137 layer = LaunchpadZopelessLayer137 layer = LaunchpadZopelessLayer
138138
139 def setUp(self):139 def setUp(self):
140 super(TestDistroArchSeriesHasBuildRecords, self).setUp()140 super().setUp()
141141
142 def test_distroarchseries(self):142 def test_distroarchseries(self):
143 # We can fetch builds records from a DistroArchSeries.143 # We can fetch builds records from a DistroArchSeries.
@@ -161,7 +161,7 @@ class TestArchiveHasBuildRecords(TestHasBuildRecordsInterface):
161 """Test the Archive implementation of IHasBuildRecords."""161 """Test the Archive implementation of IHasBuildRecords."""
162162
163 def setUp(self):163 def setUp(self):
164 super(TestArchiveHasBuildRecords, self).setUp()164 super().setUp()
165165
166 self.context = self.ds.main_archive166 self.context = self.ds.main_archive
167167
@@ -191,7 +191,7 @@ class TestBuilderHasBuildRecords(TestHasBuildRecordsInterface):
191 """Test the Builder implementation of IHasBuildRecords."""191 """Test the Builder implementation of IHasBuildRecords."""
192192
193 def setUp(self):193 def setUp(self):
194 super(TestBuilderHasBuildRecords, self).setUp()194 super().setUp()
195195
196 # Create a 386 builder196 # Create a 386 builder
197 self.context = self.factory.makeBuilder()197 self.context = self.factory.makeBuilder()
@@ -237,7 +237,7 @@ class TestSourcePackageHasBuildRecords(TestHasBuildRecordsInterface):
237 """Test the SourcePackage implementation of IHasBuildRecords."""237 """Test the SourcePackage implementation of IHasBuildRecords."""
238238
239 def setUp(self):239 def setUp(self):
240 super(TestSourcePackageHasBuildRecords, self).setUp()240 super().setUp()
241 gedit_name = self.builds[0].source_package_release.sourcepackagename241 gedit_name = self.builds[0].source_package_release.sourcepackagename
242 self.context = SourcePackage(242 self.context = SourcePackage(
243 gedit_name, self.builds[0].distro_arch_series.distroseries)243 gedit_name, self.builds[0].distro_arch_series.distroseries)
diff --git a/lib/lp/soyuz/tests/test_livefs.py b/lib/lp/soyuz/tests/test_livefs.py
index 427ff7d..9ccd18a 100644
--- a/lib/lp/soyuz/tests/test_livefs.py
+++ b/lib/lp/soyuz/tests/test_livefs.py
@@ -89,7 +89,7 @@ class TestLiveFS(TestCaseWithFactory):
89 layer = DatabaseFunctionalLayer89 layer = DatabaseFunctionalLayer
9090
91 def setUp(self):91 def setUp(self):
92 super(TestLiveFS, self).setUp()92 super().setUp()
93 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))93 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))
9494
95 def test_implements_interfaces(self):95 def test_implements_interfaces(self):
@@ -455,7 +455,7 @@ class TestLiveFSSet(TestCaseWithFactory):
455 layer = DatabaseFunctionalLayer455 layer = DatabaseFunctionalLayer
456456
457 def setUp(self):457 def setUp(self):
458 super(TestLiveFSSet, self).setUp()458 super().setUp()
459 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))459 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))
460460
461 def test_class_implements_interfaces(self):461 def test_class_implements_interfaces(self):
@@ -550,7 +550,7 @@ class TestLiveFSWebservice(TestCaseWithFactory):
550 layer = DatabaseFunctionalLayer550 layer = DatabaseFunctionalLayer
551551
552 def setUp(self):552 def setUp(self):
553 super(TestLiveFSWebservice, self).setUp()553 super().setUp()
554 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))554 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))
555 self.person = self.factory.makePerson(displayname="Test Person")555 self.person = self.factory.makePerson(displayname="Test Person")
556 self.webservice = webservice_for_person(556 self.webservice = webservice_for_person(
diff --git a/lib/lp/soyuz/tests/test_livefsbuild.py b/lib/lp/soyuz/tests/test_livefsbuild.py
index 2a64479..d448344 100644
--- a/lib/lp/soyuz/tests/test_livefsbuild.py
+++ b/lib/lp/soyuz/tests/test_livefsbuild.py
@@ -110,7 +110,7 @@ class TestLiveFSBuild(TestCaseWithFactory):
110 layer = LaunchpadZopelessLayer110 layer = LaunchpadZopelessLayer
111111
112 def setUp(self):112 def setUp(self):
113 super(TestLiveFSBuild, self).setUp()113 super().setUp()
114 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))114 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))
115 self.build = self.factory.makeLiveFSBuild()115 self.build = self.factory.makeLiveFSBuild()
116116
@@ -375,7 +375,7 @@ class TestLiveFSBuildSet(TestCaseWithFactory):
375 layer = LaunchpadZopelessLayer375 layer = LaunchpadZopelessLayer
376376
377 def setUp(self):377 def setUp(self):
378 super(TestLiveFSBuildSet, self).setUp()378 super().setUp()
379 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))379 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))
380380
381 def test_getByBuildFarmJob_works(self):381 def test_getByBuildFarmJob_works(self):
@@ -407,7 +407,7 @@ class TestLiveFSBuildWebservice(TestCaseWithFactory):
407 layer = LaunchpadFunctionalLayer407 layer = LaunchpadFunctionalLayer
408408
409 def setUp(self):409 def setUp(self):
410 super(TestLiveFSBuildWebservice, self).setUp()410 super().setUp()
411 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))411 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))
412 self.person = self.factory.makePerson()412 self.person = self.factory.makePerson()
413 self.webservice = webservice_for_person(413 self.webservice = webservice_for_person(
@@ -599,7 +599,7 @@ class TestLiveFSBuildMacaroonIssuer(MacaroonTestMixin, TestCaseWithFactory):
599 layer = LaunchpadZopelessLayer599 layer = LaunchpadZopelessLayer
600600
601 def setUp(self):601 def setUp(self):
602 super(TestLiveFSBuildMacaroonIssuer, self).setUp()602 super().setUp()
603 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))603 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))
604 self.pushConfig(604 self.pushConfig(
605 "launchpad", internal_macaroon_secret_key="some-secret")605 "launchpad", internal_macaroon_secret_key="some-secret")
diff --git a/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py b/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py
index 5a9bcc2..0c39013 100644
--- a/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py
+++ b/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py
@@ -65,7 +65,7 @@ class TestLiveFSBuildBehaviourBase(TestCaseWithFactory):
65 layer = LaunchpadZopelessLayer65 layer = LaunchpadZopelessLayer
6666
67 def setUp(self):67 def setUp(self):
68 super(TestLiveFSBuildBehaviourBase, self).setUp()68 super().setUp()
69 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))69 self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: "on"}))
7070
71 def makeJob(self, archive=None, pocket=PackagePublishingPocket.RELEASE,71 def makeJob(self, archive=None, pocket=PackagePublishingPocket.RELEASE,
diff --git a/lib/lp/soyuz/tests/test_packagecopyjob.py b/lib/lp/soyuz/tests/test_packagecopyjob.py
index 50a65c8..97781f1 100644
--- a/lib/lp/soyuz/tests/test_packagecopyjob.py
+++ b/lib/lp/soyuz/tests/test_packagecopyjob.py
@@ -185,7 +185,7 @@ class PlainPackageCopyJobTests(TestCaseWithFactory, LocalTestHelper):
185 layer = LaunchpadZopelessLayer185 layer = LaunchpadZopelessLayer
186186
187 def setUp(self):187 def setUp(self):
188 super(PlainPackageCopyJobTests, self).setUp()188 super().setUp()
189 self.publisher = SoyuzTestPublisher()189 self.publisher = SoyuzTestPublisher()
190 self.publisher.prepareBreezyAutotest()190 self.publisher.prepareBreezyAutotest()
191 self.distroseries = self.publisher.breezy_autotest191 self.distroseries = self.publisher.breezy_autotest
@@ -1803,7 +1803,7 @@ class TestViaCelery(TestCaseWithFactory):
1803 layer = CeleryJobLayer1803 layer = CeleryJobLayer
18041804
1805 def setUp(self):1805 def setUp(self):
1806 super(TestViaCelery, self).setUp()1806 super().setUp()
1807 # Turn on Celery handling of PCJs and the resulting notification jobs.1807 # Turn on Celery handling of PCJs and the resulting notification jobs.
1808 self.useFixture(FeatureFixture({1808 self.useFixture(FeatureFixture({
1809 'jobs.celery.enabled_classes':1809 'jobs.celery.enabled_classes':
@@ -1811,7 +1811,7 @@ class TestViaCelery(TestCaseWithFactory):
1811 }))1811 }))
18121812
1813 def tearDown(self):1813 def tearDown(self):
1814 super(TestViaCelery, self).tearDown()1814 super().tearDown()
1815 pop_remote_notifications()1815 pop_remote_notifications()
18161816
1817 def test_run(self):1817 def test_run(self):
diff --git a/lib/lp/soyuz/tests/test_packageset.py b/lib/lp/soyuz/tests/test_packageset.py
index c84b2be..da91a35 100644
--- a/lib/lp/soyuz/tests/test_packageset.py
+++ b/lib/lp/soyuz/tests/test_packageset.py
@@ -35,7 +35,7 @@ class TestPackagesetSet(TestCaseWithFactory):
35 layer = ZopelessDatabaseLayer35 layer = ZopelessDatabaseLayer
3636
37 def setUp(self):37 def setUp(self):
38 super(TestPackagesetSet, self).setUp()38 super().setUp()
39 self.ps_set = getUtility(IPackagesetSet)39 self.ps_set = getUtility(IPackagesetSet)
4040
41 def getUbuntu(self):41 def getUbuntu(self):
@@ -223,7 +223,7 @@ class TestPackagesetSetPermissions(TestCaseWithFactory):
223 layer = DatabaseFunctionalLayer223 layer = DatabaseFunctionalLayer
224224
225 def setUp(self):225 def setUp(self):
226 super(TestPackagesetSetPermissions, self).setUp()226 super().setUp()
227 self.ps_set = getUtility(IPackagesetSet)227 self.ps_set = getUtility(IPackagesetSet)
228228
229 def test_create_packageset_as_user(self):229 def test_create_packageset_as_user(self):
@@ -256,7 +256,7 @@ class TestPackageset(TestCaseWithFactory):
256256
257 def setUp(self):257 def setUp(self):
258 """Setup a distribution with multiple distroseries."""258 """Setup a distribution with multiple distroseries."""
259 super(TestPackageset, self).setUp()259 super().setUp()
260 self.distribution = getUtility(IDistributionSet).getByName(260 self.distribution = getUtility(IDistributionSet).getByName(
261 'ubuntu')261 'ubuntu')
262 self.distroseries_current = self.distribution.currentseries262 self.distroseries_current = self.distribution.currentseries
@@ -664,7 +664,7 @@ class TestPackagesetPermissions(TestCaseWithFactory):
664 layer = DatabaseFunctionalLayer664 layer = DatabaseFunctionalLayer
665665
666 def setUp(self):666 def setUp(self):
667 super(TestPackagesetPermissions, self).setUp()667 super().setUp()
668 self.person = self.factory.makePerson()668 self.person = self.factory.makePerson()
669 self.person2 = self.factory.makePerson()669 self.person2 = self.factory.makePerson()
670 self.packageset = self.factory.makePackageset(owner=self.person)670 self.packageset = self.factory.makePackageset(owner=self.person)
@@ -723,7 +723,7 @@ class TestArchivePermissionSet(TestCaseWithFactory):
723 layer = ZopelessDatabaseLayer723 layer = ZopelessDatabaseLayer
724724
725 def setUp(self):725 def setUp(self):
726 super(TestArchivePermissionSet, self).setUp()726 super().setUp()
727 self.ap_set = getUtility(IArchivePermissionSet)727 self.ap_set = getUtility(IArchivePermissionSet)
728 self.archive = self.factory.makeArchive()728 self.archive = self.factory.makeArchive()
729 self.packageset = self.factory.makePackageset()729 self.packageset = self.factory.makePackageset()
diff --git a/lib/lp/soyuz/tests/test_packageupload.py b/lib/lp/soyuz/tests/test_packageupload.py
index 24fb049..24d21ca 100644
--- a/lib/lp/soyuz/tests/test_packageupload.py
+++ b/lib/lp/soyuz/tests/test_packageupload.py
@@ -85,11 +85,11 @@ class PackageUploadTestCase(TestCaseWithFactory):
85 dbuser = config.uploadqueue.dbuser85 dbuser = config.uploadqueue.dbuser
8686
87 def setUp(self):87 def setUp(self):
88 super(PackageUploadTestCase, self).setUp()88 super().setUp()
89 self.test_publisher = SoyuzTestPublisher()89 self.test_publisher = SoyuzTestPublisher()
9090
91 def tearDown(self):91 def tearDown(self):
92 super(PackageUploadTestCase, self).tearDown()92 super().tearDown()
93 if os.path.exists(config.personalpackagearchive.root):93 if os.path.exists(config.personalpackagearchive.root):
94 shutil.rmtree(config.personalpackagearchive.root)94 shutil.rmtree(config.personalpackagearchive.root)
9595
@@ -692,7 +692,7 @@ class TestPackageUploadSet(TestCaseWithFactory):
692 layer = LaunchpadZopelessLayer692 layer = LaunchpadZopelessLayer
693693
694 def setUp(self):694 def setUp(self):
695 super(TestPackageUploadSet, self).setUp()695 super().setUp()
696 self.upload_set = getUtility(IPackageUploadSet)696 self.upload_set = getUtility(IPackageUploadSet)
697697
698 def test_PackageUploadSet_implements_IPackageUploadSet(self):698 def test_PackageUploadSet_implements_IPackageUploadSet(self):
@@ -1013,7 +1013,7 @@ class TestPackageUploadWebservice(TestCaseWithFactory):
1013 layer = LaunchpadFunctionalLayer1013 layer = LaunchpadFunctionalLayer
10141014
1015 def setUp(self):1015 def setUp(self):
1016 super(TestPackageUploadWebservice, self).setUp()1016 super().setUp()
1017 self.webservice = None1017 self.webservice = None
1018 self.distroseries = self.factory.makeDistroSeries()1018 self.distroseries = self.factory.makeDistroSeries()
1019 self.main = self.factory.makeComponent("main")1019 self.main = self.factory.makeComponent("main")
diff --git a/lib/lp/soyuz/tests/test_processacceptedbugsjob.py b/lib/lp/soyuz/tests/test_processacceptedbugsjob.py
index 1b7ab86..8d7255d 100644
--- a/lib/lp/soyuz/tests/test_processacceptedbugsjob.py
+++ b/lib/lp/soyuz/tests/test_processacceptedbugsjob.py
@@ -56,7 +56,7 @@ class TestBugIDsFromChangesFile(TestCaseWithFactory):
56 dbuser = config.uploadqueue.dbuser56 dbuser = config.uploadqueue.dbuser
5757
58 def setUp(self):58 def setUp(self):
59 super(TestBugIDsFromChangesFile, self).setUp()59 super().setUp()
60 self.changes = Changes({60 self.changes = Changes({
61 'Format': '1.8',61 'Format': '1.8',
62 'Source': 'swat',62 'Source': 'swat',
@@ -260,7 +260,7 @@ class TestCloseBugIDsForSourcePackageRelease(TestCaseWithFactory):
260 dbuser = config.IProcessAcceptedBugsJobSource.dbuser260 dbuser = config.IProcessAcceptedBugsJobSource.dbuser
261261
262 def setUp(self):262 def setUp(self):
263 super(TestCloseBugIDsForSourcePackageRelease, self).setUp()263 super().setUp()
264 # Create a distribution with two series, two source package names,264 # Create a distribution with two series, two source package names,
265 # and an SPR and a bug task for all combinations of those.265 # and an SPR and a bug task for all combinations of those.
266 self.distro = self.factory.makeDistribution()266 self.distro = self.factory.makeDistribution()
@@ -324,7 +324,7 @@ class TestProcessAcceptedBugsJob(TestCaseWithFactory):
324 dbuser = config.IProcessAcceptedBugsJobSource.dbuser324 dbuser = config.IProcessAcceptedBugsJobSource.dbuser
325325
326 def setUp(self):326 def setUp(self):
327 super(TestProcessAcceptedBugsJob, self).setUp()327 super().setUp()
328 self.publisher = SoyuzTestPublisher()328 self.publisher = SoyuzTestPublisher()
329 self.publisher.prepareBreezyAutotest()329 self.publisher.prepareBreezyAutotest()
330 self.distroseries = self.publisher.breezy_autotest330 self.distroseries = self.publisher.breezy_autotest
diff --git a/lib/lp/soyuz/tests/test_publishing.py b/lib/lp/soyuz/tests/test_publishing.py
index ec6f426..fbb19f0 100644
--- a/lib/lp/soyuz/tests/test_publishing.py
+++ b/lib/lp/soyuz/tests/test_publishing.py
@@ -592,12 +592,12 @@ class TestNativePublishingBase(TestCaseWithFactory, SoyuzTestPublisher):
592 dbuser = config.archivepublisher.dbuser592 dbuser = config.archivepublisher.dbuser
593593
594 def __init__(self, methodName='runTest'):594 def __init__(self, methodName='runTest'):
595 super(TestNativePublishingBase, self).__init__(methodName=methodName)595 super().__init__(methodName=methodName)
596 SoyuzTestPublisher.__init__(self)596 SoyuzTestPublisher.__init__(self)
597597
598 def setUp(self):598 def setUp(self):
599 """Setup a pool dir, the librarian, and instantiate the DiskPool."""599 """Setup a pool dir, the librarian, and instantiate the DiskPool."""
600 super(TestNativePublishingBase, self).setUp()600 super().setUp()
601 switch_dbuser(config.archivepublisher.dbuser)601 switch_dbuser(config.archivepublisher.dbuser)
602 self.prepareBreezyAutotest()602 self.prepareBreezyAutotest()
603 self.config = getPubConfig(self.ubuntutest.main_archive)603 self.config = getPubConfig(self.ubuntutest.main_archive)
@@ -609,7 +609,7 @@ class TestNativePublishingBase(TestCaseWithFactory, SoyuzTestPublisher):
609609
610 def tearDown(self):610 def tearDown(self):
611 """Tear down blows the pool dirs away."""611 """Tear down blows the pool dirs away."""
612 super(TestNativePublishingBase, self).tearDown()612 super().tearDown()
613 for root in (613 for root in (
614 self.config.distroroot,614 self.config.distroroot,
615 config.personalpackagearchive.root,615 config.personalpackagearchive.root,
@@ -862,7 +862,7 @@ class PublishingSetTests(TestCaseWithFactory):
862 layer = DatabaseFunctionalLayer862 layer = DatabaseFunctionalLayer
863863
864 def setUp(self):864 def setUp(self):
865 super(PublishingSetTests, self).setUp()865 super().setUp()
866 self.distroseries = self.factory.makeDistroSeries()866 self.distroseries = self.factory.makeDistroSeries()
867 self.archive = self.factory.makeArchive(867 self.archive = self.factory.makeArchive(
868 distribution=self.distroseries.distribution)868 distribution=self.distroseries.distribution)
@@ -919,7 +919,7 @@ class TestPublishingSetLite(TestCaseWithFactory):
919 layer = ZopelessDatabaseLayer919 layer = ZopelessDatabaseLayer
920920
921 def setUp(self):921 def setUp(self):
922 super(TestPublishingSetLite, self).setUp()922 super().setUp()
923 self.person = self.factory.makePerson()923 self.person = self.factory.makePerson()
924924
925 def test_requestDeletion_marks_SPPHs_deleted(self):925 def test_requestDeletion_marks_SPPHs_deleted(self):
diff --git a/lib/lp/soyuz/tests/test_publishing_models.py b/lib/lp/soyuz/tests/test_publishing_models.py
index f91efa4..8fd922b 100644
--- a/lib/lp/soyuz/tests/test_publishing_models.py
+++ b/lib/lp/soyuz/tests/test_publishing_models.py
@@ -41,7 +41,7 @@ class TestPublishingSet(BaseTestCaseWithThreeBuilds):
4141
42 def setUp(self):42 def setUp(self):
43 """Use `SoyuzTestPublisher` to publish some sources in archives."""43 """Use `SoyuzTestPublisher` to publish some sources in archives."""
44 super(TestPublishingSet, self).setUp()44 super().setUp()
4545
46 # Ensure all the builds have been built.46 # Ensure all the builds have been built.
47 for build in self.builds:47 for build in self.builds:
diff --git a/lib/lp/soyuz/wsgi/tests/test_archiveauth.py b/lib/lp/soyuz/wsgi/tests/test_archiveauth.py
index e1149da..fe2088f 100644
--- a/lib/lp/soyuz/wsgi/tests/test_archiveauth.py
+++ b/lib/lp/soyuz/wsgi/tests/test_archiveauth.py
@@ -26,7 +26,7 @@ class TestWSGIArchiveAuth(TestCaseWithFactory):
26 layer = ZopelessAppServerLayer26 layer = ZopelessAppServerLayer
2727
28 def setUp(self):28 def setUp(self):
29 super(TestWSGIArchiveAuth, self).setUp()29 super().setUp()
30 self.now = time.time()30 self.now = time.time()
31 self.useFixture(MonkeyPatch("time.time", lambda: self.now))31 self.useFixture(MonkeyPatch("time.time", lambda: self.now))
32 self.memcache_fixture = self.useFixture(MemcacheFixture())32 self.memcache_fixture = self.useFixture(MemcacheFixture())
diff --git a/lib/lp/soyuz/xmlrpc/tests/test_archive.py b/lib/lp/soyuz/xmlrpc/tests/test_archive.py
index d34a879..e487a22 100644
--- a/lib/lp/soyuz/xmlrpc/tests/test_archive.py
+++ b/lib/lp/soyuz/xmlrpc/tests/test_archive.py
@@ -22,7 +22,7 @@ class TestArchiveAPI(TestCaseWithFactory):
22 layer = LaunchpadFunctionalLayer22 layer = LaunchpadFunctionalLayer
2323
24 def setUp(self):24 def setUp(self):
25 super(TestArchiveAPI, self).setUp()25 super().setUp()
26 self.useFixture(FeatureFixture({NAMED_AUTH_TOKEN_FEATURE_FLAG: "on"}))26 self.useFixture(FeatureFixture({NAMED_AUTH_TOKEN_FEATURE_FLAG: "on"}))
27 self.archive_api = ArchiveAPI(None, None)27 self.archive_api = ArchiveAPI(None, None)
28 self.pushConfig(28 self.pushConfig(

Subscribers

People subscribed via source and target branches

to status/vote changes: