Skip to content

Getting started with nammu for developers

Mosè Giordano edited this page May 8, 2019 · 6 revisions

Requirements and installation

nammu is written mainly in Jython, an implementation of Python that runs on Java.

Currently, nammu requires

  • Python 2.7
  • Java Runtime Environment 8
  • Jython 2.7.0
  • a few Python packages listed in the requirements.txt file

Check if you can install Java RE 8 with your system's package manager, otherwise it can be downloaded here: https://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html.

Also for Jython check if you can install version 2.7.0 with your system's package manager, otherwise you can download it from here: https://www.jython.org/downloads.html. Note: nammu is tested only with Jython 2.7.0, if your package manager provides Jython 2.7.1 (especially on some GNU/Linux distributions), but this will likely not work.

Python 2.7 is probably already installed in your system, but make sure it's the case. We'll describe in the next section how to install the Python packages used by nammu

Setting up the development environment

We recommend using Python's virtual environments for development. One possibility is to use virtualenv. After having installed it, add the following lines to your shell's init script (e.g., .bashrc for the Bash):

export JYTHONPATH="/path/to/nammu/resources/lib:$JYTHONPATH"
export WORKON_HOME=~/.virtualenvs
source /usr/bin/virtualenvwrapper.sh

The environment variable WORKON_HOME should point to a directory of your choice where the environments will be saved to (note that you have to create it). The second line loads some shell functions to conveniently work with virtual environments. Double check the path to the virtualenvwrapper.sh is correct.

Open a new shell or source your shell's init script to make sure the settings above take effect. You can now create a virtual environment with the command

$ mkvirtualenv -p jython nammu

The -p option is to select jython as the Python interpreter. After creating the environment, activate it (if it wasn't activated automatically) with the command

$ workon nammu

and install the required Python packages with

$ pip install -r requirements.txt

If everything went well, you should be able to run Nammu from a console

Clone this wiki locally