- Thou shalt not break the build.
- Thou shalt not break the tests.
- Thou shalt write tests for new functionality.
- Thou shalt rebase onto ``develop`` instead of merging.
- Don't reduce test coverage, ideally improve it.
- Add doc comments if your code is to be used by client code.
Thou shalt receive cookies for your welcomed contribution.
Set up a virtual environment
$ python3 -m venv .venv $ .venv/bin/activate
Install package in editable mode with dependencies
$ pip install ".[test,docs]" -e .
Run unit tests
$ make test # run under current python version $ pip install tox pyenv tox-pyenv # Install pyenv tox to run under all python versions $ git clone https://github.com/momo-lab/xxenv-latest.git "$(pyenv root)"/plugins/xxenv-latest $ for v in 2.7 3.4 3.5 3.6 3.7; do pyenv la test install "$v"; done $ pyenv versions --base > .python-version $ make test-all # run under tox for all supported python versions
Run integration tests (on Raspberry Pi)
$ make test-integration
Build docs
$ make doc $ make doc-serve # run HTTP server to view docs
Run examples
$ cd examples $ PYTHONPATH=.. python3 video_file.py $ PYTHONPATH=.. python3 advanced_usage.py
There's also an Ansible playbook in devenv
which will set up a
raspberry pi with omxplayer-wrapper
in develop mode (located at
/usr/src/omxplayer-wrapper
) which can be used by running
./devenv/deploy.sh
This will install via symlinks so that you can continue to work on it locally but import it from other python packages