Version 130 (modified by Jean-Paul Calderone, 7 years ago) (diff)

custom pydoctor moved

This document describes the Twisted release process. Although it is still incomplete, every effort has been made to ensure that it is accurate and up-to-date. There are plans to eventually move this document into the source tree (#4543).

This process has only been tested on Linux, so we recommend that you do the release on Linux.


By the end of a Twisted release we'll have:

  • Tarballs for Twisted as a whole, and for each of its subprojects
  • Windows installers for the whole Twisted project
  • Updated documentation (API, howtos & book) on the site
  • Updated download links on the site
  • Announcement emails sent to major Python lists
  • Announcement post on
  • A tag in our Subversion repository marking the release


To release Twisted, you will need:

  • Commit privileges to Twisted
  • Shell access to
    • XXX: Possibly this ought to be permission to log in as www-data
  • Write permissions to /srv/www-data/twisted on cube (normally, www-data membership)
  • Write permissions to /srv/www-data/website/vhosts/
  • Permissions to edit WikiStart
  • Channel operator permissions for #twisted
  • Admin privileges for Twisted's PyPI packages
  • Membership of
  • Contributor status for

Version numbers

Twisted releases use a time-based numbering scheme. Releases versions like, where YY is the last two digits of the year of the release, MM is the number of the release in the year, and mm is the number of the patch release.

For example:

  • The first release of 2010 is 10.0.0
  • The second release of 2010 is 10.1.0
  • If 10.1.0 has some critical defects, then a patch release would be numbered 10.1.1
  • The first pre-release of 10.0.0 is 10.0.0pre1, the second is 10.0.0pre2

Every release of Twisted includes the whole project, the core and all subprojects. Each of these has the same number.

Throughout this document, we'll refer to the version number of the release as $RELEASE. Examples of $RELEASE include 10.0.0, 10.1.0, 10.1.1 etc.

We'll refer to the first two components of the release as $API, since all releases that share those numbers are mutually API compatible. e.g. for 10.0.0, $API is 10.0; for 10.1.0 and 10.1.1, $API is 10.1.


To release Twisted, we

  1. Prepare for a release
  2. Release N prereleases
  3. Release the final release

Prepare for a release

  1. Check the milestone for the upcoming release
    1. Get rid of any non-critical bugs
    2. Get any critical bugs fixed
  2. Check for any regressions
  3. Read through the INSTALL and README files to make sure things like the supported Python versions are correct
    1. Check the required Python version.
    2. Check that the list matches the current set of buildbots.
    3. Any mistakes should be fixed in trunk before making the release branch
  4. Choose a version number. Remember to include the 'preN' suffix
  5. File a ticket
    1. Assign it to the upcoming release milestone
    2. Assign it to yourself
    3. Call it "Release $RELEASE"
  6. Make a branch (e.g. mkbranch Twisted releases/release-$RELEASE-4290)

How to do a pre-release

  1. Check buildbot to make sure all supported platforms are green (wait for pending builds if necessary).
  2. If a previously supported platform does not currently have a buildbot, move from supported platforms to "expected to work" in INSTALL. (Pending #1305)
  3. Run ./bin/admin/change-versions XX.YY.ZZpreN
  4. Commit the changes made by change-versions
  5. Run ./bin/admin/build-news .
  6. Commit the changes made by build-news
  7. Delete the NEWS turds (see #4315)
  8. Bump copyright dates in LICENSE, twisted/, and README
  9. Make a temporary directory for the tarballs to live in (e.g. mkdir /tmp/twisted-release)
  10. Run ./bin/admin/build-tarballs . /tmp/twisted-release/
  11. Upload the tarballs to a public website (see #4353)
  12. Write the pre-release announcement
    1. Read through the NEWS file and summarize the interesting changes for the release
    2. Get someone else to look over the announcement before doing it
  13. Announce the pre-release on
    1. the twisted-python mailing list
    2. on IRC in the #twisted topic
    3. in a blog post, ideally

Pre-release announcment

The pre-release announcement should mention the important changes since the last release, and exhort readers to test this pre-release.

Here's what the $RELEASEpre1 release annoucement might look like:

Live from PyCon Atlanta, I'm pleased to herald the approaching
footsteps of the $API release.

Tarballs for the first Twisted $RELEASE pre-release are now available at:

Highlights include:

 * Improved documentation, including "Twisted Web in 60 seconds"

 * Faster Perspective Broker applications

 * A new Windows installer that ships without zope.interface

 * Twisted no longer supports Python 2.3

 * Over one hundred closed tickets

For more information, see the NEWS file.

Please download the tarballs and test them as much as possible.


How to do a final release

Prepare the branch

  1. Have the release branch, previously used to generate a pre-release, checked out
  2. Run ./bin/admin/change-versions $RELEASE
  3. Add the quote of the release to the README
  4. Commit the version and README changes.
  5. Submit the ticket for review
  6. Pause until the ticket is reviewed and accepted.
  7. Tag the release
    • e.g. svn cp svn+ssh://$RELEASE-4290 svn+ssh://$RELEASE
    • A good commit message to use is something like "Tag $RELEASE release"

Cut the tarballs & installers

  1. Create a new staging area for the release (e.g. mkdir /tmp/twisted-release)
  2. Using a checkout of the release branch or the release tag (with no local changes!), run ./bin/admin/build-tarballs . /tmp/twisted-release/
  3. Build windows installers
    4. For "Branch" specify the tag, e.g. "tags/releases/twisted-$RELEASE"
    5. Download the latest .msi and .exe files from from and save them in the staging directory
      1. The installers built from windows7-64-py2.7-msi will counter-intuitively have names that end in winxp32-py2.7.exe and winxp32-py2.7.msi. This is because of "distutils weirdness and other things".
  4. Sign the tarballs and Windows installers
    1. e.g. md5sum Tw* | gpg -a --clearsign > twisted-$RELEASE-md5sums.txt
    2. e.g. scp twisted-$RELEASE-md5sums.txt (XXX This will automatically adjust the links on the Downloads page, even though the release files are not yet in place. Consider moving this step to a later part of the process.)
    3. example of the result


  1. Upload to the official upload locations (see #2888)
    1. e.g. ssh mkdir -m 2775 /srv/www-data/twisted/Releases/{Twisted,Core,Conch,Lore,Mail,Names,News,Pair,Runner,Web,Words}/$API
    2. e.g. scp /tmp/twisted-release/Twisted-$RELEASE.tar.bz2$API/
    3. For all subprojects, upload the tarballs to$SUBPROJECT/$API/
    4. Windows installers (msi and exe) go in the Twisted project
  2. Update the permissions on cube
    1. For all new directories, chmod 2775 $DIRECTORY
    2. For all new files, chmod 664 $FILE
    3. For all new files and directories, chgrp www-data $FILE_OR_DIR
    4. e.g. On cube, find /srv/www-data/twisted/Releases -name '*$RELEASE*' | xargs chmod g+w
  3. Wait for the tarballs to be mirrored to
    • They are mirrored 15 minutes after every hour
    • You can ask foom on #twisted to force the mirror

Update documentation

  1. Get the dependencies
  2. Export the version of Twisted being released
    • e.g. svn export svn+ssh://$RELEASE
  3. Create and run the unofficial build-docs script in an export of the release tag
    1. cd twisted-$RELEASE
    2. Create a containing the code from ReleaseProcess#Buildhowtodocumentsforwebsite. Be sure to replace the instances of $RELEASE in that script.
    3. Edit doc/core/howto/template.tpl adding the Google Analytics JavaScript (which can be found in the source of any trac page).
      • XXX: The script below builds the docs into the current directory, mixing them up with the source files
      • If you get a traceback like below, the Analytics JavaScript may been in an inappropriate place in template.tpl:
          File "/usr/lib/python2.6/xml/dom/", line 1918, in parse
            return expatbuilder.parse(file)
          File "/usr/lib/python2.6/xml/dom/", line 928, in parse
            result = builder.parseFile(file)
          File "/usr/lib/python2.6/xml/dom/", line 207, in parseFile
            parser.Parse(buffer, 0)
        xml.parsers.expat.ExpatError: junk after document element: line 25, column 0
    4. python
    5. cp -R doc /tmp/twisted-release/
    6. cd /tmp/twisted-release/doc
  4. Fix the Google Analytics javascript (due to #4544 and #4545)
    1. find /tmp/twisted-release/doc -name '*.html' | xargs sed -i 's/"UA-99018-6"/"UA-99018-6"/'
    2. find . -name '*.html' | xargs sed -i 's/\(urchin\.js.*\)javascript"\/>/\1javascript"><\/script>/'
  5. Make the documentation directory on cube
    • e.g. ssh mkdir -m 2775 ~www-data/distributable/documentation/$RELEASE
  6. Upload the documents to cube
    • e.g. scp -r doc/*$RELEASE
  7. Run the build-apidocs script to build the API docs (in an export of the release tag) and then upload them (See also APIDocs and #2891)
    1. ./bin/admin/build-apidocs . ./api
    2. Documentation will be generated in a directory called ./api
    3. tar -cjf apidocs.tar.bz2 api
    4. scp apidocs.tar.bz2
    5. On cube, tar -xjf apidocs.tar.bz2
    6. On cube, mv apidocs ~www-data/distributable/documentation/$RELEASE/api
  8. Copy the book
    • e.g. scp book.pdf$RELEASE/core/howto
  9. Update the permissions on cube
    1. cd ~www-data/distributable/documentation/$RELEASE
    2. find . -type d | xargs chmod 2775
    3. find . -type f | xargs chmod 664
    4. chgrp -R www-data .
  10. Test the generated docs
    1. Browse to$RELEASE/
    2. Make sure that there is content in each of the directories and that it looks good
    3. Follow each link on, replace current with $RELEASE (e.g. 10.0.0) and look for any obvious breakage
  11. Change the "current" symlink
    1. On cube cd ~www-data/distributable/documentation
    2. On cube, rm current
    3. On cube, ln -s $RELEASE current


  1. Update Downloads pages
    1. The following steps are automatic, due to the use of the ProjectVersion wiki macro throughout most of the Downloads page
      1. Change text references to the old version to refer to the new version
      2. Update the link to the NEWS file to point to the new version
      3. Update links and text to MSIs
      4. Update links and text to the main tarball
      5. Update links and text to sub tarballs, including links to news files
    2. Add a new md5sum link
    3. Save the page, check all links
  2. Update PyPI records & upload files
  3. Update PyPI records, editing the version
  4. Update WikiStart
  5. Write the release announcement (see below)
  6. Update ReleaseRevisions with the revision of this release
    • The final revision of the release is the revision in which the release branch was made. The starting revision is the one immediately after the final revision of the previous release.
  7. Announce the release
    1. Send a text version of the announcement to: twisted-python@…, python-announce-list@…, python-list@…, twisted-web@…, twisted-jabber@…
    2. Launchpad;
      • Post a web version of the announcements, with links instead of literal URLs
    4. Twitter, if you feel like it
    5. #twisted topic on IRC (you'll need ops)
  8. Merge the release branch into trunk, closing the release ticket at the same time.

Release announcement

The final release announcement should:

  • Mention the version number
  • Include links to the release tarballs & Windows installers (both msi & exe)
  • Summarize the significant changes in the release
  • Consider including the quote of the release
  • Thank the contributors to the release

Here's an example:

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

Highlights include:

 * Improved documentation, including "Twisted Web in 60 seconds"

 * Faster Perspective Broker applications

 * A new Windows installer that ships without zope.interface

 * Twisted no longer supports Python 2.3

 * Over one hundred closed tickets

For more information, see the NEWS file.

It's stable, backwards compatible, well tested and in every way an
improvement. Download it now from:$API/Twisted-$RELEASE.tar.bz2 or$API/Twisted-$RELEASE.win32-py2.5.msi or$API/Twisted-$RELEASE.win32-py2.6.msi

Many thanks to Jean-Paul Calderone and Chris Armstrong, whose work on
release automation tools and answers to numerous questions made this
possible. Thanks also to the supporters of the Twisted Software
Foundation and to the many contributors for this release.


When things go wrong

If you discover a showstopper bug during the release process, you have three options.

  1. Abort the release, make a new point release (e.g. abort 10.0.0, make 10.0.1 after the bug is fixed)
  2. Abort the release, make a new pre-release (e.g. abort 10.0.0, make 10.0.0pre3 after the bug is fixed)
  3. Interrupt the release, fix the bug, then continue with it (e.g. release 10.0.0 with the bug fix)

If you choose the third option, then you should:

  1. Delete the tag for the release
  2. Recreate the tag from the release branch once the fix has been applied to that branch


Build howto documents for website

See #2380.

from twisted.python import _release as r
from twisted.python.filepath import FilePath
done = {}
for p in FilePath('doc').walk():
    if p.basename() == 'man':
        print 'processing manual pages:', p.path
        done[p] = True
for p in FilePath('doc').walk():
    if p.basename().endswith('.xhtml'):
        if p.parent() not in done:
            print 'processing howto pages:', p.parent().path
            done[p.parent()] = True
                '$RELEASE', FilePath('doc/core/howto'), p.parent(),

print 'building book:'
for p in done:
    print '     ', p.path
r.BookBuilder().build(FilePath('doc/core/howto'), done.keys(),

Open questions

  • How do we manage the case where there are untested builds in trunk?
  • Should picking a release quote be part of the release or the pre-release?
  • What bugs should be considered release blockers?
    • Ultimately it's the RM's discretion
  • Should news fragments contain information about who made the changes?
  • A thought for future releases: since we'd really like folks to download the prereleases and try them out, perhaps we should put the [source:trunk/NEWS NEWS] file on the web somewhere official, too, so they can see all the cool stuff they can try out?
    • XXX: jml doesn't know what this means any more

Bugs mentioned on this page

See also