Developers

This is an instruction of the developer tools that help you contribute.

Running tests

Tests can be run by using

tox -e tests

You can source the test environment of tox after a run using

source .tox/tests/bin/activate

Converting notebook test files

We store the notebooks as converted Python file using jupytext for better versioning

jupytext tests/notebooks/*.py --to ipynb

Be aware that when running the tests with tox all *.ipynb are overwritten by the corresponding *.py files. For example, the file test_widget_cue_box.ipynb is overwritten by the conversion of test_widget_cue_box.py when running the test.

Running in browser

We use selenium to test the widgets on user actions (like a button click). To run it in the CI where no display is available. We run the browsers in the headless mode to not load the UI. For debugging a test, however, it is often beneficial to see what is happening in the window. To run the tests with the browser UI, please use

pytest --driver Firefox

Port issues

For the notebook server, we fixed the port to 8815. If this port is not available, you you need to choose a different one. It can happen that notebook process is not properly killed and remains as zombie process. You can check if a notebook with the 8815 port is already running using

jupyter notebook list | grep 8815

or if some other process is using it

netstat -l | grep 8815

Formatting code

Your code can be formatted using

tox -e format

The formatting should fix most issues with linting, but sometimes you need to manually fix some issues. To run the linter use

tox -e lint

Building documentation

To build the docs please use

tox -e docs

To open the documentation with Firefox, for example, you can run:

firefox docs/build/html/index.html