Developer Documentation

Development Workflow

  • Fork from github
  • Develop on your fork
  • Test locally
  • Make a pull request

Before making a pull request, make sure that your fork is up to date and that all the tests pass locally. This will make it less likely that your pull request will get rejected by making breaking chages or by failing the test requirements.

Running the tests

The tests require that you have cloned the repository, since the test code is not distributed in the package. It is recommended to use nosetests for this. There are two options:

Use the provided Makefile to run the tests using make:

$ git clone https://github.com/BlueBrain/NeuroM.git
$ cd NeuroM
$ make test

This runs pep8, pylint and the unit tests in sequence.

This method takes care of installing all extra dependencies needed for running the tests, diagnosing the results, performing linting on the source code. These dependencies are installed into a virtuanelv named neurom_test_venv:

The Makefile also has targets for running only pylint and pep8 individually:

$ make lint       # runs pep8 and pylint if that succeeds
$ make run_pep8   # run only pep8
$ make run_pylint # run only pep8

Note that you can also install the test dependencies and run the tests inside of your own virtualenv:

(nrm)$ pip install -r requirements_dev.txt

This installs the following packages into your virtualenv unless they are already installed:

enum34>=1.0.4
mock>=1.3.0
pep8>=1.6.0
astroid>=1.3,<1.4
pylint>=1.4.0,<1.5
nose>=1.3.0
coverage==3.7
nosexcover>=1.0.8

Then, run the tests manually in the virtualenv. For example,

(nrm)$ nosetests -v --with-coverage --cover-min-percentage=100 --cover-package neurom

Warning

To ensure that the test requirements are the same as those run in continuous integration, you should run the tests using the make test command. This is the same command used in continuous integration. Failure to pass means will result in a pull request being rejected.

Building the Documentation

The documentation requires that you clone the repository. Once you have done that, there’s a make target to build the HTML version of the documentation:

$ git clone https://github.com/BlueBrain/NeuroM.git
....
$ cd NeuroM # repository location
$ make doc

This builds the documentation in doc/build. To view it, point a browser at doc/build/html/index.html

Python compatibility

We test the code against Python 2.6, 2.7, 3.5.