This file explains how to contribute work to this project.
- Install Git.
- Install Python 2.7. It's strongly recommended to use virtualenv to manage your Python environments, to prevent different Python projects on your machine from interfering with each other (because they use different versions of Python or different versions of the same library).
- Install the required packages, e.g. Mockito, by running
pip install -r requirements.txt
from the project directory.
- Create a GitHub account if you don't already have one.
- Create your own fork of the lwotai project.
- Clone your fork onto your development machine.
This section provides guidance about how to structure and format the code.
In general, try to adhere to the industry-standard PEP 8 style. This will make it easy for experienced Python developers to understand the code.
- Write unit tests for the code you are adding or changing. This allows other developers to refactor the code without fear of breaking it.
- Where code seems untestable (e.g. it selects a country at random), refactor that code to remove the randomness, e.g. change the method to accept a mock randomizer whose behaviour you can control.
- Use Mockito as the mocking library. This should be on your machine if you've
done a
pip install
as described above.
When your change is done, e.g. fully covered by unit tests and properly formatted, create a pull request on GitHub. Mike (the project owner) will review your change and merge it into his fork if he's happy with it.