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

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: b777676333c9f8a6a0819737086535bf51008c52
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:pyupgrade-py3-snappy
Merge into: launchpad:master
Diff against target: 1190 lines (+115/-126)
40 files modified
.git-blame-ignore-revs (+2/-0)
.pre-commit-config.yaml (+1/-0)
lib/lp/snappy/adapters/buildarch.py (+7/-9)
lib/lp/snappy/browser/snap.py (+22/-27)
lib/lp/snappy/browser/snapbuild.py (+1/-1)
lib/lp/snappy/browser/snaplisting.py (+2/-2)
lib/lp/snappy/browser/snapsubscription.py (+2/-2)
lib/lp/snappy/browser/tests/test_hassnaps.py (+1/-1)
lib/lp/snappy/browser/tests/test_snap.py (+7/-7)
lib/lp/snappy/browser/tests/test_snapbuild.py (+1/-1)
lib/lp/snappy/browser/tests/test_snapsubscription.py (+1/-1)
lib/lp/snappy/browser/widgets/snaparchive.py (+1/-1)
lib/lp/snappy/browser/widgets/snapbuildchannels.py (+2/-2)
lib/lp/snappy/browser/widgets/storechannels.py (+2/-2)
lib/lp/snappy/browser/widgets/tests/test_snaparchivewidget.py (+1/-1)
lib/lp/snappy/browser/widgets/tests/test_snapbuildchannelswidget.py (+1/-1)
lib/lp/snappy/browser/widgets/tests/test_storechannelswidget.py (+1/-1)
lib/lp/snappy/interfaces/snap.py (+12/-15)
lib/lp/snappy/interfaces/snapbase.py (+1/-2)
lib/lp/snappy/interfaces/snapstoreclient.py (+1/-1)
lib/lp/snappy/mail/snapbuild.py (+3/-4)
lib/lp/snappy/model/snap.py (+1/-1)
lib/lp/snappy/model/snapbase.py (+2/-3)
lib/lp/snappy/model/snapbuild.py (+3/-3)
lib/lp/snappy/model/snapbuildbehaviour.py (+1/-2)
lib/lp/snappy/model/snapbuildjob.py (+4/-4)
lib/lp/snappy/model/snapjob.py (+2/-2)
lib/lp/snappy/model/snappyseries.py (+2/-2)
lib/lp/snappy/model/snapstoreclient.py (+1/-1)
lib/lp/snappy/model/snapsubscription.py (+1/-1)
lib/lp/snappy/tests/test_snap.py (+7/-7)
lib/lp/snappy/tests/test_snapbase.py (+1/-1)
lib/lp/snappy/tests/test_snapbuild.py (+4/-4)
lib/lp/snappy/tests/test_snapbuildbehaviour.py (+3/-3)
lib/lp/snappy/tests/test_snapbuildjob.py (+2/-2)
lib/lp/snappy/tests/test_snappyseries.py (+4/-4)
lib/lp/snappy/tests/test_snapstoreclient.py (+2/-2)
lib/lp/snappy/tests/test_snapvocabularies.py (+1/-1)
lib/lp/snappy/validators/tests/test_channels.py (+1/-1)
lib/lp/snappy/vocabularies.py (+1/-1)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+413834@code.launchpad.net

Commit message

