← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:strict-iro into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:strict-iro into launchpad:master.

Commit message:
Run with ZOPE_INTERFACE_STRICT_IRO=1

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/429741

Fix the last set of issues with `ZOPE_INTERFACE_STRICT_IRO=1`, and switch it on.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:strict-iro into launchpad:master.
diff --git a/lib/lp/bugs/browser/bugbranch.py b/lib/lp/bugs/browser/bugbranch.py
index 458e1e8..1dc0cd1 100644
--- a/lib/lp/bugs/browser/bugbranch.py
+++ b/lib/lp/bugs/browser/bugbranch.py
@@ -14,7 +14,6 @@ from typing import List
 
 from lazr.restful.interfaces import IWebServiceClientRequest
 from zope.component import adapter, getMultiAdapter
-from zope.interface import Interface, implementer
 
 from lp import _
 from lp.app.browser.launchpadform import (
@@ -141,7 +140,6 @@ class BranchLinkToBugView(LaunchpadFormView):
 
 
 @adapter(IBugBranch, IWebServiceClientRequest)
-@implementer(Interface)
 class BugBranchXHTMLRepresentation:
     def __init__(self, branch, request):
         self.branch = branch
diff --git a/lib/lp/bugs/browser/bugcomment.py b/lib/lp/bugs/browser/bugcomment.py
index b8650ca..6a32ff1 100644
--- a/lib/lp/bugs/browser/bugcomment.py
+++ b/lib/lp/bugs/browser/bugcomment.py
@@ -21,7 +21,7 @@ from operator import itemgetter
 from lazr.delegates import delegate_to
 from lazr.restful.interfaces import IWebServiceClientRequest
 from zope.component import adapter, getMultiAdapter, getUtility
-from zope.interface import Interface, implementer
+from zope.interface import implementer
 from zope.security.proxy import removeSecurityProxy
 
 from lp.bugs.interfaces.bugattachment import BugAttachmentType
@@ -406,7 +406,6 @@ class BugCommentBoxExpandedReplyView(LaunchpadView, BugCommentBoxViewMixin):
 
 
 @adapter(IBugComment, IWebServiceClientRequest)
-@implementer(Interface)
 class BugCommentXHTMLRepresentation:
     def __init__(self, comment, request):
         self.comment = comment
diff --git a/lib/lp/bugs/browser/configure.zcml b/lib/lp/bugs/browser/configure.zcml
index ff9e1e4..de5d592 100644
--- a/lib/lp/bugs/browser/configure.zcml
+++ b/lib/lp/bugs/browser/configure.zcml
@@ -194,6 +194,7 @@
             permission="launchpad.View"/>
     <adapter
          factory="lp.bugs.browser.bugcomment.BugCommentXHTMLRepresentation"
+         provides="zope.interface.Interface"
          name="lazr.restful.EntryResource"
         />
     <adapter
@@ -810,6 +811,7 @@
         template="../templates/bug-branch.pt"/>
     <adapter
          factory="lp.bugs.browser.bugbranch.BugBranchXHTMLRepresentation"
+         provides="zope.interface.Interface"
          name="lazr.restful.EntryResource"
         />
         <browser:menus
diff --git a/lib/lp/code/browser/branchmergeproposal.py b/lib/lp/code/browser/branchmergeproposal.py
index c93790c..a2fe57e 100644
--- a/lib/lp/code/browser/branchmergeproposal.py
+++ b/lib/lp/code/browser/branchmergeproposal.py
@@ -1590,7 +1590,6 @@ class FormatPreviewDiffView(LaunchpadView, DiffRenderingMixin):
 
 
 @adapter(IPreviewDiff, IWebServiceClientRequest)
-@implementer(Interface)
 class PreviewDiffHTMLRepresentation:
     def __init__(self, diff, request):
         self.diff = diff
diff --git a/lib/lp/code/browser/configure.zcml b/lib/lp/code/browser/configure.zcml
index 3f16bf4..d0e3d9a 100644
--- a/lib/lp/code/browser/configure.zcml
+++ b/lib/lp/code/browser/configure.zcml
@@ -1263,6 +1263,7 @@
 
     <adapter
          factory="lp.code.browser.branchmergeproposal.PreviewDiffHTMLRepresentation"
+         provides="zope.interface.Interface"
          name="lazr.restful.EntryResource"/>
 
     <adapter
diff --git a/lib/lp/registry/browser/configure.zcml b/lib/lp/registry/browser/configure.zcml
index cd1bee9..6f041d4 100644
--- a/lib/lp/registry/browser/configure.zcml
+++ b/lib/lp/registry/browser/configure.zcml
@@ -247,6 +247,7 @@
     <adapter
         name="lazr.restful.EntryResource"
         factory="lp.registry.browser.distroseriesdifference.CommentXHTMLRepresentation"
+        provides="zope.interface.Interface"
         />
     <browser:menus
         module="lp.registry.browser.distroseries"
@@ -980,6 +981,7 @@
     <adapter
         name="lazr.restful.EntryResource"
         factory="lp.registry.browser.person.PersonXHTMLRepresentation"
+        provides="zope.interface.Interface"
         />
     <browser:page
         name="+review"
diff --git a/lib/lp/registry/browser/distroseriesdifference.py b/lib/lp/registry/browser/distroseriesdifference.py
index a64469b..0243d64 100644
--- a/lib/lp/registry/browser/distroseriesdifference.py
+++ b/lib/lp/registry/browser/distroseriesdifference.py
@@ -270,7 +270,6 @@ def get_message(comment):
 
 
 @adapter(IDistroSeriesDifferenceComment, IWebServiceClientRequest)
-@implementer(Interface)
 class CommentXHTMLRepresentation(LaunchpadView):
     """Render individual comments when requested via the API."""
 
diff --git a/lib/lp/registry/browser/person.py b/lib/lp/registry/browser/person.py
index 5faea5e..be5908b 100644
--- a/lib/lp/registry/browser/person.py
+++ b/lib/lp/registry/browser/person.py
@@ -4820,7 +4820,6 @@ classImplements(PersonIndexView, IPersonIndexMenu)
 
 
 @adapter(IPerson, IWebServiceClientRequest)
-@implementer(Interface)
 class PersonXHTMLRepresentation:
     def __init__(self, person, request):
         self.person = person
diff --git a/lib/lp_sitecustomize.py b/lib/lp_sitecustomize.py
index 3fe64df..eb2482a 100644
--- a/lib/lp_sitecustomize.py
+++ b/lib/lp_sitecustomize.py
@@ -181,6 +181,7 @@ def main(instance_name=None):
         # See bug 656213 for why we do this carefully.
         os.environ.setdefault("LPCONFIG", instance_name)
     os.environ["STORM_CEXTENSIONS"] = "1"
+    os.environ["ZOPE_INTERFACE_STRICT_IRO"] = "1"
     add_custom_loglevels()
     customizeMimetypes()
     silence_warnings()