Tuesday, May 27, 2008

Twisted and Divmod: A Cheater's Setup Guide

I've been helping a few folks out on IRC lately. They've wanted to know how to setup Twisted and Divmod without doing any installs, running directly from SVN. They've been in luck, because that's actually how we develop at Divmod :-)

Here are the Cliff Notes (this stuff is available on the wikis, but it's spread out):

Install the dependencies:
pycrypto 2.0
SQLite 3.2.1
PySQLite 2.0
PyTZ 2005m-1
PIL 1.1.6
Get the Divmod code first (we'll get Twisted next):
mkdir ~/lab
cd ~/lab
svn co http://divmod.org/svn/Divmod/trunk Divmod/trunk
Set the Combinator env vars (if you want to persist this, then you'll need to put it in your .profile or shell .rc file):
eval `python ~/lab/Divmod/trunk/Combinator/environment.py`
Have Combinator start "tracking" Divmod and Twisted, thus managing PYTHONPATH for them (note that chbranch will detect that Twisted has not been checked out and will do so automatically):
chbranch Divmod trunk
chbranch Twisted trunk svn://svn.twistedmatrix.com/svn/Twisted/trunk
Get the new project dirs into the env:
eval `python ~/lab/Divmod/trunk/Combinator/environment.py`
Executing the whbranch command should give you the following:
Divmod: trunk
Twisted: trunk
If you start up a Python interpreter, you'll be able to import from twisted, mantissa, axiom, etc.

Update: the instructions have been edited and shortened, thanks to insight from Glyph.


  1. I can't tell you how happy I am to have run across this post. I've been putting off setting up a Mantissa stack for nearly three weeks, somewhat amazed that I wasn't able to find a quick-start. I am optimistic and excited to be on the brink of exploring the Divmod suite as my introduction to Python ...


  2. Grant, note that I've updated the post with edits from Glyph; the steps are now even shorter and easier :-)

  3. Still muckin' around with that Combinator silliness? Isn't it about time to move to a real DVCS? And when you do, don't you *dare* using anything else than Mercurial! ;-)

  4. Well, we've talked about switching to bzr :-) We'd have to port our tools and deal with trac, though...

  5. Even if we used hg or bzr, we'd have to rewrite Combinator to work with them.

  6. The only thing that would really change in these instructions if svn was replaced with bzr or hg is that "svn co" would become "hg clone" or "bzr branch".

  7. the divmod code's now hosted on launchpad, so the checkout command is now:

    bzr branch lp:divmod.org

    then make sure that combinator is found in a Divmod/trunk folder structure, this works for me:

    mkdir Divmod
    mv divmod.org Divmod/trunk