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 From ef85943e06a1ac0083d8a7c76a08e885f2e27d90 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 12 Dec 2019 12:10:32 +0100 Subject: Makefile: add documentation build targets docs & docs-live BTW: - add build & dist folder to .gitignore - justify indentation of build messages (makefile.python) Signed-off-by: Markus Heiser --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 77ffe489f..dae8fce31 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,20 @@ # -*- coding: utf-8; mode: makefile-gmake -*- PYOBJECTS = searx +DOC = docs PY_SETUP_EXTRAS ?= \[test\] include utils/makefile.include include utils/makefile.python +include utils/makefile.sphinx all: clean install PHONY += help help: @echo ' test - run developer tests' + @echo ' docs - build documentation' + @echo ' docs-live - autobuild HTML documentation while editing' @echo ' run - run developer instance' @echo ' install - developer install (./local)' @echo ' uninstall - uninstall (./local)' @@ -40,6 +44,18 @@ run: pyenvinstall ) & $(PY_ENV)/bin/python ./searx/webapp.py +# docs +# ---- + +PHONY += docs +docs: pyenvinstall sphinx-doc + $(call cmd,sphinx,html,docs,docs) + +PHONY += docs-live +docs-live: pyenvinstall sphinx-live + $(call cmd,sphinx_autobuild,html,docs,docs) + + # test # ---- -- cgit v1.2.3 From af2cae6d1d71859e867a9fbc5da604ef6a898794 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 4 Dec 2019 16:48:36 +0100 Subject: doc: make use of sphinx.ext.extlinks & sphinx.ext.intersphinx - add sphinx extensions - patch documentation to make use of These modules help to simplify the reST markup of external references. BTW it helps to write more readable reST and form custom brands. Signed-off-by: Markus Heiser --- Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index dae8fce31..b4eb14ba7 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ # -*- coding: utf-8; mode: makefile-gmake -*- +export GIT_URL=https://github.com/asciimoo/searx +export SEARX_URL=https://searx.me + PYOBJECTS = searx DOC = docs PY_SETUP_EXTRAS ?= \[test\] -- cgit v1.2.3 From 0011890043a65b318a32134ab4029f3c74bc07ee Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 12 Dec 2019 14:15:41 +0100 Subject: gh-pages - build docs & deploy on gh-pages branch Signed-off-by: Markus Heiser --- Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b4eb14ba7..28b7c58ce 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ help: @echo ' run - run developer instance' @echo ' install - developer install (./local)' @echo ' uninstall - uninstall (./local)' + @echo ' gh-pages - build docs & deploy on gh-pages branch' @echo '' @$(MAKE) -s -f utils/makefile.include make-help @echo '' -- cgit v1.2.3 From 121f6964602d7717185df12c9ecd69387aad1d2d Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Fri, 13 Dec 2019 12:58:46 +0100 Subject: Makefile: gh-pages: keep history of gh-branch intact (don't drop) Signed-off-by: Markus Heiser --- Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 28b7c58ce..cf5e5e636 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ export GIT_URL=https://github.com/asciimoo/searx export SEARX_URL=https://searx.me +export DOCS_URL=https://asciimoo.github.io/searx/ PYOBJECTS = searx DOC = docs @@ -59,6 +60,8 @@ PHONY += docs-live docs-live: pyenvinstall sphinx-live $(call cmd,sphinx_autobuild,html,docs,docs) +$(GH_PAGES):: + @echo "doc available at --> $(DOCS_URL)" # test # ---- -- cgit v1.2.3 From 02d5173fb23dfcba02634e2765bf7fd91e3d0437 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Fri, 13 Dec 2019 16:08:34 +0100 Subject: Makefile: remove trailing '/' from DOCS_URL Signed-off-by: Markus Heiser --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index cf5e5e636..b69202ba2 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ export GIT_URL=https://github.com/asciimoo/searx export SEARX_URL=https://searx.me -export DOCS_URL=https://asciimoo.github.io/searx/ +export DOCS_URL=https://asciimoo.github.io/searx PYOBJECTS = searx DOC = docs -- cgit v1.2.3