diff --git a/doc/contribute.rst b/doc/contribute.rst index 1ae9cd262e7f0c9a383d7c2c672c1132daccf9c9..60cc1cbb5b9363f373c6b9d426fa6fd373b6cf74 100644 --- a/doc/contribute.rst +++ b/doc/contribute.rst @@ -74,6 +74,58 @@ If you would like to install them all using pip you can call: :: $ pip install -r pre-commit-dependencies.txt +Development +=========== + +Writing code +------------ + +beat.editor is a python application or rather Qt Python application. It will use +the `QtWidgets`_ module for the GUI part. + +The current implementation will use `PyQt`_ as `Qt for Python`_ is not yet +available on conda. + +While the code is written in Python the API is mostly the same as the C++ +framework minus some pythonism that can be found in the `PyQt documentation`_. + + +Writing tests +------------- + +beat.editor uses pytest as its testing framework because of the `pytest-qt`_ +module that provides support for testing Qt based application. + +An example of tests is shown here: + +.. literalinclude:: ../beat/editor/test/test_editors.py + + +Tests can fall in to categories: + +- Automatic tests +- Manual tests + +Automatic tests are tests that can be fully automated using pytest and pytest-qt +while manual tests are tests than requires that a person takes a look at the +output of said test. For example check that the rendering of some GUI element is +the expected output. This kind of test may require writing a minimal application +that will be as automated as possible in order for the operator to only have to +do the manual check(s) required. + + +Run tests +--------- + +beat.editor uses pytest to run its test suite. :: + + $ pytest -sv + +Will run all the tests verbosely and not capture the outputs of the test. The +`-s` option is mandatory if there's a need to brake in the code using python's +debugger. + + Coding guidelines ================= @@ -190,3 +242,5 @@ Merge message Merge messages should again be meaningful and concise about the what and the why. + +.. include:: links.rst diff --git a/doc/links.rst b/doc/links.rst index f24c9515e60c74e1c6d6125d035e8b7801a15f70..8bf7c48db4c5dda2574e08592124bc27b0b5bc44 100644 --- a/doc/links.rst +++ b/doc/links.rst @@ -19,4 +19,11 @@ .. _beat editor: https://www.idiap.ch/software/beat/docs/beat/docs/new/beat.editor/doc/index.html .. _bob: https://www.idiap.ch/software/bob/docs/bob/docs/stable/bob/doc/index.html .. _idiap: http://www.idiap.ch -.. _eigenface: https://en.wikipedia.org/wiki/Eigenface \ No newline at end of file +.. _eigenface: https://en.wikipedia.org/wiki/Eigenface + +.. _Qt: http://doc.qt.io/qt-5/ +.. _QtWidgets: http://doc.qt.io/qt-5/qtwidgets-index.html +.. _Qt for python: https://www.qt.io/qt-for-python +.. _PyQt: https://www.riverbankcomputing.com/software/pyqt/intro +.. _PyQt documentation: http://pyqt.sourceforge.net/Docs/PyQt5/index.html +.. _pytest-qt: https://pytest-qt.readthedocs.io/en/latest/