Friday, January 25, 2008

Getting the current development snapshot of Mayavi

Hello world!

Mayavi is part of the Enthought Tool Suite (ETS). Enthought has reorganized its SVN repository in order to break up the various parts of ETS into smaller chunks with a very clear set of dependencies. This should make it easy for people to get parts of ETS rather than have to get it all as part of ETS (which is quite huge). Ideally users will install released versions of ETS using prebuilt eggs or native packages (debs or rpms). However, if one wants to get the bleeding edge from SVN things can get messy. This is because mayavi depends on several other ETS packages and manually getting the right versions of each package from SVN can be a huge pain. In order to make life easier in this regard Dave Peterson has created a package called ETSProjectTools that let a user/developer checkout a particular package from ETS along with all its dependencies as well. Let us pick mayavi as an example to demonstrate how this works.

Say you want to get the latest, greatest version of mayavi. The current version that you should look to get would be the up and coming ets-2.7.0b1 release. The release isn't out yet but will be soon. Here is how you get it:

  1. Get hold of ETSProjectTools like so:
    svn co ETSProjectTools
  2. Build and install it:
    cd ETSProjectTools
    python install
  3. This will give you several new scripts that will let us checkout the sources etc. etsco, etsup, etsdevelop etc. More information on these is here
  4. Now checkout ets==2.7.0b1 like so:
    etsco "ets==2.7.0b1"
  5. Be patient, the above will checkout all of the ETS-2.7.0b1 (that is yet to be released).
  6. Now get the egg_builder script (this should soon be part of ETSProjectTools but isn't yet) like so:
    cd ets_2.7.0b1
    svn cat >
  7. Build the eggs for ets-2.7.0b1 (the command will build the eggs and put them in a "dist" directory under the current directory):
  8. Now install mayavi:
    easy_install -f dist -H dist enthought.mayavi
This will install enthought.mayavi from the built eggs. If you want to keep tracking enthought.mayavi as it develops in SVN you may want to instead do:

cd enthought.mayavi_2.0.3a1
python develop -f ../dist -H ../dist

This will install all the dependencies for mayavi as eggs and make an egg-link for mayavi alone so you can keep track of it via SVN.

If you want to keep track of every package you could always do:

cd ets_2.7.0b1
etsdevelop .

This will do a develop in each and every subdirectory of ets_2.7.0b1.

Note that the ets* scripts only get the sources of other ETS packages and not everything else! Building ETS requires several other external packages like a compiler, swig, numpy, etc. For a complete list check the pages here:

The dependencies needed for Ubuntu Gutsy are listed in the ubuntu specific page for the last release (2.6.0b1).

As you can see, all the complexity of getting the ETS sources is made easy via etsco and the other scripts. In the future, as mayavi grows at its own pace, these tools will let us specify dependencies within ETS and thereby make it easier to cut new releases. This also makes it relatively easy to develop different branches that have entirely different dependencies.

Phew! That was a massive first blogspot post!

1 comment:

dmp1991 said...

Hi Prabhu,

Nice post! One comment or potential change worth noting is that soon the 'etsco' et al will be refactored to be more like svn itself in that the commands will be 'ets co', 'ets develop', 'ets build', etc.