Commit 0b689d6f authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[doc][contribute] Improve coding instructions

parent f8d27525
......@@ -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
......@@ -19,4 +19,10 @@
.. _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
.. _BEAT documentation: https://www.idiap.ch/software/beat/documentation
\ No newline at end of file
.. _BEAT documentation: https://www.idiap.ch/software/beat/documentation
.. _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/
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment