Mojo Hacking

If you want to hack on Mojo, get a copy of the source code with:

$ bzr branch lp:mojo

Then it can be installed with:

$ python setup.py install --user

against a branch of Mojo to install it into your $HOME/.local

You may need to check that $HOME/.local/bin is on your $PATH or add it:

$ PATH=$HOME/.local/bin:$PATH

An alternative method of installation is to install in development mode with:

$ python setup.py develop --user

which makes changes to the project source immediately available without having to install again.

Yet another method is to use virtualenv, so that multiple versions of mojo can be installed at the same time:

$ virtualenv --system-site-packages env
$ source env/bin/activate
$ pip install -r requirements.txt
$ python setup.py develop

Requirements

You'll need a few python packages installed in order to install Mojo.

$ sudo apt-get install python-setuptools python-apt

Codetree

You can install codetree in a similar way after grabbing lp:codetree.

$ bzr branch lp:codetree
$ cd codetree
$ python setup.py install --user

Testing

For running the test suite you will need python-nose and python-coverage and python-flake8 for the lint tests.

Tips

See the README's FAQ for further tips/gotchas.

It helps to have the sudoers file installed to reduce the number of times your sudo password is asked for.

$ sudo useradd -r -m mojo
$ sudo install -o root -g root -m 0440 contrib/99-mojo-sudoers /etc/sudoers.d
$ sudo usermod -aG mojo $USER

Build

To build an updated version of the mojo package:

  1. Ensure the name of the directory you're using is "mojo" (debian packaging will look for this).
  2. Increment the version in ./setup.py.
  3. make deb-src. If you need to rerun for some reason (missing dependencies, etc.), just re-run debuild -S -sa -I.bzr from the debian directory, as make deb will update the changelog again.
  4. Upload the .changes file from a directory level above the Makefile dput ppa:$MY-PPA/ppa mojo$versionsource.changes
  5. Commit setup.py and debian/changlog.