Development Guide

If you would like to write a patch for Greenwave, this document will help you get started.

Development setup

Install development dependencies:

$ poetry install --no-root

Create a local configuration file:

$ cp conf/settings.py.example conf/settings.py

Run the server:

$ DEV=true poetry run python3 run-dev-server.py

The server is now running at <http://localhost:5005> and API calls can be sent to <http://localhost:5005/api/v1.0>.

Running the tests

Run tests using tox command.

To run only specific tests:

$ tox -e py39 -- --no-cov -k test_waive_scenario

Functional Tests

Functional tests extend the basic unit test suite and additionally verify proper communication with WaiverDB, ResultsDB and message bus.

For local development, you may want to easily bring up containers of WaiverDB, ResultsDB, and/or Greenwave. For more information on that, see:

Building the documentation

The documentation is built using Sphinx. If you’ve made changes to the documentation, you can build it locally and view it in your browser:

$ tox -e docs
$ open docs/_build/html/index.html

Code style

We follow the PEP 8 style guide for Python. You can check your code’s style using flake8:

$ tox -e flake8

Additionally, we follow the “Google style” for docstrings.