diff --git a/.travis.yml b/.travis.yml index 72fa0ff..c589ada 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,19 +9,26 @@ python: sudo: required +jobs: + include: + - stage: unit-test + script: + - make install-tests-requirements + - make test + - 'bash <(curl -s https://codecov.io/bash)' + - stage: doc + script: + - make install-docs-requirements + - make docs + install: - sudo apt-get update - sudo apt-get install -y portaudio19-dev python-all-dev --no-install-recommends - sudo apt-get install -y lilv-utils calf-plugins guitarix --no-install-recommends - sudo apt-get install -y libavahi-compat-libdnssd1 --no-install-recommends - - pip3 install coveralls - pip3 install git+https://github.com/depl0y/pybonjour-python3 - pip3 install zeroconf - python3 setup.py develop script: - lv2ls - - coverage3 run --source=webservice wstest/config.py test - -after_success: - - 'bash <(curl -s https://codecov.io/bash)' diff --git a/README.rst b/README.rst index 776b06a..671c9fc 100644 --- a/README.rst +++ b/README.rst @@ -79,7 +79,7 @@ The registration must occur before application initialization (``application.sta application = Application(path_data="data/", address='localhost') from webservice.webservice import WebService - application.register(WebService(application, port)) + application.register(WebService(application, port=3000)) 2. Initialization of the web server +++++++++++++++++++++++++++++++++++ @@ -122,7 +122,7 @@ look like the following code: application = Application(path_data="data/", address='localhost') from webservice.webservice import WebService - application.register(WebService(application, port)) + application.register(WebService(application, port=3000)) application.start() @@ -163,17 +163,20 @@ Maintenance Documentation ************* +Is necessary to install `nodejs`_. + +.. _nodejs: https://nodejs.org/en/ + .. code-block:: bash # Installing dependencies - npm install -g aglio + make install-docs-requirements # Generate doc - cd docs/ - aglio -i documentation.apib --theme-variables streak --theme-template triple -o index.html + make docs # View documentation - firefox index.html + make docs-see Test **** @@ -185,5 +188,5 @@ Test coverage3 run --source=webservice wstest/config.py test coverage3 report - coverage3 html - firefox htmlcov/index.html + make test-details + diff --git a/makefile b/makefile new file mode 100644 index 0000000..e52e6f1 --- /dev/null +++ b/makefile @@ -0,0 +1,84 @@ +BROWSER=firefox +BOLD=\033[1m +NORMAL=\033[0m + +default: help + +clean: clean-pyc clean-test clean-build clean-docs + +clean-build: + rm -rf .eggs + rm -rf build + rm -rf dist + +clean-pyc: + find . -name '*.pyc' -exec rm --force {} + + find . -name '*.pyo' -exec rm --force {} + + +clean-test: + rm -rf .cache + rm -f .coverage + rm -rf htmlcov + rm -rf wstest/data + +clean-docs: + rm -f docs/index.html + +docs: clean-docs + cd docs && aglio -i documentation.apib --theme-variables streak --theme-template triple -o index.html + +docs-see: docs + $(BROWSER) docs/index.html + +install-docs-requirements: + npm install -g aglio + +install-tests-requirements: + pip3 install coveralls + # For midi tests - https://github.com/x42/midifilter.lv2 + #cd /tmp && git clone git://github.com/x42/midifilter.lv2.git && \ + #cd midifilter.lv2 && \ + #make && \ + #sudo make install PREFIX=/usr + +run: + @echo "Run option isn't created =)" + +test: clean-test + coverage3 run --source=webservice wstest/config.py test + +not-implemented-test-docs: + python -m doctest *.rst -v + python -m doctest docs/*/*.rst -v + +test-details: test + coverage3 html + $(BROWSER) htmlcov/index.html + +help: cabecalho + @echo "" + @echo "Commands" + @echo " $(BOLD)clean$(NORMAL)" + @echo " Clean files" + @echo " $(BOLD)docs$(NORMAL)" + @echo " Make the docs" + @echo " $(BOLD)docs-see$(NORMAL)" + @echo " Make the docs and open it in BROWSER" + @echo " $(BOLD)install-docs-requirements$(NORMAL)" + @echo " Install the docs requirements" + @echo " $(BOLD)install-tests-requirements$(NORMAL)" + @echo " Install the tests requirements" + @echo " $(BOLD)test$(NORMAL)" + @echo " Execute the tests" + @echo " $(BOLD)test-details$(NORMAL)" + @echo " Execute the tests and shows the result in BROWSER" + @echo " - BROWSER=firefox" + @echo " $(BOLD)help$(NORMAL)" + @echo " Show the valid commands" + +cabecalho: + @echo "$(BOLD) _ _ ____ ____ ____ ____ ____ _ _ __ ___ ____" + @echo "/ )( ( __| _ \/ ___| __| _ \/ )( ( ) __| __)" + @echo "\ /\ /) _) ) _ (\___ \) _) ) /\ \/ /)( (__ ) _) " + @echo "(_/\_|____|____/(____(____|__\_) \__/(__)___|____)" + @echo "Link$(NORMAL): https://pypi.org/project/PedalPi-WebService/" diff --git a/setup.py b/setup.py index dc54ea7..4697ce9 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ def readme(): install_requires=[ 'PedalPi-Application>=0.3.0', - 'tornado>=4.4.2', + 'tornado>=4.5.3', 'tornado-cors==0.6.0', 'zeroconf' ],