From b55a8004ed4c3d11d0d820480eca4769665ef38b Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 28 Nov 2019 19:54:57 +0100 Subject: boilerplate: add inital Makefile with run & install targets Add *Makefile* boilerplate useful for python projects. All python tasks are using a virtualenv from ./local/py3 $ make help run - run developer instance install - developer install (./local) uninstall - uninstall (./local) Signed-off-by: Markus Heiser --- Makefile | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..42e492d0d --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +# -*- coding: utf-8; mode: makefile-gmake -*- + +PYOBJECTS = searx +PY_SETUP_EXTRAS ?= \[test\] + +include utils/makefile.include +include utils/makefile.python + +all: clean install + +PHONY += help +help: + @echo ' run - run developer instance' + @echo ' install - developer install (./local)' + @echo ' uninstall - uninstall (./local)' + @echo '' + @$(MAKE) -s -f utils/makefile.include make-help + @echo '' + @$(MAKE) -s -f utils/makefile.python python-help + +PHONY += install +install: pyenvinstall + +PHONY += uninstall +uninstall: pyenvuninstall + +PHONY += clean +clean: pyclean + $(call cmd,common_clean) + +PHONY += run +run: pyenvinstall + $(Q) ( \ + sed -i -e "s/debug : False/debug : True/g" ./searx/settings.yml ; \ + sleep 2 ; \ + xdg-open http://127.0.0.1:8888/ ; \ + sleep 3 ; \ + sed -i -e "s/debug : True/debug : False/g" ./searx/settings.yml ; \ + ) & + $(PY_ENV)/bin/python ./searx/webapp.py + +.PHONY: $(PHONY) -- cgit v1.2.3 From 7e572a2453d18bdb3f44b65cbc1441004c4faa5f Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 28 Nov 2019 20:05:29 +0100 Subject: Makefile: add test.pep8 test.unit test.robot (from manage.sh) Signed-off-by: Markus Heiser --- Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 42e492d0d..604cdb8ac 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ all: clean install PHONY += help help: + @echo ' test - run developer tests' @echo ' run - run developer instance' @echo ' install - developer install (./local)' @echo ' uninstall - uninstall (./local)' @@ -39,4 +40,21 @@ run: pyenvinstall ) & $(PY_ENV)/bin/python ./searx/webapp.py +# test +# ---- + +PHONY += test test.pep8 test.unit test.robot + +test: test.pep8 test.unit test.robot + +test.pep8: pyenvinstall + $(PY_ENV_ACT); ./manage.sh pep8_check + +test.unit: pyenvinstall + $(PY_ENV_ACT); ./manage.sh unit_tests + +test.robot: pyenvinstall + $(PY_ENV_ACT); ./manage.sh install_geckodriver + $(PY_ENV_ACT); ./manage.sh robot_tests + .PHONY: $(PHONY) -- cgit v1.2.3 From 796197db2d135fe3342e4355aeb57a74dfa6beca Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 28 Nov 2019 20:07:10 +0100 Subject: boilerplate: add pylint / WIP: balance linting with pylint Signed-off-by: Markus Heiser --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 604cdb8ac..77ffe489f 100644 --- a/Makefile +++ b/Makefile @@ -43,9 +43,11 @@ run: pyenvinstall # test # ---- -PHONY += test test.pep8 test.unit test.robot +PHONY += test test.pylint test.pep8 test.unit test.robot +# TODO: balance linting with pylint test: test.pep8 test.unit test.robot + - make pylint test.pep8: pyenvinstall $(PY_ENV_ACT); ./manage.sh pep8_check -- cgit v1.2.3