From 1ee19ea640373a7ea63c265be58134a0d2090d52 Mon Sep 17 00:00:00 2001 From: SrMouraSilva Date: Sat, 17 Feb 2018 17:33:24 -0300 Subject: [PATCH 1/4] #45 Create makefile --- .travis.yml | 9 ++++++ README.rst | 19 ++++++------ makefile | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 2 +- 4 files changed, 104 insertions(+), 9 deletions(-) create mode 100644 makefile diff --git a/.travis.yml b/.travis.yml index 72fa0ff..11d0ab9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,15 @@ python: sudo: required +jobs: + include: + - stage: unit-test + script: make test + - stage: doc + script: make install-docs-requirements + - stage: deploy + script: ./deploy + install: - sudo apt-get update - sudo apt-get install -y portaudio19-dev python-all-dev --no-install-recommends 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..ef9052d --- /dev/null +++ b/makefile @@ -0,0 +1,83 @@ +BROWSER=firefox +BOLD=\033[1m +NORMAL=\033[0m + +default: help + +FIXME clean: clean-pyc clean-test clean-build clean-docs + +FIXME clean-build: + rm -rf .eggs + rm -rf build + rm -rf dist + +FIXME clean-pyc: + find . -name '*.pyc' -exec rm --force {} + + find . -name '*.pyo' -exec rm --force {} + + +FIXME 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 + +FIXME install-tests-requirements: + # 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 + +FIXME 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' ], From 79bcee80370c9f0d1418992d75ab3444706cb26b Mon Sep 17 00:00:00 2001 From: SrMouraSilva Date: Sat, 17 Feb 2018 17:36:46 -0300 Subject: [PATCH 2/4] #45 Test stage multiple requirements --- .travis.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 11d0ab9..d5a46c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,19 +14,9 @@ jobs: - stage: unit-test script: make test - stage: doc - script: make install-docs-requirements - - stage: deploy - script: ./deploy - -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: + - make install-docs-requirements + - make test script: - lv2ls From ea7ce80dfb6ec2f04dbc47efaeb597733712b7e6 Mon Sep 17 00:00:00 2001 From: SrMouraSilva Date: Sat, 17 Feb 2018 17:39:42 -0300 Subject: [PATCH 3/4] #45 Test stage multiple requirements --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d5a46c8..357b6a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,5 @@ jobs: - make install-docs-requirements - make test -script: - - lv2ls - - coverage3 run --source=webservice wstest/config.py test - after_success: - 'bash <(curl -s https://codecov.io/bash)' From 4b1c127d0076200e942efe277efe373bc1dffd9e Mon Sep 17 00:00:00 2001 From: SrMouraSilva Date: Sat, 17 Feb 2018 17:50:20 -0300 Subject: [PATCH 4/4] #45 Makefile --- .travis.yml | 20 ++++++++++++++++---- makefile | 21 +++++++++++---------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 357b6a8..c589ada 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,11 +12,23 @@ sudo: required jobs: include: - stage: unit-test - script: make test + script: + - make install-tests-requirements + - make test + - 'bash <(curl -s https://codecov.io/bash)' - stage: doc script: - make install-docs-requirements - - make test + - 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 git+https://github.com/depl0y/pybonjour-python3 + - pip3 install zeroconf + - python3 setup.py develop -after_success: - - 'bash <(curl -s https://codecov.io/bash)' +script: + - lv2ls diff --git a/makefile b/makefile index ef9052d..e52e6f1 100644 --- a/makefile +++ b/makefile @@ -4,18 +4,18 @@ NORMAL=\033[0m default: help -FIXME clean: clean-pyc clean-test clean-build clean-docs +clean: clean-pyc clean-test clean-build clean-docs -FIXME clean-build: +clean-build: rm -rf .eggs rm -rf build rm -rf dist -FIXME clean-pyc: +clean-pyc: find . -name '*.pyc' -exec rm --force {} + find . -name '*.pyo' -exec rm --force {} + -FIXME clean-test: +clean-test: rm -rf .cache rm -f .coverage rm -rf htmlcov @@ -33,12 +33,13 @@ docs-see: docs install-docs-requirements: npm install -g aglio -FIXME install-tests-requirements: +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 + #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 =)" @@ -46,7 +47,7 @@ run: test: clean-test coverage3 run --source=webservice wstest/config.py test -FIXME test-docs: +not-implemented-test-docs: python -m doctest *.rst -v python -m doctest docs/*/*.rst -v