Version 160 (modified by 5 years ago) (diff) | ,
---|
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.
Outcomes
By the end of a Twisted release we'll have:
- Tarballs for Twisted as a whole, and for each of its sub-projects
- Windows installers for the whole Twisted project
- Updated documentation (API, howtos & book) on the twistedmatrix.com site
- Updated download links on the twistedmatrix.com site
- Announcement emails sent to major Python lists
- Announcement post on http://labs.twistedmatrix.com
- A tag in our Subversion repository marking the release
Prerequisites
To release Twisted, you will need:
- Commit privileges to Twisted
- Shell access to cube.twistedmatrix.com
- XXX: Possibly this ought to be permission to log in as
www-data
- XXX: Possibly this ought to be permission to log in as
- Write permissions to /srv/www-data/twisted on cube (normally, www-data membership)
- Write permissions to /srv/www-data/website/vhosts/twistedmatrix.com/documents
- Permissions to edit WikiStart
- Channel operator permissions for #twisted
- Admin privileges for Twisted's PyPI packages
- Membership of https://launchpad.net/~twisted-dev
- Contributor status for http://labs.twistedmatrix.com
Version numbers
Twisted releases use a time-based numbering scheme. Releases versions like YY.MM.mm
, 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 sub-projects. 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.
The change-versions script automatically picks the right number for you. Please retrieve it after you run it.
Overview
To release Twisted, we
- Prepare for a release
- Release N pre-releases
- Release the final release
Prepare for a release
- Check the milestone for the upcoming release
- Get rid of any non-critical bugs
- Get any critical bugs fixed
- Check for any regressions
- Read through the
INSTALL
andREADME
files to make sure things like the supported Python versions are correct- Check the required Python version.
- Check that the list matches the current set of buildbots.
- Any mistakes should be fixed in trunk before making the release branch
- Choose a version number. Remember to include the 'preN' suffix
- File a ticket
- Assign it to the upcoming release milestone
- Assign it to yourself
- Call it "Release $RELEASE"
- Make a branch (e.g.
mkbranch Twisted releases/release-$RELEASE-4290
)
How to do a pre-release
- Check buildbot to make sure all supported platforms are green (wait for pending builds if necessary).
- If a previously supported platform does not currently have a buildbot, move from supported platforms to "expected to work" in
INSTALL
. (Pending #1305) - Run
./bin/admin/change-versions --prerelease
- Commit the changes made by
change-versions
- Run
./bin/admin/build-news .
- Commit the changes made by
build-news
Delete the NEWS turds (see #4315)- Bump copyright dates in
LICENSE
,twisted/copyright.py
, andREADME
- Make a temporary directory for the tarballs to live in (e.g.
mkdir /tmp/twisted-release
) - Run
./bin/admin/build-tarballs . /tmp/twisted-release/
- Note:
build-tarballs
does not produce exactly the same output when run multiple times, even when nothing else has changed. If a problem is encountered that requiresbuild-tarballs
to be re-run (either during the pre-release or later during the release), care must be taken to avoid releasing two or more different versions of the tarball.
- Note:
- Upload the tarballs to a public website (see #4353)
- Write the pre-release announcement
- Read through the
NEWS
file and summarize the interesting changes for the release - Get someone else to look over the announcement before doing it
- Read through the
- Announce the pre-release on
- the twisted-python mailing list
- on IRC in the
#twisted
topic - in a blog post, ideally
labs.twistedmatrix.com
Pre-release announcement
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 announcement 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: http://people.canonical.com/~jml/Twisted/ 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. Thanks, jml
How to do a final release
Prepare the branch
- Have the release branch, previously used to generate a pre-release, checked out
- Run
./bin/admin/change-versions
- Add the quote of the release to the README
- Make a new quote file for the next version:
svn cp doc/fun/Twisted.Quotes doc/historic/Quotes/Twisted-$RELEASE; echo '' > doc/fun/Twisted.Quotes
. - Commit the version and README changes.
- Submit the ticket for review
- Pause until the ticket is reviewed and accepted.
- Tag the release
- e.g.
svn cp svn+ssh://svn.twistedmatrix.com/svn/Twisted/branches/releases/release-$RELEASE-4290 svn+ssh://svn.twistedmatrix.com/svn/Twisted/tags/releases/twisted-$RELEASE
- A good commit message to use is something like "Tag $RELEASE release"
- e.g.
Cut the tarballs & installers
- Create a new staging area for the release (e.g.
mkdir /tmp/twisted-release
) - Using a checkout of the release branch or the release tag (with no local changes!), run
./bin/admin/build-tarballs . /tmp/twisted-release/
- Build windows installers
http://buildbot.twistedmatrix.com/builders/winxp32-py2.5-msi/http://buildbot.twistedmatrix.com/builders/winxp32-py2.6-msi/- http://buildbot.twistedmatrix.com/builders/winxp32-py2.7-msi/
- http://buildbot.twistedmatrix.com/builders/windows7-64-py2.7-msi
- For "Branch" specify the tag, e.g. "tags/releases/twisted-$RELEASE"
- The builders use the bzr export, which doesn't mirror tags/ or branches/releases/. You may need to copy the branch elsewhere.
- Download the latest
.msi
and.exe
files from from http://buildbot.twistedmatrix.com/builds/twisted-packages/ and save them in the staging directoryThe 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".
- Sign the tarballs and Windows installers
- e.g.
md5sum Tw* | gpg -a --clearsign > twisted-$RELEASE-md5sums.txt
- Compare this to an example of twisted-$RELEASE-md5sums.txt
- e.g.
Distribute
- Upload to the official upload locations (see #2888)
- e.g.
ssh cube.twistedmatrix.com mkdir -m 2775 /srv/www-data/twisted/Releases/{Twisted,Core,Conch,Lore,Mail,Names,News,Pair,Runner,Web,Words}/$API
- e.g.
scp /tmp/twisted-release/Twisted-$RELEASE.tar.bz2 cube.twistedmatrix.com:/srv/www-data/twisted/Releases/Twisted/$API/
- For all subprojects, upload the tarballs to
cube.twistedmatrix.com:/srv/www-data/twisted/Releases/$SUBPROJECT/$API/
- Windows installers (msi and exe) go in the
Twisted
project
- e.g.
- Update the permissions on
cube
- For all new directories,
chmod 2775 $DIRECTORY
- For all new files,
chmod 664 $FILE
- For all new files and directories,
chgrp www-data $FILE_OR_DIR
- e.g. On cube,
find /srv/www-data/twisted/Releases -name '*$RELEASE*' | xargs chmod g+w
- For all new directories,
Wait for the tarballs to be mirrored to http://tmrc.mit.edu/mirror/twisted/Twisted/They are mirrored 15 minutes after every hourYou can ask foom on #twisted to force the mirror
Update documentation
- Get the dependencies
- Pydoctor (use lp:~twisted-dev/pydoctor/twisted-templates-2 to get google analytics templates)
- Nevow
- Epydoc (
python-epydoc
in Debian) - Some version of Latex if you didn't use the Epydoc Debian/Ubuntu package or ignored the recommended packages
- netpbm (graphics conversion tools used by the book-builder)
- Export the version of Twisted being released
- e.g.
svn export svn+ssh://svn.twistedmatrix.com/svn/Twisted/tags/releases/twisted-$RELEASE
- e.g.
- Create and run the unofficial
build-docs
script in an export of the release tagcd twisted-$RELEASE
- Create a
build-docs.py
script based on this template. Be sure to read the notes at the top of that script.- XXX: The script builds the docs into the current directory, mixing them up with the source files.
python build-docs.py
- If you have latex errors when trying to build the book and retry, don't forget to clean tmp directories which may be leftover in
doc/core/howto
.
- If you have latex errors when trying to build the book and retry, don't forget to clean tmp directories which may be leftover in
cp -R doc /tmp/twisted-release/
cd /tmp/twisted-release/doc
- Make the documentation directory on cube
- e.g.
ssh cube.twistedmatrix.com mkdir -m 2775 ~www-data/distributable/documentation/$RELEASE
- e.g.
- Upload the documents to cube
- e.g.
scp -r doc/* cube.twistedmatrix.com:~www-data/distributable/documentation/$RELEASE
- e.g.
- 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)./bin/admin/build-apidocs . ./api
- Documentation will be generated in a directory called
./api
tar -cjf apidocs.tar.bz2 api
scp apidocs.tar.bz2 cube.twistedmatrix.com:.
- On cube,
tar -xjf apidocs.tar.bz2
- On cube,
mv apidocs ~www-data/distributable/documentation/$RELEASE/api
- Copy the book
- e.g.
scp book.pdf cube.twistedmatrix.com:~www-data/distributable/documentation/$RELEASE/core/howto
- e.g.
- Update the permissions on cube
cd ~www-data/distributable/documentation/$RELEASE
find . -type d | xargs chmod 2775
find . -type f | xargs chmod 664
chgrp -R www-data .
- Test the generated docs
- Browse to
http://twistedmatrix.com/documents/$RELEASE/
- Make sure that there is content in each of the directories and that it looks good
- Follow each link on http://twistedmatrix.com/trac/wiki/Documentation, replace
current
with $RELEASE (e.g.10.0.0
) and look for any obvious breakage
- Browse to
- Change the "current" symlink
- On cube
cd ~www-data/distributable/documentation
- On cube,
rm current
- On cube,
ln -s $RELEASE current
- On cube
Synchronize Trac
- The site uses the ProjectVersion macro to automatically adjust the links on the wiki pages, including WikiStart and Downloads, by parsing the latest
twisted-$RELEASE-md5sums.txt
:scp twisted-$RELEASE-md5sums.txt cube.twistedmatrix.com:/srv/www-data/twisted/Releases/
Announce
- Update Downloads pages
- The following steps are automatic, due to the use of the ProjectVersion wiki macro throughout most of the Downloads page
- Change text references to the old version to refer to the new version
- Update the link to the NEWS file to point to the new version
- Update links and text to MSIs
- Update links and text to the main tarball
- Update links and text to sub tarballs, including links to news files
- Add a new md5sum link
- Save the page, check all links
- The following steps are automatic, due to the use of the ProjectVersion wiki macro throughout most of the Downloads page
- Update PyPI records & upload files
- http://pypi.python.org/pypi/Twisted/
- Edit the version
- Upload tarball and MSIs
- http://pypi.python.org/pypi/Twisted/
- Update PyPI records, editing the version
- http://pypi.python.org/pypi/Twisted%20Pair/
- http://pypi.python.org/pypi/Twisted%20Conch/
- http://pypi.python.org/pypi/Twisted%20Core/
- http://pypi.python.org/pypi/Twisted%20Lore/
- http://pypi.python.org/pypi/Twisted%20Mail/
- http://pypi.python.org/pypi/Twisted%20Names/
- http://pypi.python.org/pypi/Twisted%20News/
- http://pypi.python.org/pypi/Twisted%20Runner/
- http://pypi.python.org/pypi/Twisted%20Web/
- http://pypi.python.org/pypi/Twisted%20Words/
Update WikiStart- Write the release announcement (see below)
- 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.
- Announce the release
- Send a text version of the announcement to:
twisted-python@twistedmatrix.com, python-announce-list@python.org, python-list@python.org, twisted-web@twistedmatrix.com, twisted-jabber@ik.nu
- Note: you need to be subscribed to some of those lists to be able to send, like twisted-jabber@….
- Launchpad;
- https://launchpad.net/twisted/main/+addrelease
- Include a text version of the announcement and the new entries of the NEWS file
- https://launchpad.net/twisted/+announcements
- https://launchpad.net/twisted/main/+addrelease
- http://labs.twistedmatrix.com
- Post a web version of the announcements, with links instead of literal URLs
- Twitter, if you feel like it
- #twisted topic on IRC (you'll need ops)
- Send a text version of the announcement to:
- Merge the release branch into trunk, closing the release ticket at the same time.
- For now you need to add a .misc NEWS fragment to merge the branch.
- Close the release milestone (which should have no tickets in it).
- Open a milestone for the next release.
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: http://tmrc.mit.edu/mirror/twisted/Twisted/$API/Twisted-$RELEASE.tar.bz2 or http://tmrc.mit.edu/mirror/twisted/Twisted/$API/Twisted-$RELEASE.win32-py2.5.msi or http://tmrc.mit.edu/mirror/twisted/Twisted/$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. jml
When things go wrong
If you discover a showstopper bug during the release process, you have three options.
- Abort the release, make a new point release (e.g. abort 10.0.0, make 10.0.1 after the bug is fixed)
- Abort the release, make a new pre-release (e.g. abort 10.0.0, make 10.0.0pre3 after the bug is fixed)
- 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:
- Delete the tag for the release
- Recreate the tag from the release branch once the fix has been applied to that branch
Examples
Build howto documents for website
See #2380.
from twisted.python import _release as r from twisted.python.filepath import FilePath # Make sure to replace the following in this script: # - the instances of $RELEASE with the version number (eg. `11.0.0`) # - download http://bazaar.launchpad.net/~twisted-dev/twisted-website/trunk/view/head:/docs/website-template.tpl # somewhere and update the instance of '/path/to/website-template.tpl' accordingly done = {} for p in FilePath('doc').walk(): if p.basename() == 'man': print 'processing manual pages:', p.path done[p] = True r.ManBuilder().build(p) 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 r.DocBuilder().build( '$RELEASE', FilePath('doc/core/howto'), p.parent(), FilePath('/path/to/website-template.tpl'), 'http://twistedmatrix.com/documents/$RELEASE/api/%s.html', False) print 'building book:' for p in done: print ' ', p.path r.BookBuilder().build(FilePath('doc/core/howto'), done.keys(), FilePath('doc/core/howto/book.tex'), FilePath('book.pdf'))
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
- Automate uploading tarballs to TMRC
- Automate uploading pre-release tarballs
- Convenience command for removing news fragments
- Automate building & uploading API docs for website
- Automate building & uploading howto docs for website
- Lore applies quoting to contents of script tags
- Lore collapses script tags
See also
- release management tickets
- regular-release tickets
- ReleaseAutomation
- Releasing Bazaar -- release documentation for another project that does time-based releases