r7 - 05 Jul 2010 - 11:49:34 - DavidOlssonYou are here: OSAF >  Developers Web  > ChandlerTwoSetup

Setting up chandler2

Note: Chandler2 is currently a developer-only project — there are no installable end-user packages, and you have to set up a development environment to run the demo. These instructions have yet to be tested on a Windows machine, but will be soon.

The chandler2 codebase consists of three separate python subprojects, each installable via setuptools. Although chandler2 itself doesn't have any non-python code, some of its dependencies do, and so this complicates the setup process a little. Lastly, built-in support for python 2.5 varies from none (e.g. in Windows) to extensive (Linux), so the following is broken down by OS.


On recent Ubuntu releases (I've tested 8.10, a.k.a. "Intrepid" on both i386 and amd64), you should be able to install many of the dependencies via the standard (apt) package installer:

$ sudo apt-get install python-setuptools python-virtualenv python-pyicu python-twisted python-wxgtk2.8

I prefer to use the handy virtualenv tool to set up an isolated environment. This makes it easy to deal with cases where I need a more recent version of a python package than what I installed above. It also avoids unfortunate cases where your system python can get confused by having stale copies of chandler2 or its dependencies on the global python path. I'm going to use ~/sandbox for this installation, but of course you can substitute whatever directory you’d like.

$ python -m virtualenv ~/sandbox
New python executable in /home/grant/bin/python
Installing setuptools............done.

This just set up a sandboxed python installation in ~/sandbox, which allows you to install and access your own copies of python modules in the sandbox.

At this point, we can go ahead and check out the chandler2 project from subversion:

$ cd ~/sandbox
$ svn checkout http://svn.osafoundation.org/chandler2/trunk chandler2
A    chandler2/Chandler-Development
A    chandler2/Chandler-Development/chandler
 U   chandler2
Checked out revision 202.

We’re now ready to go ahead and install the three Chandler subprojects in development mode:

$ cd chandler2
$ make develop PYTHON=~/sandbox/bin/python SETUP_OPTS=-Z
running develop
Using /home/grant/sandbox/lib/python2.5/site-packages/SymbolType-1.0-py2.5.egg
Finished processing dependencies for Chandler-Development==0.0.2

Now you should be able to run the demo via

$ ~/sandbox/bin/chandler-demo

Sample Data

Since there's no real data present in the demo, and it’s hard to create new items without a detail view (or menus), you might want to load some sample data by

$ cp ~/sandbox/chandler2/Chandler-App/chex_chandler2.gz ~/chandler2.chex.gz

before launching the demo script.

Other Operating Systems

The simplest route on other operating systems is probably to use the Chandler 1.0 build process to get wxPython and PyICU in a working Python environment. (An alternate route, if you’re a dab hand at building stuff yourself, is to install your own Python 2.5, PyICU and wxPython).

Here’s one way to achieve this. If you’re running on Windows, I assume that you are running Cygwin. On Mac OS X, you will need the make and svn commands, which people usually get from the Xcode Tools package (should be present on your install DVD; alternatively a free download with registration required from developer.apple.com).

First, let’s create a directory where we’ll download all of chandler’s dependencies. I’m calling this directory sandbox, and putting it in my home directory, but you can put it wherever you’d like (and change the commands below accordingly, of course).

$ mkdir ~/sandbox

Next, we’ll get two build-related files from Chandler:

$ cd ~/sandbox
$ svn export http://svn.osafoundation.org/chandler/trunk/chandler/Makefile
A    Makefile
Export complete.
$ svn export http://svn.osafoundation.org/chandler/trunk/chandler/site.py
A    site.py
Export complete.

Now, we’re ready to fetch all the dependencies we need, as follows (Note: the CHANDLERARCHIVES setting means that a downloads directory will be created, where the build process saves all the intermediate files it downloads):

$ make archives CHANDLERARCHIVES=downloads
(lots of output)
Adding epydoc 3.0beta1 to easy-install.pth file
Installed /Users/grant/sandbox/release/site-packages/epydoc-3.0beta1-py2.5.egg
Processing dependencies for epydoc>=3.0beta1
Finished processing dependencies for epydoc>=3.0beta1

With these dependencies in place, it’s time to check out the chandler2 sources. (I’m putting them inside the sandbox, but they can actually be anywhere on disk).

$ svn checkout http://svn.osafoundation.org/chandler2/trunk chandler2
A    chandler2/Chandler-Development
A    chandler2/Chandler-Development/chandler
A    chandler2/Chandler-App/Event-Interaction.txt
A    chandler2/Chandler-App/test_chex.py
 U   chandler2
Checked out revision 202.

NB: Subversion 1.6 workaround

There is an unfortunate bug in setuptools that will prevent the "install" step below from working with subversion 1.6, unless you use the following step. (Users of previous versions should not have a problem).

As far as I know, this will impact people running a recent cygwin, or people who have installed subversion themselves). You can check what version you have via

$ svn --version
svn, version 1.6.2 (r37639)
   compiled ...

The workaround:

 $ ./release/bin/python.exe -m setuptools --find-links http://builds.osafoundation.org/external/ -Z setuptools'>0.6c9,<0.7a0'
Searching for setuptools>0.6c9,<0.7a0
Best match: setuptools 0.6c10dev-r66750-20090528
Finished processing dependencies for setuptools>0.6c9,<0.7a0

And now, we install chandler2’s subprojects in development mode.

 $ cd chandler2

There is a slight difference here between Mac OS X 10.5 (Leopard) and other platforms:

  • Mac OS X 10.5:

$ make develop PYTHON=$HOME/sandbox/release/RunPython SETUP_OPTS="--install-dir=$HOME/sandbox/release/site-packages --script-dir=$HOME/sandbox/bin -Z"

  • Other platforms:

$ make develop PYTHON=$HOME/sandbox/release/RunPython SETUP_OPTS="--script-dir=$HOME/sandbox/bin -Z"

Finally, you should now be able to run the (fairly rudimentary) demo:

$ ~/sandbox/release/RunPython ~/sandbox/bin/chandler-demo

As above, you might want to load some sample data if you want to see any content in the collections.

-- GrantBaillie - 19 Mar 2009

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r7 < r6 < r5 < r4 < r3 | More topic actions
Open Source Applications Foundation
Except where otherwise noted, this site and its content are licensed by OSAF under an Creative Commons License, Attribution Only 3.0.
See list of page contributors for attributions.