Developers¶
Workflow¶
We are happy you like osBrain and we would love to receive contributions from you! Note that contributions do not necessarily need to include code: you can help telling us what problems you are having with osBrain or suggesting improvements to the documentation.
If you would like to help us with code, proceed to fork the project, make the changes you want and then submit a pull request to start a discussion. Take into account that we follow some rules for development:
- We like to follow style standards (i.e.: PEP8). But do not worry, our test suite will help you with that and tell you if you wrote something wrong.
- We like tests, so any new functionality should also include the corresponding tests.
- We like documentation, so changes in the code should also include changes in the code docstrings and changes in the user documentation if they affect how the user may use osBrain.
Installing dependencies¶
To install the required dependencies for developing osBrain, you can
make use of the provided requirements.txt
file:
pip install -r requirements.txt
Running the tests¶
Running the tests locally is very simple, first install Tox:
pip install tox
And run it from the top-level path of the project:
tox
That single command will run all the tests for all the supported Python versions available in your system or environment.
For faster results you may want to run all the tests just against a single Python version. This command will run all tests against Python 3.6 only:
tox -e py36
When running Tox, tests are actually executed with pytest
. Although
not recommended, you might want to directly use that tool for finer control:
pytest -n 8
If you just want to run a handful of behavior tests (common when developing new functionality), just run:
pytest -k keyword
Note
Before submitting your changes for review, make sure all tests pass
with tox
, as the continuous integration system will run all those checks
as well.
Generating documentation¶
Documentation is generated with Sphinx. In order to generate the documentation
locally you need to run make
from the docs
directory:
make html