Sunday, September 2, 2012

Quick Fix: Upgrading Zope Interface so you can work on Twisted trunk post-12.2 release

Immediately after the recent 12.2 release, Twisted has upgraded its required version of Zope Interface.  Some platforms ship with a system-installed version of Zope Interface that is slightly too old for this change.  You may have noticed an unhelpful error message if you happened to svn up before learning about this change.

Upgrading system-installed Python packages without doing harm can be a challenge, so in this post we'll provide simple instructions for users who:
  • have a system-installed version of Zope Interface
  • are on a Unix-y platform, like Linux, BSD, or OS X (if you're on Windows, just upgrade to the latest on your system installation)
  • are not using a tool like virtualenv or Combinator to manage Zope Interface (if you are, you should already know what to do!)
  • don't want to upgrade anything system-wide, so as to avoid disturbing other users or software on their system
  • have easy_install already available in their environment.  (While Pip is generally better, it is pre-installed less often, and Pip doesn't seem to deal as well as easy_install with the case of parallel installation of user and system installed dependencies; it assumes you are using virtualenv for that. Update: as of the most recent release,  pip deals just fine with parallel user/system installation; so, if you've got pip installed, "pip install zope.interface==4.0.2" – possibly with a --user option if that's appropriate to your environment – will work just fine.  Thanks, Pip maintainers!)
This set of attributes describes many Linux and OS X developers who are likely to encounter this version skew issue, so off we go.

Since easy_install can't be coerced to do the right thing by command-line options, you'll need to give it a configuration file that it can read.  The easiest way to do this is to create a temporary directory, cd into it, and create a file called setup.cfg.  For Linux and BSD, setup.cfg looks like this:
[install]
prefix=~/.local
For OS X, the file looks like this:
[install]
prefix=~/.local
install_lib=~/Library/Python/$py_version_short/lib/python/site-packages
Once you've created that file, just  easy_install --upgrade zope.interface from that directory and you should be ready to start developing with Twisted again!  All the older versions of Twisted that I've tried still work with the newest Zope Interface so this shouldn't disturb your ability to test your code against older versions of Twisted as well, if you're managing it with something like Combinator or virtualenv.


Twisted 12.2.0 Released

On behalf of Twisted Matrix Laboratories, I am honored to announce the release of Twisted 12.2.

Highlights for this release include:

To be able to work on Python3 support, Python 2.5 is no longer supported.
  • twisted.mail.imap4 now serves BODYSTRUCTURE responses which provide more information and conform to the IMAP4 RFC more closely.
  • twisted.conch now supports commercial SSH implementations which don't comply with the IETF standard.
  • twisted.internet.endpoints now provides several new endpoints, including aTCP client endpoint that resolves hostnames to IPv6 host addresses.
  • IReactorSocket.adoptStreamConnection, implemented by some reactors, allows adding an existing established connection to the reactor.
Starting with the release after 12.2, Twisted will begin requiring Zope Interface version 3.6 or greater (as part of Python 3 support).

This is the last Twisted release supporting Python 2.6 on Windows.

For more information, see the NEWS file here: