Opened 16 years ago

Closed 16 years ago

#1636 enhancement closed fixed (fixed)

Completely replace t.p.c.Interface with z.i.Interface

Reported by: Ralph Meijer Owned by:
Priority: highest Milestone: Core-2.5
Component: core Keywords:
Cc: therve, Ralph Meijer, Glyph Branch:
Author:

Description (last modified by Glyph)

twisted.python.components.Interface contains this snippet:

# Don't warn for use within twisted, because twisted classes must
# not be switched to z.i.Interface yet, b/c we forgot to deprecate
# the "default" kwarg to __call__. Also when t.p.c.Interface is
# removed, the rest of twisted can be updated simultaneously. But
# everyone else should just use z.i.Interface directly now.

The deprecation will take place in Twisted 2.3, so after that we can completely switch to zope.interface.Interface.

One such deprecation is described in #1748

Attachments (1)

interface_1636.diff (113.8 KB) - added by therve 16 years ago.
Replace components.Interface with zope.interface.Interface

Download all attachments as: .zip

Change History (23)

comment:1 Changed 16 years ago by radix

Milestone: Twisted-2.4Twisted-2.5

Sorry, 2.4 is coming out sooner than expected. Moving this to 2.5.

comment:2 Changed 16 years ago by Glyph

Description: modified (diff)

comment:3 Changed 16 years ago by Glyph

Priority: normalhigh

man, this is a pain in the ass. I've got a branch open now, killtpc-1636. I figure I will do more on it if I get bored.

comment:4 Changed 16 years ago by Glyph

Status: newassigned

Changed 16 years ago by therve

Attachment: interface_1636.diff added

Replace components.Interface with zope.interface.Interface

comment:5 Changed 16 years ago by therve

Attached a patch finishing your work. Not very interesting but done :). Tests pass.

Note: I found a strange call in twisted/mail/mail.py:251 in function addDomain: 'components.implements'. Don't know what to do with this.

comment:6 Changed 16 years ago by therve

Cc: therve added

comment:7 Changed 16 years ago by therve

Cc: Ralph Meijer Glyph added

comment:8 Changed 16 years ago by jknight

I think this is done now. source:branches/killtpc-1636

comment:9 Changed 16 years ago by Jean-Paul Calderone

Keywords: review added
Owner: Glyph deleted
Priority: highhighest
Status: assignednew

Review tickets should have the "review" keyword and be highest priority. They should only be assigned if someone has agreed to do the review.

comment:10 Changed 16 years ago by radix

Keywords: review removed
Owner: set to jknight

I tried merging this to review it but had multiple conflicts. Please merge it forward.

comment:11 Changed 16 years ago by jknight

source:branches/killtpc-1636-2

comment:12 Changed 16 years ago by jknight

Keywords: review added
Owner: jknight deleted

comment:13 Changed 16 years ago by jknight

Owner: set to radix

comment:14 Changed 16 years ago by Jean-Paul Calderone

Owner: changed from radix to Jean-Paul Calderone

comment:15 Changed 16 years ago by Jean-Paul Calderone

Status: newassigned

comment:16 Changed 16 years ago by Jean-Paul Calderone

Keywords: review removed
Owner: changed from Jean-Paul Calderone to jknight
Status: assignednew
  • twisted/protocols/ftp.py - IDTPFactory makes no sense with zi Interface. Recommend it be deleted and the class that declares itself as implemented it no longer do so. There are no other uses of this interface anywhere in the codebase, even the test suite.
  • twisted/names/dns.py - IRecord has a @cvar, this is nonsensical with zope interface. Please make a ticket for fixing it when you merge.
  • in general, there are a lot of @ivars on interfaces. These should be Attributes now. Another ticket.
  • twisted/test/test_components.py - InterfacesTestCase is completely redundant with zope.interface's test suite now. Similarly, some of AdapterTestCase is just testing z.i code. A bunch of other stuff in this module is crap too. And a bunch of stuff that should be there, like explicit tests for registerAdapter, aren't. Not specifically a problem with this branch, but something we should address. The deletions should definitely be done in this branch though.
  • twisted/conch/interfaces.py has a comment which imports tpcInterface at the top, this should be deleted
  • I ran pyflakes twisted | grep components and there was a ton of output. A bunch of this should probably be fixed.

comment:17 Changed 16 years ago by jknight

I can do the rest, but I'd love if someone else did the test_components.py cleanup bit. :)

comment:18 Changed 16 years ago by jknight

Rest done. #1852, #1853 and code.

comment:19 Changed 16 years ago by jknight

Keywords: review added
Owner: changed from jknight to Jean-Paul Calderone

Okay, I did test_components cleanup too. Plz rereview.

comment:20 Changed 16 years ago by Jean-Paul Calderone

Keywords: review removed
Owner: changed from Jean-Paul Calderone to jknight

This branch looks good.

comment:21 Changed 16 years ago by jknight

Resolution: fixed
Status: newclosed

(In [17451]) Remove twisted.components.Interface completely.

Merges: killtpc-1636-2 Authors: glyph, therve, jknight Reviewer: exarkun

Remove deprecated twisted.python.components functionality: MetaInterface, Interface, getAdapterClass, and getAdapterClassWithInheritance.

Also convert all twisted interfaces to use zope.interface directly (including removing "self" argument), and remove redundant tests.

comment:22 Changed 11 years ago by <automation>

Owner: jknight deleted
Note: See TracTickets for help on using tickets.