Developer Guide

Setup Development Environment

  1. Install pip and tox:

    sudo apt-get install python-pip
    sudo pip install tox
    
  2. Configure git pre-commit hook:

    sudo pip install flake8 pep8-naming
    flake8 --install-hook
    git config flake8.strict true
    
  3. Configure your environment to run without root:

    sudo groupadd topology
    sudo usermod -a -G topology $USER
    sudo sh -c 'echo "%topology ALL = (root) NOPASSWD: /sbin/ip, /bin/mkdir -p /var/run/netns, /bin/rm /var/run/netns/*, /bin/ln -s /proc/*/ns/net /var/run/netns/*" > /etc/sudoers.d/topology'
    

    Now logout and login again. Confirm your you’re in the topology group with:

    $ id
    ...,1001(topology)
    
  4. Download and install Docker:

    wget -qO- https://get.docker.com/ | sh
    

Building Documentation

tox -e doc

Output will be available at .tox/doc/tmp/html. It is recommended to install the webdev package:

sudo pip install webdev

So a development web server can serve any location like this:

$ webdev .tox/doc/tmp/html

Running Test Suite

tox -e py27,py34