lp.snappy: 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 0177d98..c6458be 100644
--- a/.git-blame-ignore-revs
+++ b/.git-blame-ignore-revs
@@ -40,3 +40,5 @@ fbed83f22424df8fa5647349493f78937a520db5
4046f47b6eb925ce6d784c7a0ed47653da7a9741104046f47b6eb925ce6d784c7a0ed47653da7a974110
41# apply pyupgrade --py3-plus to lp.services.[n-z]*41# apply pyupgrade --py3-plus to lp.services.[n-z]*
42f3f15787ebabe305fbf3e3ae6c0fd8ca7dfb446542f3f15787ebabe305fbf3e3ae6c0fd8ca7dfb4465
43# apply pyupgrade --py3-plus to lp.snappy
442cda038936743a2f9271953c23b9fcc98968db63
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index d633860..d70d934 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -55,6 +55,7 @@ repos:
55 |registry55 |registry
56 |scripts56 |scripts
57 |services57 |services
58 |snappy
58 )/59 )/
59- repo: https://github.com/PyCQA/isort60- repo: https://github.com/PyCQA/isort
60 rev: 5.9.261 rev: 5.9.2
diff --git a/lib/lp/snappy/adapters/buildarch.py b/lib/lp/snappy/adapters/buildarch.py
index e9b01cf..fe8680b 100644
--- a/lib/lp/snappy/adapters/buildarch.py
+++ b/lib/lp/snappy/adapters/buildarch.py
@@ -7,8 +7,6 @@ __all__ = [
77
8from collections import Counter8from collections import Counter
99
10import six
11
12from lp.services.helpers import english_list10from lp.services.helpers import english_list
1311
1412
@@ -20,7 +18,7 @@ class MissingPropertyError(SnapArchitecturesParserError):
20 """Error for when an expected property is not present in the YAML."""18 """Error for when an expected property is not present in the YAML."""
2119
22 def __init__(self, prop):20 def __init__(self, prop):
23 super(MissingPropertyError, self).__init__(21 super().__init__(
24 "Architecture specification is missing the {!r} property".format(22 "Architecture specification is missing the {!r} property".format(
25 prop))23 prop))
26 self.property = prop24 self.property = prop
@@ -30,7 +28,7 @@ class IncompatibleArchitecturesStyleError(SnapArchitecturesParserError):
30 """Error for when architectures mix incompatible styles."""28 """Error for when architectures mix incompatible styles."""
3129
32 def __init__(self):30 def __init__(self):
33 super(IncompatibleArchitecturesStyleError, self).__init__(31 super().__init__(
34 "'architectures' must either be a list of strings or dicts, not "32 "'architectures' must either be a list of strings or dicts, not "
35 "both")33 "both")
3634
@@ -39,7 +37,7 @@ class DuplicateBuildOnError(SnapArchitecturesParserError):
39 """Error for when multiple `build-on`s include the same architecture."""37 """Error for when multiple `build-on`s include the same architecture."""
4038
41 def __init__(self, duplicates):39 def __init__(self, duplicates):
42 super(DuplicateBuildOnError, self).__init__(40 super().__init__(
43 "{} {} present in the 'build-on' of multiple items".format(41 "{} {} present in the 'build-on' of multiple items".format(
44 english_list(duplicates),42 english_list(duplicates),
45 "is" if len(duplicates) == 1 else "are"))43 "is" if len(duplicates) == 1 else "are"))
@@ -49,7 +47,7 @@ class UnsupportedBuildOnError(SnapArchitecturesParserError):
49 """Error for when a requested architecture is not supported."""47 """Error for when a requested architecture is not supported."""
5048
51 def __init__(self, build_on):49 def __init__(self, build_on):
52 super(UnsupportedBuildOnError, self).__init__(50 super().__init__(
53 "build-on specifies no supported architectures: {!r}".format(51 "build-on specifies no supported architectures: {!r}".format(
54 build_on))52 build_on))
55 self.build_on = build_on53 self.build_on = build_on
@@ -69,10 +67,10 @@ class SnapArchitecture:
69 snapcraft.yaml.67 snapcraft.yaml.
70 """68 """
71 self.build_on = (69 self.build_on = (
72 [build_on] if isinstance(build_on, six.string_types) else build_on)70 [build_on] if isinstance(build_on, str) else build_on)
73 if run_on:71 if run_on:
74 self.run_on = (72 self.run_on = (
75 [run_on] if isinstance(run_on, six.string_types) else run_on)73 [run_on] if isinstance(run_on, str) else run_on)
76 else:74 else:
77 self.run_on = self.build_on75 self.run_on = self.build_on
78 self.build_error = build_error76 self.build_error = build_error
@@ -131,7 +129,7 @@ def determine_architectures_to_build(snapcraft_data, supported_arches):
131 if architectures_list:129 if architectures_list:
132 # First, determine what style we're parsing. Is it a list of130 # First, determine what style we're parsing. Is it a list of
133 # strings or a list of dicts?131 # strings or a list of dicts?
134 if all(isinstance(a, six.string_types) for a in architectures_list):132 if all(isinstance(a, str) for a in architectures_list):
135 # If a list of strings (old style), then that's only a single133 # If a list of strings (old style), then that's only a single
136 # item.134 # item.
137 architectures = [SnapArchitecture(build_on=architectures_list)]135 architectures = [SnapArchitecture(build_on=architectures_list)]
diff --git a/lib/lp/snappy/browser/snap.py b/lib/lp/snappy/browser/snap.py
index 6055137..0fc63ca 100644
--- a/lib/lp/snappy/browser/snap.py
+++ b/lib/lp/snappy/browser/snap.py
@@ -20,7 +20,6 @@ from lazr.restful.interface import (
20 copy_field,20 copy_field,
21 use_template,21 use_template,
22 )22 )
23import six
24from six.moves.urllib.parse import urlencode23from six.moves.urllib.parse import urlencode
25from zope.component import getUtility24from zope.component import getUtility
26from zope.error.interfaces import IErrorReportingUtility25from zope.error.interfaces import IErrorReportingUtility
@@ -184,9 +183,9 @@ class SnapFormMixin:
184 widget = self.widgets.get('vcs')183 widget = self.widgets.get('vcs')
185 if widget is not None:184 if widget is not None:
186 current_value = widget._getFormValue()185 current_value = widget._getFormValue()
187 self.vcs_bzr_radio, self.vcs_git_radio = [186 self.vcs_bzr_radio, self.vcs_git_radio = (
188 render_radio_widget_part(widget, value, current_value)187 render_radio_widget_part(widget, value, current_value)
189 for value in (VCSType.BZR, VCSType.GIT)]188 for value in (VCSType.BZR, VCSType.GIT))
190189
191190
192class SnapInformationTypeMixin:191class SnapInformationTypeMixin:
@@ -565,7 +564,7 @@ class SnapAddView(SnapAuthorizeMixin, EnableProcessorsMixin,
565564
566 def initialize(self):565 def initialize(self):
567 """See `LaunchpadView`."""566 """See `LaunchpadView`."""
568 super(SnapAddView, self).initialize()567 super().initialize()
569568
570 # Once initialized, if the private_snap flag is disabled, it569 # Once initialized, if the private_snap flag is disabled, it
571 # prevents snap creation for private contexts.570 # prevents snap creation for private contexts.
@@ -580,7 +579,7 @@ class SnapAddView(SnapAuthorizeMixin, EnableProcessorsMixin,
580579
581 def setUpFields(self):580 def setUpFields(self):
582 """See `LaunchpadFormView`."""581 """See `LaunchpadFormView`."""
583 super(SnapAddView, self).setUpFields()582 super().setUpFields()
584 self.form_fields += self.createEnabledProcessors(583 self.form_fields += self.createEnabledProcessors(
585 getUtility(IProcessorSet).getAll(),584 getUtility(IProcessorSet).getAll(),
586 "The architectures that this snap package builds for. Some "585 "The architectures that this snap package builds for. Some "
@@ -589,7 +588,7 @@ class SnapAddView(SnapAuthorizeMixin, EnableProcessorsMixin,
589588
590 def setUpWidgets(self):589 def setUpWidgets(self):
591 """See `LaunchpadFormView`."""590 """See `LaunchpadFormView`."""
592 super(SnapAddView, self).setUpWidgets()591 super().setUpWidgets()
593 self.widgets['processors'].widget_class = 'processors'592 self.widgets['processors'].widget_class = 'processors'
594 if self.is_project_context:593 if self.is_project_context:
595 # If we are on Project:+new-snap page, we know which information594 # If we are on Project:+new-snap page, we know which information
@@ -654,23 +653,23 @@ class SnapAddView(SnapAuthorizeMixin, EnableProcessorsMixin,
654 def validate_widgets(self, data, names=None):653 def validate_widgets(self, data, names=None):
655 """See `LaunchpadFormView`."""654 """See `LaunchpadFormView`."""
656 if self.widgets.get('vcs') is not None:655 if self.widgets.get('vcs') is not None:
657 super(SnapAddView, self).validate_widgets(data, ['vcs'])656 super().validate_widgets(data, ['vcs'])
658 self.validateVCSWidgets(SnapAddView, data)657 self.validateVCSWidgets(SnapAddView, data)
659 if self.widgets.get('auto_build') is not None:658 if self.widgets.get('auto_build') is not None:
660 # Set widgets as required or optional depending on the659 # Set widgets as required or optional depending on the
661 # auto_build field.660 # auto_build field.
662 super(SnapAddView, self).validate_widgets(data, ['auto_build'])661 super().validate_widgets(data, ['auto_build'])
663 auto_build = data.get('auto_build', False)662 auto_build = data.get('auto_build', False)
664 self.widgets['auto_build_archive'].context.required = auto_build663 self.widgets['auto_build_archive'].context.required = auto_build
665 self.widgets['auto_build_pocket'].context.required = auto_build664 self.widgets['auto_build_pocket'].context.required = auto_build
666 if self.widgets.get('store_upload') is not None:665 if self.widgets.get('store_upload') is not None:
667 # Set widgets as required or optional depending on the666 # Set widgets as required or optional depending on the
668 # store_upload field.667 # store_upload field.
669 super(SnapAddView, self).validate_widgets(data, ['store_upload'])668 super().validate_widgets(data, ['store_upload'])
670 store_upload = data.get('store_upload', False)669 store_upload = data.get('store_upload', False)
671 self.widgets['store_name'].context.required = store_upload670 self.widgets['store_name'].context.required = store_upload
672 self.widgets['store_channels'].context.required = store_upload671 self.widgets['store_channels'].context.required = store_upload
673 super(SnapAddView, self).validate_widgets(data, names=names)672 super().validate_widgets(data, names=names)
674673
675 @action('Create snap package', name='create')674 @action('Create snap package', name='create')
676 def create_action(self, action, data):675 def create_action(self, action, data):
@@ -709,7 +708,7 @@ class SnapAddView(SnapAuthorizeMixin, EnableProcessorsMixin,
709 self.next_url = canonical_url(snap)708 self.next_url = canonical_url(snap)
710709
711 def validate(self, data):710 def validate(self, data):
712 super(SnapAddView, self).validate(data)711 super().validate(data)
713 owner = data.get('owner', None)712 owner = data.get('owner', None)
714 name = data.get('name', None)713 name = data.get('name', None)
715 if owner and name:714 if owner and name:
@@ -732,7 +731,7 @@ class BaseSnapEditView(SnapAuthorizeMixin, SnapInformationTypeMixin,
732731
733 def setUpWidgets(self, context=None):732 def setUpWidgets(self, context=None):
734 """See `LaunchpadFormView`."""733 """See `LaunchpadFormView`."""
735 super(BaseSnapEditView, self).setUpWidgets()734 super().setUpWidgets()
736 self.setUpVCSWidgets()735 self.setUpVCSWidgets()
737736
738 @property737 @property
@@ -742,28 +741,26 @@ class BaseSnapEditView(SnapAuthorizeMixin, SnapInformationTypeMixin,
742 def validate_widgets(self, data, names=None):741 def validate_widgets(self, data, names=None):
743 """See `LaunchpadFormView`."""742 """See `LaunchpadFormView`."""
744 if self.widgets.get('vcs') is not None:743 if self.widgets.get('vcs') is not None:
745 super(BaseSnapEditView, self).validate_widgets(data, ['vcs'])744 super().validate_widgets(data, ['vcs'])
746 self.validateVCSWidgets(BaseSnapEditView, data)745 self.validateVCSWidgets(BaseSnapEditView, data)
747 if self.widgets.get('auto_build') is not None:746 if self.widgets.get('auto_build') is not None:
748 # Set widgets as required or optional depending on the747 # Set widgets as required or optional depending on the
749 # auto_build field.748 # auto_build field.
750 super(BaseSnapEditView, self).validate_widgets(749 super().validate_widgets(data, ['auto_build'])
751 data, ['auto_build'])
752 auto_build = data.get('auto_build', False)750 auto_build = data.get('auto_build', False)
753 self.widgets['auto_build_archive'].context.required = auto_build751 self.widgets['auto_build_archive'].context.required = auto_build
754 self.widgets['auto_build_pocket'].context.required = auto_build752 self.widgets['auto_build_pocket'].context.required = auto_build
755 if self.widgets.get('store_upload') is not None:753 if self.widgets.get('store_upload') is not None:
756 # Set widgets as required or optional depending on the754 # Set widgets as required or optional depending on the
757 # store_upload field.755 # store_upload field.
758 super(BaseSnapEditView, self).validate_widgets(756 super().validate_widgets(data, ['store_upload'])
759 data, ['store_upload'])
760 store_upload = data.get('store_upload', False)757 store_upload = data.get('store_upload', False)
761 self.widgets['store_name'].context.required = store_upload758 self.widgets['store_name'].context.required = store_upload
762 self.widgets['store_channels'].context.required = store_upload759 self.widgets['store_channels'].context.required = store_upload
763 super(BaseSnapEditView, self).validate_widgets(data, names=names)760 super().validate_widgets(data, names=names)
764761
765 def validate(self, data):762 def validate(self, data):
766 super(BaseSnapEditView, self).validate(data)763 super().validate(data)
767 info_type = data.get('information_type', self.context.information_type)764 info_type = data.get('information_type', self.context.information_type)
768 editing_info_type = 'information_type' in data765 editing_info_type = 'information_type' in data
769 private = info_type in PRIVATE_INFORMATION_TYPES766 private = info_type in PRIVATE_INFORMATION_TYPES
@@ -876,8 +873,7 @@ class SnapAdminView(BaseSnapEditView):
876 if 'project' in data:873 if 'project' in data:
877 project = data.pop('project')874 project = data.pop('project')
878 self.context.setProject(project)875 self.context.setProject(project)
879 super(SnapAdminView, self).updateContextFromData(876 super().updateContextFromData(data, context, notify_modified)
880 data, context, notify_modified)
881877
882878
883class SnapEditView(BaseSnapEditView, EnableProcessorsMixin):879class SnapEditView(BaseSnapEditView, EnableProcessorsMixin):
@@ -926,7 +922,7 @@ class SnapEditView(BaseSnapEditView, EnableProcessorsMixin):
926922
927 def setUpFields(self):923 def setUpFields(self):
928 """See `LaunchpadFormView`."""924 """See `LaunchpadFormView`."""
929 super(SnapEditView, self).setUpFields()925 super().setUpFields()
930 self.form_fields += self.createEnabledProcessors(926 self.form_fields += self.createEnabledProcessors(
931 self.context.available_processors,927 self.context.available_processors,
932 "The architectures that this snap package builds for. Some "928 "The architectures that this snap package builds for. Some "
@@ -934,7 +930,7 @@ class SnapEditView(BaseSnapEditView, EnableProcessorsMixin):
934 "disabled by administrators.")930 "disabled by administrators.")
935931
936 def setUpWidgets(self, context=None):932 def setUpWidgets(self, context=None):
937 super(SnapEditView, self).setUpWidgets(context)933 super().setUpWidgets(context)
938 info_type_widget = self.widgets['information_type']934 info_type_widget = self.widgets['information_type']
939 info_type_widget.vocabulary = InformationTypeVocabulary(935 info_type_widget.vocabulary = InformationTypeVocabulary(
940 types=self.getPossibleInformationTypes(self.context, self.user))936 types=self.getPossibleInformationTypes(self.context, self.user))
@@ -957,7 +953,7 @@ class SnapEditView(BaseSnapEditView, EnableProcessorsMixin):
957 return initial_values953 return initial_values
958954
959 def validate(self, data):955 def validate(self, data):
960 super(SnapEditView, self).validate(data)956 super().validate(data)
961 owner = data.get('owner', None)957 owner = data.get('owner', None)
962 name = data.get('name', None)958 name = data.get('name', None)
963 if owner and name:959 if owner and name:
@@ -988,8 +984,7 @@ class SnapEditView(BaseSnapEditView, EnableProcessorsMixin):
988 if 'project' in data:984 if 'project' in data:
989 project = data.pop('project')985 project = data.pop('project')
990 self.context.setProject(project)986 self.context.setProject(project)
991 super(SnapEditView, self).updateContextFromData(987 super().updateContextFromData(data, context, notify_modified)
992 data, context, notify_modified)
993988
994989
995class SnapAuthorizeView(LaunchpadEditFormView):990class SnapAuthorizeView(LaunchpadEditFormView):
@@ -1029,7 +1024,7 @@ class SnapAuthorizeView(LaunchpadEditFormView):
1029 ])1024 ])
1030 return login_url1025 return login_url
1031 except CannotAuthorizeStoreUploads as e:1026 except CannotAuthorizeStoreUploads as e:
1032 request.response.addInfoNotification(six.text_type(e))1027 request.response.addInfoNotification(str(e))
1033 request.response.redirect(canonical_url(snap))1028 request.response.redirect(canonical_url(snap))
1034 return1029 return
10351030
diff --git a/lib/lp/snappy/browser/snapbuild.py b/lib/lp/snappy/browser/snapbuild.py
index ff5e231..ad54692 100644
--- a/lib/lp/snappy/browser/snapbuild.py
+++ b/lib/lp/snappy/browser/snapbuild.py
@@ -163,7 +163,7 @@ class SnapBuildRescoreView(LaunchpadFormView):
163163
164 def __call__(self):164 def __call__(self):
165 if self.context.can_be_rescored:165 if self.context.can_be_rescored:
166 return super(SnapBuildRescoreView, self).__call__()166 return super().__call__()
167 self.request.response.addWarningNotification(167 self.request.response.addWarningNotification(
168 "Cannot rescore this build because it is not queued.")168 "Cannot rescore this build because it is not queued.")
169 self.request.response.redirect(canonical_url(self.context))169 self.request.response.redirect(canonical_url(self.context))
diff --git a/lib/lp/snappy/browser/snaplisting.py b/lib/lp/snappy/browser/snaplisting.py
index 7c2e9d5..37098b5 100644
--- a/lib/lp/snappy/browser/snaplisting.py
+++ b/lib/lp/snappy/browser/snaplisting.py
@@ -39,7 +39,7 @@ class SnapListingView(LaunchpadView, FeedsMixin):
39 'displayname': self.context.displayname}39 'displayname': self.context.displayname}
4040
41 def initialize(self):41 def initialize(self):
42 super(SnapListingView, self).initialize()42 super().initialize()
43 snaps = getUtility(ISnapSet).findByContext(43 snaps = getUtility(ISnapSet).findByContext(
44 self.context, visible_by_user=self.user)44 self.context, visible_by_user=self.user)
45 loader = partial(45 loader = partial(
@@ -56,7 +56,7 @@ class BranchSnapListingView(SnapListingView):
56 source_enabled = False56 source_enabled = False
5757
58 def initialize(self):58 def initialize(self):
59 super(BranchSnapListingView, self).initialize()59 super().initialize()
60 # Replace our context with a decorated branch, if it is not already60 # Replace our context with a decorated branch, if it is not already
61 # decorated.61 # decorated.
62 if not isinstance(self.context, DecoratedBranch):62 if not isinstance(self.context, DecoratedBranch):
diff --git a/lib/lp/snappy/browser/snapsubscription.py b/lib/lp/snappy/browser/snapsubscription.py
index 0b4afb3..dcb6a2c 100644
--- a/lib/lp/snappy/browser/snapsubscription.py
+++ b/lib/lp/snappy/browser/snapsubscription.py
@@ -93,7 +93,7 @@ class SnapSubscriptionEditView(RedirectToSnapMixin, LaunchpadEditFormView):
93 def initialize(self):93 def initialize(self):
94 self.snap = self.context.snap94 self.snap = self.context.snap
95 self.person = self.context.person95 self.person = self.context.person
96 super(SnapSubscriptionEditView, self).initialize()96 super().initialize()
9797
98 @action("Unsubscribe", name="unsubscribe")98 @action("Unsubscribe", name="unsubscribe")
99 def unsubscribe_action(self, action, data):99 def unsubscribe_action(self, action, data):
@@ -112,7 +112,7 @@ class _SnapSubscriptionCreationView(RedirectToSnapMixin, LaunchpadFormView):
112112
113 def initialize(self):113 def initialize(self):
114 self.snap = self.context114 self.snap = self.context
115 super(_SnapSubscriptionCreationView, self).initialize()115 super().initialize()
116116
117117
118class SnapSubscriptionAddView(_SnapSubscriptionCreationView):118class SnapSubscriptionAddView(_SnapSubscriptionCreationView):
diff --git a/lib/lp/snappy/browser/tests/test_hassnaps.py b/lib/lp/snappy/browser/tests/test_hassnaps.py
index b70994a..88608a6 100644
--- a/lib/lp/snappy/browser/tests/test_hassnaps.py
+++ b/lib/lp/snappy/browser/tests/test_hassnaps.py
@@ -104,7 +104,7 @@ class TestHasSnapsMenu(WithScenarios, TestCaseWithFactory):
104 ]104 ]
105105
106 def setUp(self):106 def setUp(self):
107 super(TestHasSnapsMenu, self).setUp()107 super().setUp()
108 if self.needs_git_hosting_fixture:108 if self.needs_git_hosting_fixture:
109 self.useFixture(GitHostingFixture())109 self.useFixture(GitHostingFixture())
110110
diff --git a/lib/lp/snappy/browser/tests/test_snap.py b/lib/lp/snappy/browser/tests/test_snap.py
index 3e54942..c513111 100644
--- a/lib/lp/snappy/browser/tests/test_snap.py
+++ b/lib/lp/snappy/browser/tests/test_snap.py
@@ -118,7 +118,7 @@ class TestSnapNavigation(TestCaseWithFactory):
118 layer = DatabaseFunctionalLayer118 layer = DatabaseFunctionalLayer
119119
120 def setUp(self):120 def setUp(self):
121 super(TestSnapNavigation, self).setUp()121 super().setUp()
122 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))122 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
123123
124 def test_canonical_url(self):124 def test_canonical_url(self):
@@ -162,7 +162,7 @@ class BaseTestSnapView(BrowserTestCase):
162 layer = LaunchpadFunctionalLayer162 layer = LaunchpadFunctionalLayer
163163
164 def setUp(self):164 def setUp(self):
165 super(BaseTestSnapView, self).setUp()165 super().setUp()
166 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))166 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
167 self.useFixture(FakeLogger())167 self.useFixture(FakeLogger())
168 self.snap_store_client = FakeMethod()168 self.snap_store_client = FakeMethod()
@@ -181,7 +181,7 @@ class BaseTestSnapView(BrowserTestCase):
181class TestSnapAddView(BaseTestSnapView):181class TestSnapAddView(BaseTestSnapView):
182182
183 def setUp(self):183 def setUp(self):
184 super(TestSnapAddView, self).setUp()184 super().setUp()
185 self.distroseries = self.factory.makeUbuntuDistroSeries(185 self.distroseries = self.factory.makeUbuntuDistroSeries(
186 version="13.10")186 version="13.10")
187 with admin_logged_in():187 with admin_logged_in():
@@ -846,7 +846,7 @@ class TestSnapAdminView(BaseTestSnapView):
846class TestSnapEditView(BaseTestSnapView):846class TestSnapEditView(BaseTestSnapView):
847847
848 def setUp(self):848 def setUp(self):
849 super(TestSnapEditView, self).setUp()849 super().setUp()
850 self.distroseries = self.factory.makeUbuntuDistroSeries(850 self.distroseries = self.factory.makeUbuntuDistroSeries(
851 version="13.10")851 version="13.10")
852 with admin_logged_in():852 with admin_logged_in():
@@ -1472,7 +1472,7 @@ class TestSnapEditView(BaseTestSnapView):
1472class TestSnapAuthorizeView(BaseTestSnapView):1472class TestSnapAuthorizeView(BaseTestSnapView):
14731473
1474 def setUp(self):1474 def setUp(self):
1475 super(TestSnapAuthorizeView, self).setUp()1475 super().setUp()
1476 self.distroseries = self.factory.makeUbuntuDistroSeries()1476 self.distroseries = self.factory.makeUbuntuDistroSeries()
1477 with admin_logged_in():1477 with admin_logged_in():
1478 self.snappyseries = self.factory.makeSnappySeries(1478 self.snappyseries = self.factory.makeSnappySeries(
@@ -1620,7 +1620,7 @@ class TestSnapDeleteView(BaseTestSnapView):
1620class TestSnapView(BaseTestSnapView):1620class TestSnapView(BaseTestSnapView):
16211621
1622 def setUp(self):1622 def setUp(self):
1623 super(TestSnapView, self).setUp()1623 super().setUp()
1624 self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu1624 self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
1625 self.distroseries = self.factory.makeDistroSeries(1625 self.distroseries = self.factory.makeDistroSeries(
1626 distribution=self.ubuntu, name="shiny", displayname="Shiny")1626 distribution=self.ubuntu, name="shiny", displayname="Shiny")
@@ -2080,7 +2080,7 @@ class TestSnapView(BaseTestSnapView):
2080class TestSnapRequestBuildsView(BaseTestSnapView):2080class TestSnapRequestBuildsView(BaseTestSnapView):
20812081
2082 def setUp(self):2082 def setUp(self):
2083 super(TestSnapRequestBuildsView, self).setUp()2083 super().setUp()
2084 self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu2084 self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
2085 self.distroseries = self.factory.makeDistroSeries(2085 self.distroseries = self.factory.makeDistroSeries(
2086 distribution=self.ubuntu, name="shiny", displayname="Shiny")2086 distribution=self.ubuntu, name="shiny", displayname="Shiny")
diff --git a/lib/lp/snappy/browser/tests/test_snapbuild.py b/lib/lp/snappy/browser/tests/test_snapbuild.py
index ef78906..5b802d5 100644
--- a/lib/lp/snappy/browser/tests/test_snapbuild.py
+++ b/lib/lp/snappy/browser/tests/test_snapbuild.py
@@ -236,7 +236,7 @@ class TestSnapBuildOperations(BrowserTestCase):
236 layer = DatabaseFunctionalLayer236 layer = DatabaseFunctionalLayer
237237
238 def setUp(self):238 def setUp(self):
239 super(TestSnapBuildOperations, self).setUp()239 super().setUp()
240 self.useFixture(FakeLogger())240 self.useFixture(FakeLogger())
241 self.build = self.factory.makeSnapBuild()241 self.build = self.factory.makeSnapBuild()
242 self.build_url = canonical_url(self.build)242 self.build_url = canonical_url(self.build)
diff --git a/lib/lp/snappy/browser/tests/test_snapsubscription.py b/lib/lp/snappy/browser/tests/test_snapsubscription.py
index d73e0cc..575c0d6 100644
--- a/lib/lp/snappy/browser/tests/test_snapsubscription.py
+++ b/lib/lp/snappy/browser/tests/test_snapsubscription.py
@@ -30,7 +30,7 @@ class BaseTestSnapView(BrowserTestCase):
30 layer = DatabaseFunctionalLayer30 layer = DatabaseFunctionalLayer
3131
32 def setUp(self):32 def setUp(self):
33 super(BaseTestSnapView, self).setUp()33 super().setUp()
34 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))34 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
35 self.useFixture(FakeLogger())35 self.useFixture(FakeLogger())
36 self.person = self.factory.makePerson(name='snap-owner')36 self.person = self.factory.makePerson(name='snap-owner')
diff --git a/lib/lp/snappy/browser/widgets/snaparchive.py b/lib/lp/snappy/browser/widgets/snaparchive.py
index 74102aa..538123e 100644
--- a/lib/lp/snappy/browser/widgets/snaparchive.py
+++ b/lib/lp/snappy/browser/widgets/snaparchive.py
@@ -137,7 +137,7 @@ class SnapArchiveWidget(BrowserWidget, InputWidget):
137 self.getInputValue()137 self.getInputValue()
138 except InputErrors as error:138 except InputErrors as error:
139 self._error = error139 self._error = error
140 return super(SnapArchiveWidget, self).error()140 return super().error()
141141
142 def __call__(self):142 def __call__(self):
143 """See `IBrowserWidget`."""143 """See `IBrowserWidget`."""
diff --git a/lib/lp/snappy/browser/widgets/snapbuildchannels.py b/lib/lp/snappy/browser/widgets/snapbuildchannels.py
index 1be81fc..8d0264d 100644
--- a/lib/lp/snappy/browser/widgets/snapbuildchannels.py
+++ b/lib/lp/snappy/browser/widgets/snapbuildchannels.py
@@ -37,7 +37,7 @@ class SnapBuildChannelsWidget(BrowserWidget, InputWidget):
37 _widgets_set_up = False37 _widgets_set_up = False
3838
39 def __init__(self, context, request):39 def __init__(self, context, request):
40 super(SnapBuildChannelsWidget, self).__init__(context, request)40 super().__init__(context, request)
41 self.hint = (41 self.hint = (
42 'The channels to use for build tools when building the snap '42 'The channels to use for build tools when building the snap '
43 'package.\n')43 'package.\n')
@@ -112,7 +112,7 @@ class SnapBuildChannelsWidget(BrowserWidget, InputWidget):
112 self.getInputValue()112 self.getInputValue()
113 except InputErrors as error:113 except InputErrors as error:
114 self._error = error114 self._error = error
115 return super(SnapBuildChannelsWidget, self).error()115 return super().error()
116116
117 def __call__(self):117 def __call__(self):
118 """See `IBrowserWidget`."""118 """See `IBrowserWidget`."""
diff --git a/lib/lp/snappy/browser/widgets/storechannels.py b/lib/lp/snappy/browser/widgets/storechannels.py
index 996393b..7b0badf 100644
--- a/lib/lp/snappy/browser/widgets/storechannels.py
+++ b/lib/lp/snappy/browser/widgets/storechannels.py
@@ -48,7 +48,7 @@ class StoreChannelsWidget(BrowserWidget, InputWidget):
4848
49 def __init__(self, field, value_type, request):49 def __init__(self, field, value_type, request):
50 # We don't use value_type.50 # We don't use value_type.
51 super(StoreChannelsWidget, self).__init__(field, request)51 super().__init__(field, request)
52 # disable help_text for the global widget52 # disable help_text for the global widget
53 self.hint = None53 self.hint = None
5454
@@ -168,7 +168,7 @@ class StoreChannelsWidget(BrowserWidget, InputWidget):
168 self.getInputValue()168 self.getInputValue()
169 except InputErrors as error:169 except InputErrors as error:
170 self._error = error170 self._error = error
171 return super(StoreChannelsWidget, self).error()171 return super().error()
172172
173 def __call__(self):173 def __call__(self):
174 """See `IBrowserWidget`."""174 """See `IBrowserWidget`."""
diff --git a/lib/lp/snappy/browser/widgets/tests/test_snaparchivewidget.py b/lib/lp/snappy/browser/widgets/tests/test_snaparchivewidget.py
index e6b1ec1..5116684 100644
--- a/lib/lp/snappy/browser/widgets/tests/test_snaparchivewidget.py
+++ b/lib/lp/snappy/browser/widgets/tests/test_snaparchivewidget.py
@@ -60,7 +60,7 @@ class TestSnapArchiveWidget(WithScenarios, TestCaseWithFactory):
60 ]60 ]
6161
62 def setUp(self):62 def setUp(self):
63 super(TestSnapArchiveWidget, self).setUp()63 super().setUp()
64 self.distroseries = self.factory.makeDistroSeries()64 self.distroseries = self.factory.makeDistroSeries()
65 field = Reference(__name__="archive", schema=IArchive, title="Archive")65 field = Reference(__name__="archive", schema=IArchive, title="Archive")
66 self.context = self.context_factory(self)66 self.context = self.context_factory(self)
diff --git a/lib/lp/snappy/browser/widgets/tests/test_snapbuildchannelswidget.py b/lib/lp/snappy/browser/widgets/tests/test_snapbuildchannelswidget.py
index 2d4dc25..543d4ed 100644
--- a/lib/lp/snappy/browser/widgets/tests/test_snapbuildchannelswidget.py
+++ b/lib/lp/snappy/browser/widgets/tests/test_snapbuildchannelswidget.py
@@ -28,7 +28,7 @@ class TestSnapBuildChannelsWidget(TestCaseWithFactory):
28 layer = DatabaseFunctionalLayer28 layer = DatabaseFunctionalLayer
2929
30 def setUp(self):30 def setUp(self):
31 super(TestSnapBuildChannelsWidget, self).setUp()31 super().setUp()
32 field = Dict(32 field = Dict(
33 __name__="auto_build_channels",33 __name__="auto_build_channels",
34 title="Source snap channels for automatic builds")34 title="Source snap channels for automatic builds")
diff --git a/lib/lp/snappy/browser/widgets/tests/test_storechannelswidget.py b/lib/lp/snappy/browser/widgets/tests/test_storechannelswidget.py
index bc452aa..6deb9de 100644
--- a/lib/lp/snappy/browser/widgets/tests/test_storechannelswidget.py
+++ b/lib/lp/snappy/browser/widgets/tests/test_storechannelswidget.py
@@ -31,7 +31,7 @@ class TestStoreChannelsWidget(TestCaseWithFactory):
31 layer = DatabaseFunctionalLayer31 layer = DatabaseFunctionalLayer
3232
33 def setUp(self):33 def setUp(self):
34 super(TestStoreChannelsWidget, self).setUp()34 super().setUp()
35 field = List(__name__="channels", title="Store channels")35 field = List(__name__="channels", title="Store channels")
36 self.context = self.factory.makeSnap()36 self.context = self.factory.makeSnap()
37 field = field.bind(self.context)37 field = field.bind(self.context)
diff --git a/lib/lp/snappy/interfaces/snap.py b/lib/lp/snappy/interfaces/snap.py
index 957a378..af3cfd8 100644
--- a/lib/lp/snappy/interfaces/snap.py
+++ b/lib/lp/snappy/interfaces/snap.py
@@ -133,7 +133,7 @@ class SnapBuildAlreadyPending(Exception):
133 """A build was requested when an identical build was already pending."""133 """A build was requested when an identical build was already pending."""
134134
135 def __init__(self):135 def __init__(self):
136 super(SnapBuildAlreadyPending, self).__init__(136 super().__init__(
137 "An identical build of this snap package is already pending.")137 "An identical build of this snap package is already pending.")
138138
139139
@@ -150,7 +150,7 @@ class SnapBuildArchiveOwnerMismatch(Forbidden):
150 """150 """
151151
152 def __init__(self):152 def __init__(self):
153 super(SnapBuildArchiveOwnerMismatch, self).__init__(153 super().__init__(
154 "Snap package builds against private archives are only allowed "154 "Snap package builds against private archives are only allowed "
155 "if the snap package owner and the archive owner are equal.")155 "if the snap package owner and the archive owner are equal.")
156156
@@ -160,7 +160,7 @@ class SnapBuildDisallowedArchitecture(Exception):
160 """A build was requested for a disallowed architecture."""160 """A build was requested for a disallowed architecture."""
161161
162 def __init__(self, das, pocket):162 def __init__(self, das, pocket):
163 super(SnapBuildDisallowedArchitecture, self).__init__(163 super().__init__(
164 "This snap package is not allowed to build for %s/%s." %164 "This snap package is not allowed to build for %s/%s." %
165 (das.distroseries.getSuite(pocket), das.architecturetag))165 (das.distroseries.getSuite(pocket), das.architecturetag))
166166
@@ -170,8 +170,7 @@ class SnapPrivateFeatureDisabled(Unauthorized):
170 """Only certain users can create private snap objects."""170 """Only certain users can create private snap objects."""
171171
172 def __init__(self):172 def __init__(self):
173 super(SnapPrivateFeatureDisabled, self).__init__(173 super().__init__("You do not have permission to create private snaps")
174 "You do not have permission to create private snaps")
175174
176175
177@error_status(http.client.BAD_REQUEST)176@error_status(http.client.BAD_REQUEST)
@@ -179,7 +178,7 @@ class DuplicateSnapName(Exception):
179 """Raised for snap packages with duplicate name/owner."""178 """Raised for snap packages with duplicate name/owner."""
180179
181 def __init__(self):180 def __init__(self):
182 super(DuplicateSnapName, self).__init__(181 super().__init__(
183 "There is already a snap package with the same name and owner.")182 "There is already a snap package with the same name and owner.")
184183
185184
@@ -198,7 +197,7 @@ class NoSourceForSnap(Exception):
198 """Snap packages must have a source (Bazaar or Git branch)."""197 """Snap packages must have a source (Bazaar or Git branch)."""
199198
200 def __init__(self):199 def __init__(self):
201 super(NoSourceForSnap, self).__init__(200 super().__init__(
202 "New snap packages must have either a Bazaar branch or a Git "201 "New snap packages must have either a Bazaar branch or a Git "
203 "branch.")202 "branch.")
204203
@@ -213,7 +212,7 @@ class SnapPrivacyMismatch(Exception):
213 """Snap package privacy does not match its content."""212 """Snap package privacy does not match its content."""
214213
215 def __init__(self, message=None):214 def __init__(self, message=None):
216 super(SnapPrivacyMismatch, self).__init__(215 super().__init__(
217 message or216 message or
218 "Snap recipe contains private information and cannot be public.")217 "Snap recipe contains private information and cannot be public.")
219218
@@ -223,7 +222,7 @@ class SnapPrivacyPillarError(Exception):
223 """Private Snaps should be based in a pillar."""222 """Private Snaps should be based in a pillar."""
224223
225 def __init__(self, message=None):224 def __init__(self, message=None):
226 super(SnapPrivacyPillarError, self).__init__(225 super().__init__(
227 message or "Private Snap recipes should have a pillar.")226 message or "Private Snap recipes should have a pillar.")
228227
229228
@@ -240,8 +239,7 @@ class CannotModifySnapProcessor(Exception):
240 'by administrators.')239 'by administrators.')
241240
242 def __init__(self, processor):241 def __init__(self, processor):
243 super(CannotModifySnapProcessor, self).__init__(242 super().__init__(self._fmt % {'processor': processor.name})
244 self._fmt % {'processor': processor.name})
245243
246244
247@error_status(http.client.BAD_REQUEST)245@error_status(http.client.BAD_REQUEST)
@@ -264,7 +262,7 @@ class CannotRequestAutoBuilds(Exception):
264 """Snap package is not configured for automatic builds."""262 """Snap package is not configured for automatic builds."""
265263
266 def __init__(self, field):264 def __init__(self, field):
267 super(CannotRequestAutoBuilds, self).__init__(265 super().__init__(
268 "This snap package cannot have automatic builds created for it "266 "This snap package cannot have automatic builds created for it "
269 "because %s is not set." % field)267 "because %s is not set." % field)
270268
@@ -273,15 +271,14 @@ class MissingSnapcraftYaml(Exception):
273 """The repository for this snap package does not have a snapcraft.yaml."""271 """The repository for this snap package does not have a snapcraft.yaml."""
274272
275 def __init__(self, branch_name):273 def __init__(self, branch_name):
276 super(MissingSnapcraftYaml, self).__init__(274 super().__init__("Cannot find snapcraft.yaml in %s" % branch_name)
277 "Cannot find snapcraft.yaml in %s" % branch_name)
278275
279276
280class CannotFetchSnapcraftYaml(Exception):277class CannotFetchSnapcraftYaml(Exception):
281 """Launchpad cannot fetch this snap package's snapcraft.yaml."""278 """Launchpad cannot fetch this snap package's snapcraft.yaml."""
282279
283 def __init__(self, message, unsupported_remote=False):280 def __init__(self, message, unsupported_remote=False):
284 super(CannotFetchSnapcraftYaml, self).__init__(message)281 super().__init__(message)
285 self.unsupported_remote = unsupported_remote282 self.unsupported_remote = unsupported_remote
286283
287284
diff --git a/lib/lp/snappy/interfaces/snapbase.py b/lib/lp/snappy/interfaces/snapbase.py
index ace5443..d635bfb 100644
--- a/lib/lp/snappy/interfaces/snapbase.py
+++ b/lib/lp/snappy/interfaces/snapbase.py
@@ -34,7 +34,6 @@ from lazr.restful.fields import (
34 Reference,34 Reference,
35 )35 )
36from lazr.restful.interface import copy_field36from lazr.restful.interface import copy_field
37import six
38from zope.component import getUtility37from zope.component import getUtility
39from zope.interface import Interface38from zope.interface import Interface
40from zope.schema import (39from zope.schema import (
@@ -179,7 +178,7 @@ class ISnapBaseEdit(Interface):
179178
180 @operation_parameters(179 @operation_parameters(
181 component=copy_field(IArchiveDependency["component_name"]))180 component=copy_field(IArchiveDependency["component_name"]))
182 @export_operation_as(six.ensure_str("addArchiveDependency"))181 @export_operation_as("addArchiveDependency")
183 @export_factory_operation(IArchiveDependency, ["dependency", "pocket"])182 @export_factory_operation(IArchiveDependency, ["dependency", "pocket"])
184 @operation_for_version("devel")183 @operation_for_version("devel")
185 def _addArchiveDependency(dependency, pocket, component=None):184 def _addArchiveDependency(dependency, pocket, component=None):
diff --git a/lib/lp/snappy/interfaces/snapstoreclient.py b/lib/lp/snappy/interfaces/snapstoreclient.py
index 30740d2..1e00979 100644
--- a/lib/lp/snappy/interfaces/snapstoreclient.py
+++ b/lib/lp/snappy/interfaces/snapstoreclient.py
@@ -27,7 +27,7 @@ class SnapStoreError(Exception):
2727
28 def __init__(28 def __init__(
29 self, message="", detail=None, messages=None, can_retry=False):29 self, message="", detail=None, messages=None, can_retry=False):
30 super(SnapStoreError, self).__init__(message)30 super().__init__(message)
31 self.message = message31 self.message = message
32 self.detail = detail32 self.detail = detail
33 self.messages = messages33 self.messages = messages
diff --git a/lib/lp/snappy/mail/snapbuild.py b/lib/lp/snappy/mail/snapbuild.py
index 310c782..aee1685 100644
--- a/lib/lp/snappy/mail/snapbuild.py
+++ b/lib/lp/snappy/mail/snapbuild.py
@@ -89,14 +89,14 @@ class SnapBuildMailer(BaseMailer):
8989
90 def __init__(self, subject, template_name, recipients, from_address,90 def __init__(self, subject, template_name, recipients, from_address,
91 notification_type, build):91 notification_type, build):
92 super(SnapBuildMailer, self).__init__(92 super().__init__(
93 subject, template_name, recipients, from_address,93 subject, template_name, recipients, from_address,
94 notification_type=notification_type)94 notification_type=notification_type)
95 self.build = build95 self.build = build
9696
97 def _getHeaders(self, email, recipient):97 def _getHeaders(self, email, recipient):
98 """See `BaseMailer`."""98 """See `BaseMailer`."""
99 headers = super(SnapBuildMailer, self)._getHeaders(email, recipient)99 headers = super()._getHeaders(email, recipient)
100 headers["X-Launchpad-Build-State"] = self.build.status.name100 headers["X-Launchpad-Build-State"] = self.build.status.name
101 return headers101 return headers
102102
@@ -110,8 +110,7 @@ class SnapBuildMailer(BaseMailer):
110 else:110 else:
111 error_message = upload_job.error_message or ""111 error_message = upload_job.error_message or ""
112 store_url = upload_job.store_url or ""112 store_url = upload_job.store_url or ""
113 params = super(SnapBuildMailer, self)._getTemplateParams(113 params = super()._getTemplateParams(email, recipient)
114 email, recipient)
115 params.update({114 params.update({
116 "archive_tag": build.archive.reference,115 "archive_tag": build.archive.reference,
117 "build_id": build.id,116 "build_id": build.id,
diff --git a/lib/lp/snappy/model/snap.py b/lib/lp/snappy/model/snap.py
index 6798eb2..f6251d9 100644
--- a/lib/lp/snappy/model/snap.py
+++ b/lib/lp/snappy/model/snap.py
@@ -426,7 +426,7 @@ class Snap(Storm, WebhookTargetMixin):
426 store_upload=False, store_series=None, store_name=None,426 store_upload=False, store_series=None, store_name=None,
427 store_secrets=None, store_channels=None, project=None):427 store_secrets=None, store_channels=None, project=None):
428 """Construct a `Snap`."""428 """Construct a `Snap`."""
429 super(Snap, self).__init__()429 super().__init__()
430430
431 # Set the information type first so that other validators can perform431 # Set the information type first so that other validators can perform
432 # suitable privacy checks, but pillar should also be set, since it's432 # suitable privacy checks, but pillar should also be set, since it's
diff --git a/lib/lp/snappy/model/snapbase.py b/lib/lp/snappy/model/snapbase.py
index 1ad5c25..7577c81 100644
--- a/lib/lp/snappy/model/snapbase.py
+++ b/lib/lp/snappy/model/snapbase.py
@@ -8,7 +8,6 @@ __all__ = [
8 ]8 ]
99
10import pytz10import pytz
11import six
12from storm.locals import (11from storm.locals import (
13 Bool,12 Bool,
14 DateTime,13 DateTime,
@@ -74,7 +73,7 @@ class SnapBase(Storm):
7473
75 def __init__(self, registrant, name, display_name, distro_series,74 def __init__(self, registrant, name, display_name, distro_series,
76 build_channels, date_created=DEFAULT):75 build_channels, date_created=DEFAULT):
77 super(SnapBase, self).__init__()76 super().__init__()
78 self.registrant = registrant77 self.registrant = registrant
79 self.name = name78 self.name = name
80 self.display_name = display_name79 self.display_name = display_name
@@ -145,7 +144,7 @@ class SnapBase(Storm):
145144
146 def _addArchiveDependency(self, dependency, pocket, component=None):145 def _addArchiveDependency(self, dependency, pocket, component=None):
147 """See `ISnapBase`."""146 """See `ISnapBase`."""
148 if isinstance(component, six.text_type):147 if isinstance(component, str):
149 try:148 try:
150 component = getUtility(IComponentSet)[component]149 component = getUtility(IComponentSet)[component]
151 except NotFoundError as e:150 except NotFoundError as e:
diff --git a/lib/lp/snappy/model/snapbuild.py b/lib/lp/snappy/model/snapbuild.py
index 31955e9..a4405de 100644
--- a/lib/lp/snappy/model/snapbuild.py
+++ b/lib/lp/snappy/model/snapbuild.py
@@ -123,7 +123,7 @@ class SnapFile(Storm):
123123
124 def __init__(self, snapbuild, libraryfile):124 def __init__(self, snapbuild, libraryfile):
125 """Construct a `SnapFile`."""125 """Construct a `SnapFile`."""
126 super(SnapFile, self).__init__()126 super().__init__()
127 self.snapbuild = snapbuild127 self.snapbuild = snapbuild
128 self.libraryfile = libraryfile128 self.libraryfile = libraryfile
129129
@@ -199,7 +199,7 @@ class SnapBuild(PackageBuildMixin, Storm):
199 processor, virtualized, date_created,199 processor, virtualized, date_created,
200 store_upload_metadata=None, build_request=None):200 store_upload_metadata=None, build_request=None):
201 """Construct a `SnapBuild`."""201 """Construct a `SnapBuild`."""
202 super(SnapBuild, self).__init__()202 super().__init__()
203 self.build_farm_job = build_farm_job203 self.build_farm_job = build_farm_job
204 self.requester = requester204 self.requester = requester
205 self.snap = snap205 self.snap = snap
@@ -416,7 +416,7 @@ class SnapBuild(PackageBuildMixin, Storm):
416 force_invalid_transition=False):416 force_invalid_transition=False):
417 """See `IBuildFarmJob`."""417 """See `IBuildFarmJob`."""
418 old_status = self.status418 old_status = self.status
419 super(SnapBuild, self).updateStatus(419 super().updateStatus(
420 status, builder=builder, slave_status=slave_status,420 status, builder=builder, slave_status=slave_status,
421 date_started=date_started, date_finished=date_finished,421 date_started=date_started, date_finished=date_finished,
422 force_invalid_transition=force_invalid_transition)422 force_invalid_transition=force_invalid_transition)
diff --git a/lib/lp/snappy/model/snapbuildbehaviour.py b/lib/lp/snappy/model/snapbuildbehaviour.py
index cfbf645..a136e58 100644
--- a/lib/lp/snappy/model/snapbuildbehaviour.py
+++ b/lib/lp/snappy/model/snapbuildbehaviour.py
@@ -106,8 +106,7 @@ class SnapBuildBehaviour(BuilderProxyMixin, BuildFarmJobBehaviourBase):
106 Return the extra arguments required by the slave for the given build.106 Return the extra arguments required by the slave for the given build.
107 """107 """
108 build = self.build108 build = self.build
109 args = yield super(SnapBuildBehaviour, self).extraBuildArgs(109 args = yield super().extraBuildArgs(logger=logger)
110 logger=logger)
111 yield self.addProxyArgs(args, build.snap.allow_internet)110 yield self.addProxyArgs(args, build.snap.allow_internet)
112 args["name"] = build.snap.store_name or build.snap.name111 args["name"] = build.snap.store_name or build.snap.name
113 channels = build.channels or {}112 channels = build.channels or {}
diff --git a/lib/lp/snappy/model/snapbuildjob.py b/lib/lp/snappy/model/snapbuildjob.py
index 55d219b..7888c90 100644
--- a/lib/lp/snappy/model/snapbuildjob.py
+++ b/lib/lp/snappy/model/snapbuildjob.py
@@ -101,7 +101,7 @@ class SnapBuildJob(StormBase):
101 :param metadata: The type-specific variables, as a JSON-compatible101 :param metadata: The type-specific variables, as a JSON-compatible
102 dict.102 dict.
103 """103 """
104 super(SnapBuildJob, self).__init__()104 super().__init__()
105 self.job = Job(**job_args)105 self.job = Job(**job_args)
106 self.snapbuild = snapbuild106 self.snapbuild = snapbuild
107 self.job_type = job_type107 self.job_type = job_type
@@ -152,7 +152,7 @@ class SnapBuildJobDerived(BaseRunnableJob, metaclass=EnumeratedSubclass):
152152
153 def getOopsVars(self):153 def getOopsVars(self):
154 """See `IRunnableJob`."""154 """See `IRunnableJob`."""
155 oops_vars = super(SnapBuildJobDerived, self).getOopsVars()155 oops_vars = super().getOopsVars()
156 oops_vars.extend([156 oops_vars.extend([
157 ('job_id', self.context.job.id),157 ('job_id', self.context.job.id),
158 ('job_type', self.context.job_type.title),158 ('job_type', self.context.job_type.title),
@@ -291,7 +291,7 @@ class SnapStoreUploadJob(SnapBuildJobDerived):
291 def _do_lifecycle(self, method_name, manage_transaction=False,291 def _do_lifecycle(self, method_name, manage_transaction=False,
292 *args, **kwargs):292 *args, **kwargs):
293 old_store_upload_status = self.snapbuild.store_upload_status293 old_store_upload_status = self.snapbuild.store_upload_status
294 getattr(super(SnapStoreUploadJob, self), method_name)(294 getattr(super(), method_name)(
295 *args, manage_transaction=manage_transaction, **kwargs)295 *args, manage_transaction=manage_transaction, **kwargs)
296 if self.snapbuild.store_upload_status != old_store_upload_status:296 if self.snapbuild.store_upload_status != old_store_upload_status:
297 notify(SnapBuildStoreUploadStatusChangedEvent(self.snapbuild))297 notify(SnapBuildStoreUploadStatusChangedEvent(self.snapbuild))
@@ -318,7 +318,7 @@ class SnapStoreUploadJob(SnapBuildJobDerived):
318318
319 def getOopsVars(self):319 def getOopsVars(self):
320 """See `IRunnableJob`."""320 """See `IRunnableJob`."""
321 oops_vars = super(SnapStoreUploadJob, self).getOopsVars()321 oops_vars = super().getOopsVars()
322 oops_vars.append(('error_detail', self.error_detail))322 oops_vars.append(('error_detail', self.error_detail))
323 return oops_vars323 return oops_vars
324324
diff --git a/lib/lp/snappy/model/snapjob.py b/lib/lp/snappy/model/snapjob.py
index bf16b2d..c84f823 100644
--- a/lib/lp/snappy/model/snapjob.py
+++ b/lib/lp/snappy/model/snapjob.py
@@ -106,7 +106,7 @@ class SnapJob(StormBase):
106 :param metadata: The type-specific variables, as a JSON-compatible106 :param metadata: The type-specific variables, as a JSON-compatible
107 dict.107 dict.
108 """108 """
109 super(SnapJob, self).__init__()109 super().__init__()
110 self.job = Job(**job_args)110 self.job = Job(**job_args)
111 self.snap = snap111 self.snap = snap
112 self.job_type = job_type112 self.job_type = job_type
@@ -155,7 +155,7 @@ class SnapJobDerived(BaseRunnableJob, metaclass=EnumeratedSubclass):
155155
156 def getOopsVars(self):156 def getOopsVars(self):
157 """See `IRunnableJob`."""157 """See `IRunnableJob`."""
158 oops_vars = super(SnapJobDerived, self).getOopsVars()158 oops_vars = super().getOopsVars()
159 oops_vars.extend([159 oops_vars.extend([
160 ("job_id", self.context.job.id),160 ("job_id", self.context.job.id),
161 ("job_type", self.context.job_type.title),161 ("job_type", self.context.job_type.title),
diff --git a/lib/lp/snappy/model/snappyseries.py b/lib/lp/snappy/model/snappyseries.py
index 52de880..50cef2a 100644
--- a/lib/lp/snappy/model/snappyseries.py
+++ b/lib/lp/snappy/model/snappyseries.py
@@ -65,7 +65,7 @@ class SnappySeries(Storm):
6565
66 def __init__(self, registrant, name, display_name, status,66 def __init__(self, registrant, name, display_name, status,
67 preferred_distro_series=None, date_created=DEFAULT):67 preferred_distro_series=None, date_created=DEFAULT):
68 super(SnappySeries, self).__init__()68 super().__init__()
69 self.registrant = registrant69 self.registrant = registrant
70 self.name = name70 self.name = name
71 self.display_name = display_name71 self.display_name = display_name
@@ -207,7 +207,7 @@ class SnappyDistroSeries(Storm, SnappyDistroSeriesMixin):
207 preferred = Bool(name='preferred', allow_none=False)207 preferred = Bool(name='preferred', allow_none=False)
208208
209 def __init__(self, snappy_series, distro_series, preferred=False):209 def __init__(self, snappy_series, distro_series, preferred=False):
210 super(SnappyDistroSeries, self).__init__()210 super().__init__()
211 self.snappy_series = snappy_series211 self.snappy_series = snappy_series
212 self.distro_series = distro_series212 self.distro_series = distro_series
213 self.preferred = preferred213 self.preferred = preferred
diff --git a/lib/lp/snappy/model/snapstoreclient.py b/lib/lp/snappy/model/snapstoreclient.py
index a288a35..e5900fc 100644
--- a/lib/lp/snappy/model/snapstoreclient.py
+++ b/lib/lp/snappy/model/snapstoreclient.py
@@ -398,7 +398,7 @@ class SnapStoreClient:
398 channels = memcache_client.get_json(memcache_key, log, description)398 channels = memcache_client.get_json(memcache_key, log, description)
399399
400 if (channels is None and400 if (channels is None and
401 not getFeatureFlag(u"snap.disable_channel_search")):401 not getFeatureFlag("snap.disable_channel_search")):
402 path = "api/v1/channels"402 path = "api/v1/channels"
403 timeline = cls._getTimeline()403 timeline = cls._getTimeline()
404 if timeline is not None:404 if timeline is not None:
diff --git a/lib/lp/snappy/model/snapsubscription.py b/lib/lp/snappy/model/snapsubscription.py
index fd36b12..4384cd5 100644
--- a/lib/lp/snappy/model/snapsubscription.py
+++ b/lib/lp/snappy/model/snapsubscription.py
@@ -44,7 +44,7 @@ class SnapSubscription(StormBase):
44 subscribed_by = Reference(subscribed_by_id, "Person.id")44 subscribed_by = Reference(subscribed_by_id, "Person.id")
4545
46 def __init__(self, snap, person, subscribed_by):46 def __init__(self, snap, person, subscribed_by):
47 super(SnapSubscription, self).__init__()47 super().__init__()
48 self.snap = snap48 self.snap = snap
49 self.person = person49 self.person = person
50 self.subscribed_by = subscribed_by50 self.subscribed_by = subscribed_by
diff --git a/lib/lp/snappy/tests/test_snap.py b/lib/lp/snappy/tests/test_snap.py
index 08ce35b..178c4fc 100644
--- a/lib/lp/snappy/tests/test_snap.py
+++ b/lib/lp/snappy/tests/test_snap.py
@@ -186,7 +186,7 @@ class TestSnap(TestCaseWithFactory):
186 layer = DatabaseFunctionalLayer186 layer = DatabaseFunctionalLayer
187187
188 def setUp(self):188 def setUp(self):
189 super(TestSnap, self).setUp()189 super().setUp()
190 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))190 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
191191
192 def test_implements_interfaces(self):192 def test_implements_interfaces(self):
@@ -1391,7 +1391,7 @@ class TestSnapDeleteWithBuilds(TestCaseWithFactory):
1391 layer = LaunchpadFunctionalLayer1391 layer = LaunchpadFunctionalLayer
13921392
1393 def setUp(self):1393 def setUp(self):
1394 super(TestSnapDeleteWithBuilds, self).setUp()1394 super().setUp()
1395 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))1395 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
13961396
1397 def test_delete_with_builds(self):1397 def test_delete_with_builds(self):
@@ -1507,7 +1507,7 @@ class TestSnapVisibility(TestCaseWithFactory):
1507 layer = DatabaseFunctionalLayer1507 layer = DatabaseFunctionalLayer
15081508
1509 def setUp(self):1509 def setUp(self):
1510 super(TestSnapVisibility, self).setUp()1510 super().setUp()
1511 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))1511 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
15121512
1513 def getSnapGrants(self, snap, person=None):1513 def getSnapGrants(self, snap, person=None):
@@ -1654,7 +1654,7 @@ class TestSnapSet(TestCaseWithFactory):
1654 layer = DatabaseFunctionalLayer1654 layer = DatabaseFunctionalLayer
16551655
1656 def setUp(self):1656 def setUp(self):
1657 super(TestSnapSet, self).setUp()1657 super().setUp()
1658 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))1658 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
16591659
1660 def test_class_implements_interfaces(self):1660 def test_class_implements_interfaces(self):
@@ -1891,7 +1891,7 @@ class TestSnapSet(TestCaseWithFactory):
1891 self.assertContentEqual(snaps[3:], snap_set.findByPerson(owners[1]))1891 self.assertContentEqual(snaps[3:], snap_set.findByPerson(owners[1]))
18921892
1893 def test_get_snap_privacy_filter_includes_grants(self):1893 def test_get_snap_privacy_filter_includes_grants(self):
1894 grantee, creator = [self.factory.makePerson() for i in range(2)]1894 grantee, creator = (self.factory.makePerson() for i in range(2))
1895 # All snaps are owned by "creator", and "grantee" will later have1895 # All snaps are owned by "creator", and "grantee" will later have
1896 # access granted using sharing service.1896 # access granted using sharing service.
1897 snap_data = dict(registrant=creator, owner=creator, private=True)1897 snap_data = dict(registrant=creator, owner=creator, private=True)
@@ -2763,7 +2763,7 @@ class TestSnapProcessors(TestCaseWithFactory):
2763 layer = LaunchpadFunctionalLayer2763 layer = LaunchpadFunctionalLayer
27642764
2765 def setUp(self):2765 def setUp(self):
2766 super(TestSnapProcessors, self).setUp(user="foo.bar@canonical.com")2766 super().setUp(user="foo.bar@canonical.com")
2767 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))2767 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
2768 self.default_procs = [2768 self.default_procs = [
2769 getUtility(IProcessorSet).getByName("386"),2769 getUtility(IProcessorSet).getByName("386"),
@@ -2880,7 +2880,7 @@ class TestSnapWebservice(TestCaseWithFactory):
2880 layer = LaunchpadFunctionalLayer2880 layer = LaunchpadFunctionalLayer
28812881
2882 def setUp(self):2882 def setUp(self):
2883 super(TestSnapWebservice, self).setUp()2883 super().setUp()
2884 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))2884 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
2885 self.snap_store_client = FakeMethod()2885 self.snap_store_client = FakeMethod()
2886 self.snap_store_client.listChannels = FakeMethod(result=[2886 self.snap_store_client.listChannels = FakeMethod(result=[
diff --git a/lib/lp/snappy/tests/test_snapbase.py b/lib/lp/snappy/tests/test_snapbase.py
index 88bf5ff..a5de6f2 100644
--- a/lib/lp/snappy/tests/test_snapbase.py
+++ b/lib/lp/snappy/tests/test_snapbase.py
@@ -80,7 +80,7 @@ class TestSnapBaseProcessors(TestCaseWithFactory):
80 layer = ZopelessDatabaseLayer80 layer = ZopelessDatabaseLayer
8181
82 def setUp(self):82 def setUp(self):
83 super(TestSnapBaseProcessors, self).setUp(user="foo.bar@canonical.com")83 super().setUp(user="foo.bar@canonical.com")
84 self.unrestricted_procs = [84 self.unrestricted_procs = [
85 self.factory.makeProcessor() for _ in range(3)]85 self.factory.makeProcessor() for _ in range(3)]
86 self.restricted_procs = [86 self.restricted_procs = [
diff --git a/lib/lp/snappy/tests/test_snapbuild.py b/lib/lp/snappy/tests/test_snapbuild.py
index 9ed98cb..639893f 100644
--- a/lib/lp/snappy/tests/test_snapbuild.py
+++ b/lib/lp/snappy/tests/test_snapbuild.py
@@ -100,7 +100,7 @@ class TestSnapBuild(TestCaseWithFactory):
100 layer = LaunchpadZopelessLayer100 layer = LaunchpadZopelessLayer
101101
102 def setUp(self):102 def setUp(self):
103 super(TestSnapBuild, self).setUp()103 super().setUp()
104 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))104 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
105 self.pushConfig(105 self.pushConfig(
106 "snappy", store_url="http://sca.example/",106 "snappy", store_url="http://sca.example/",
@@ -700,7 +700,7 @@ class TestSnapBuildSet(TestCaseWithFactory):
700 layer = LaunchpadZopelessLayer700 layer = LaunchpadZopelessLayer
701701
702 def setUp(self):702 def setUp(self):
703 super(TestSnapBuildSet, self).setUp()703 super().setUp()
704 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))704 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
705705
706 def test_getByBuildFarmJob_works(self):706 def test_getByBuildFarmJob_works(self):
@@ -731,7 +731,7 @@ class TestSnapBuildWebservice(TestCaseWithFactory):
731 layer = LaunchpadFunctionalLayer731 layer = LaunchpadFunctionalLayer
732732
733 def setUp(self):733 def setUp(self):
734 super(TestSnapBuildWebservice, self).setUp()734 super().setUp()
735 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))735 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
736 self.person = self.factory.makePerson()736 self.person = self.factory.makePerson()
737 self.webservice = webservice_for_person(737 self.webservice = webservice_for_person(
@@ -897,7 +897,7 @@ class TestSnapBuildMacaroonIssuer(MacaroonTestMixin, TestCaseWithFactory):
897 layer = LaunchpadZopelessLayer897 layer = LaunchpadZopelessLayer
898898
899 def setUp(self):899 def setUp(self):
900 super(TestSnapBuildMacaroonIssuer, self).setUp()900 super().setUp()
901 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))901 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
902 self.pushConfig(902 self.pushConfig(
903 "launchpad", internal_macaroon_secret_key="some-secret")903 "launchpad", internal_macaroon_secret_key="some-secret")
diff --git a/lib/lp/snappy/tests/test_snapbuildbehaviour.py b/lib/lp/snappy/tests/test_snapbuildbehaviour.py
index dbd91e7..fc2d5a8 100644
--- a/lib/lp/snappy/tests/test_snapbuildbehaviour.py
+++ b/lib/lp/snappy/tests/test_snapbuildbehaviour.py
@@ -125,7 +125,7 @@ class TestSnapBuildBehaviourBase(TestCaseWithFactory):
125 layer = LaunchpadZopelessLayer125 layer = LaunchpadZopelessLayer
126126
127 def setUp(self):127 def setUp(self):
128 super(TestSnapBuildBehaviourBase, self).setUp()128 super().setUp()
129 self.pushConfig("snappy", tools_source=None, tools_fingerprint=None)129 self.pushConfig("snappy", tools_source=None, tools_fingerprint=None)
130130
131 def makeJob(self, archive=None, pocket=PackagePublishingPocket.UPDATES,131 def makeJob(self, archive=None, pocket=PackagePublishingPocket.UPDATES,
@@ -251,7 +251,7 @@ class TestAsyncSnapBuildBehaviour(StatsMixin, TestSnapBuildBehaviourBase):
251251
252 @defer.inlineCallbacks252 @defer.inlineCallbacks
253 def setUp(self):253 def setUp(self):
254 super(TestAsyncSnapBuildBehaviour, self).setUp()254 super().setUp()
255 build_username = 'SNAPBUILD-1'255 build_username = 'SNAPBUILD-1'
256 self.token = {'secret': uuid.uuid4().hex,256 self.token = {'secret': uuid.uuid4().hex,
257 'username': build_username,257 'username': build_username,
@@ -273,7 +273,7 @@ class TestAsyncSnapBuildBehaviour(StatsMixin, TestSnapBuildBehaviourBase):
273 def makeJob(self, **kwargs):273 def makeJob(self, **kwargs):
274 # We need a builder slave in these tests, in order that requesting a274 # We need a builder slave in these tests, in order that requesting a
275 # proxy token can piggyback on its reactor and pool.275 # proxy token can piggyback on its reactor and pool.
276 job = super(TestAsyncSnapBuildBehaviour, self).makeJob(**kwargs)276 job = super().makeJob(**kwargs)
277 builder = MockBuilder()277 builder = MockBuilder()
278 builder.processor = job.build.processor278 builder.processor = job.build.processor
279 slave = self.useFixture(SlaveTestHelpers()).getClientSlave()279 slave = self.useFixture(SlaveTestHelpers()).getClientSlave()
diff --git a/lib/lp/snappy/tests/test_snapbuildjob.py b/lib/lp/snappy/tests/test_snapbuildjob.py
index 1918da5..e0c485e 100644
--- a/lib/lp/snappy/tests/test_snapbuildjob.py
+++ b/lib/lp/snappy/tests/test_snapbuildjob.py
@@ -95,7 +95,7 @@ class TestSnapBuildJob(TestCaseWithFactory):
95 layer = DatabaseFunctionalLayer95 layer = DatabaseFunctionalLayer
9696
97 def setUp(self):97 def setUp(self):
98 super(TestSnapBuildJob, self).setUp()98 super().setUp()
99 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))99 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
100100
101 def test_provides_interface(self):101 def test_provides_interface(self):
@@ -111,7 +111,7 @@ class TestSnapStoreUploadJob(TestCaseWithFactory):
111 layer = LaunchpadZopelessLayer111 layer = LaunchpadZopelessLayer
112112
113 def setUp(self):113 def setUp(self):
114 super(TestSnapStoreUploadJob, self).setUp()114 super().setUp()
115 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))115 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
116 self.status_url = "http://sca.example/dev/api/snaps/1/builds/1/status"116 self.status_url = "http://sca.example/dev/api/snaps/1/builds/1/status"
117 self.store_url = "http://sca.example/dev/click-apps/1/rev/1/"117 self.store_url = "http://sca.example/dev/click-apps/1/rev/1/"
diff --git a/lib/lp/snappy/tests/test_snappyseries.py b/lib/lp/snappy/tests/test_snappyseries.py
index cfdf194..7d4e64c 100644
--- a/lib/lp/snappy/tests/test_snappyseries.py
+++ b/lib/lp/snappy/tests/test_snappyseries.py
@@ -43,7 +43,7 @@ class TestSnappySeries(TestCaseWithFactory):
43 layer = ZopelessDatabaseLayer43 layer = ZopelessDatabaseLayer
4444
45 def setUp(self):45 def setUp(self):
46 super(TestSnappySeries, self).setUp()46 super().setUp()
47 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))47 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
4848
49 def test_implements_interface(self):49 def test_implements_interface(self):
@@ -108,7 +108,7 @@ class TestSnappySeriesSet(TestCaseWithFactory):
108 layer = ZopelessDatabaseLayer108 layer = ZopelessDatabaseLayer
109109
110 def setUp(self):110 def setUp(self):
111 super(TestSnappySeriesSet, self).setUp()111 super().setUp()
112 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))112 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
113113
114 def test_getByName(self):114 def test_getByName(self):
@@ -132,7 +132,7 @@ class TestSnappySeriesWebservice(TestCaseWithFactory):
132 layer = DatabaseFunctionalLayer132 layer = DatabaseFunctionalLayer
133133
134 def setUp(self):134 def setUp(self):
135 super(TestSnappySeriesWebservice, self).setUp()135 super().setUp()
136 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))136 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
137137
138 def test_new_unpriv(self):138 def test_new_unpriv(self):
@@ -234,7 +234,7 @@ class TestSnappyDistroSeriesSet(TestCaseWithFactory):
234 layer = ZopelessDatabaseLayer234 layer = ZopelessDatabaseLayer
235235
236 def setUp(self):236 def setUp(self):
237 super(TestSnappyDistroSeriesSet, self).setUp()237 super().setUp()
238 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))238 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
239239
240 def test_getByBothSeries(self):240 def test_getByBothSeries(self):
diff --git a/lib/lp/snappy/tests/test_snapstoreclient.py b/lib/lp/snappy/tests/test_snapstoreclient.py
index 66e446b..b4bd3ea 100644
--- a/lib/lp/snappy/tests/test_snapstoreclient.py
+++ b/lib/lp/snappy/tests/test_snapstoreclient.py
@@ -213,7 +213,7 @@ class TestSnapStoreClient(TestCaseWithFactory):
213 layer = LaunchpadZopelessLayer213 layer = LaunchpadZopelessLayer
214214
215 def setUp(self):215 def setUp(self):
216 super(TestSnapStoreClient, self).setUp()216 super().setUp()
217 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))217 self.useFixture(FeatureFixture(SNAP_TESTING_FLAGS))
218 self.pushConfig(218 self.pushConfig(
219 "snappy", store_url="http://sca.example/",219 "snappy", store_url="http://sca.example/",
@@ -769,7 +769,7 @@ class TestSnapStoreClient(TestCaseWithFactory):
769 @responses.activate769 @responses.activate
770 def test_listChannels_disable_search(self):770 def test_listChannels_disable_search(self):
771 self.useFixture(771 self.useFixture(
772 FeatureFixture({u"snap.disable_channel_search": u"on"}))772 FeatureFixture({"snap.disable_channel_search": "on"}))
773 expected_channels = [773 expected_channels = [
774 {"name": "candidate", "display_name": "Candidate"},774 {"name": "candidate", "display_name": "Candidate"},
775 {"name": "edge", "display_name": "Edge"},775 {"name": "edge", "display_name": "Edge"},
diff --git a/lib/lp/snappy/tests/test_snapvocabularies.py b/lib/lp/snappy/tests/test_snapvocabularies.py
index bac4756..942b5c6 100644
--- a/lib/lp/snappy/tests/test_snapvocabularies.py
+++ b/lib/lp/snappy/tests/test_snapvocabularies.py
@@ -15,7 +15,7 @@ class TestSnappyDistroSeriesVocabulary(TestCaseWithFactory):
15 layer = ZopelessDatabaseLayer15 layer = ZopelessDatabaseLayer
1616
17 def setUp(self):17 def setUp(self):
18 super(TestSnappyDistroSeriesVocabulary, self).setUp()18 super().setUp()
19 self.vocab = SnappyDistroSeriesVocabulary()19 self.vocab = SnappyDistroSeriesVocabulary()
2020
21 def test_getTermByToken(self):21 def test_getTermByToken(self):
diff --git a/lib/lp/snappy/validators/tests/test_channels.py b/lib/lp/snappy/validators/tests/test_channels.py
index e2da963..02b19ad 100644
--- a/lib/lp/snappy/validators/tests/test_channels.py
+++ b/lib/lp/snappy/validators/tests/test_channels.py
@@ -18,7 +18,7 @@ class TestChannelsValidator(TestCaseWithFactory):
18 layer = LaunchpadFunctionalLayer18 layer = LaunchpadFunctionalLayer
1919
20 def setUp(self):20 def setUp(self):
21 super(TestChannelsValidator, self).setUp()21 super().setUp()
22 self.risks = [22 self.risks = [
23 {"name": "stable", "display_name": "Stable"},23 {"name": "stable", "display_name": "Stable"},
24 {"name": "candidate", "display_name": "Candidate"},24 {"name": "candidate", "display_name": "Candidate"},
diff --git a/lib/lp/snappy/vocabularies.py b/lib/lp/snappy/vocabularies.py
index 6fa31a9..8a22a9c 100644
--- a/lib/lp/snappy/vocabularies.py
+++ b/lib/lp/snappy/vocabularies.py
@@ -238,7 +238,7 @@ class SnapStoreChannelVocabulary(SimpleVocabulary):
238 for name in context_channels:238 for name in context_channels:
239 if name not in known_names:239 if name not in known_names:
240 terms.append(self.createTerm(name, name, name))240 terms.append(self.createTerm(name, name, name))
241 super(SnapStoreChannelVocabulary, self).__init__(terms)241 super().__init__(terms)
242242
243 @classmethod243 @classmethod
244 def createTerm(cls, *args):244 def createTerm(cls, *args):

Subscribers

People subscribed via source and target branches

to status/vote changes: