Development¶
Development requirement¶
Optimus is developed with:
- Test Development Driven (TDD) using Pytest;
- Respecting flake and pip8 rules using Flake8;
- Sphinx for documentation with enabled Napoleon extension (using only the Google style);
Every requirement is available in file requirements/dev.txt
.
Install for development¶
First ensure you have pip and python-venv
package installed then type:
git clone https://github.com/sveetch/Optimus.git
cd optimus
make install-dev
Optimus will be installed in editable mode from the last commit on master branch.
When it’s done, you will be able to check for optimus version, just type:
venv/bin/optimus version
Unittests¶
Unittests are made to works on Pytest, a shortcut in Makefile is available to start them on your current development install:
make tests
Tox¶
To ease development against multiple Python versions a tox configuration has been added. You are strongly encouraged to use it to test your pull requests.
Before using it you will need to install tox, it is recommended to install it at your system level (tox dependancy is not in tests requirements file):
sudo pip install tox
Then go in the optimus
module directory, where the setup.py
and tox.ini
live and execute tox:
tox
Documentation¶
sphinx-autobuild is installed for a watcher which automatically rebuild HTML documentation when you change sources.
When environnement is activated, you can use following command from docs/
directory:
make livehtml
And go on http://127.0.0.1:8002/
.