1# -*- coding: utf-8; mode: makefile-gmake -*-
4include utils/makefile.include
8PY_SETUP_EXTRAS ?= \[test\]
9PYLINT_SEARX_DISABLE_OPTION := I,C,R,W0105,W0212,W0511,W0603,W0613,W0621,W0702,W0703,W1401,E1136
10PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES := supported_languages,language_aliases
12include utils/makefile.python
13include utils/makefile.sphinx
17PHONY += help-min help-all help
21 @echo 'to get more help: make help-all'
24 @echo ' test - run developer tests'
25 @echo ' docs - build documentation'
26 @echo ' docs-live - autobuild HTML documentation while editing'
27 @echo ' run - run developer instance'
28 @echo ' install - developer install (./local)'
29 @echo ' uninstall - uninstall (./local)'
30 @echo ' gh-pages - build docs & deploy on gh-pages branch'
31 @echo ' clean - drop builds and environments'
32 @echo ' project - re-build generic files of the searx project'
33 @echo ' buildenv - re-build environment files (aka brand)'
34 @echo ' themes - re-build build the source of the themes'
35 @echo ' docker - build Docker image'
36 @echo ' node.env - download & install npm dependencies locally'
38 @$(MAKE) -e -s make-help
42 @$(MAKE) -e -s python-help
44 @$(MAKE) -e -s docs-help
47install: buildenv pyenvinstall
50uninstall: pyenvuninstall
53clean: pyclean docs-clean node.clean test.clean
54 $(call cmd,common_clean)
57run: buildenv pyenvinstall
60 xdg-open http://127.0.0.1:8888/ ; \
62 SEARX_DEBUG=1 $(PY_ENV)/bin/python ./searx/webapp.py
67sphinx-doc-prebuilds:: buildenv pyenvinstall prebuild-includes
70docs: sphinx-doc-prebuilds
71 $(call cmd,sphinx,html,docs,docs)
74docs-live: sphinx-doc-prebuilds
75 $(call cmd,sphinx_autobuild,html,docs,docs)
77PHONY += prebuild-includes
79 $(Q)mkdir -p $(DOCS_BUILD)/includes
80 $(Q)./utils/searx.sh doc | cat > $(DOCS_BUILD)/includes/searx.rst
81 $(Q)./utils/filtron.sh doc | cat > $(DOCS_BUILD)/includes/filtron.rst
82 $(Q)./utils/morty.sh doc | cat > $(DOCS_BUILD)/includes/morty.rst
86 @echo "doc available at --> $(DOCS_URL)"
91PHONY += project engines.languages useragents.update buildenv
93project: buildenv useragents.update engines.languages
95engines.languages: pyenvinstall
96 $(Q)echo "fetch languages .."
97 $(Q)$(PY_ENV_ACT); python ./searx_extra/update/update_languages.py
98 $(Q)echo "updated searx/data/engines_languages.json"
99 $(Q)echo "updated searx/languages.py"
101useragents.update: pyenvinstall
102 $(Q)echo "fetch useragents .."
103 $(Q)$(PY_ENV_ACT); python ./searx_extra/update/update_firefox_version.py
104 $(Q)echo "updated searx/data/useragents.json with the most recent versions of Firefox."
107 $(Q)$(PY_ENV_ACT); SEARX_DEBUG=1 python utils/build_env.py
113 $(Q)./manage.sh npm_packages
116 $(Q)echo "CLEAN locally installed npm dependencies"
119 ./package-lock.json \
120 ./searx/static/themes/oscar/package-lock.json \
121 ./searx/static/themes/oscar/node_modules \
122 ./searx/static/themes/simple/package-lock.json \
123 ./searx/static/themes/simple/node_modules
128PHONY += themes themes.oscar themes.simple
129themes: buildenv themes.oscar themes.simple
131quiet_cmd_lessc = LESSC $3
132 cmd_lessc = PATH="$$(npm bin):$$PATH" \
133 lessc --clean-css="--s1 --advanced --compatibility=ie9" "searx/static/$2" "searx/static/$3"
135quiet_cmd_grunt = GRUNT $2
136 cmd_grunt = PATH="$$(npm bin):$$PATH" \
137 grunt --gruntfile "$2"
139themes.oscar: node.env
140 $(Q)echo '[!] build oscar theme'
141 $(call cmd,grunt,searx/static/themes/oscar/gruntfile.js)
143themes.simple: node.env
144 $(Q)echo '[!] build simple theme'
145 $(call cmd,grunt,searx/static/themes/simple/gruntfile.js)
153 $(Q)./manage.sh docker_build
156 $(Q)./manage.sh docker_build push
163 $(PY_ENV_ACT); ./manage.sh install_geckodriver
168search.checker: pyenvinstall
169 $(Q)$(PY_ENV_ACT); searx-checker -v
171ENGINE_TARGETS=$(patsubst searx/engines/%.py,search.checker.%,$(wildcard searx/engines/[!_]*.py))
173$(ENGINE_TARGETS): pyenvinstall
174 $(Q)$(PY_ENV_ACT); searx-checker -v "$(subst _, ,$(patsubst search.checker.%,%,$@))"
180PHONY += test test.sh test.pylint test.pep8 test.unit test.coverage test.robot
181test: buildenv test.pylint test.pep8 test.unit gecko.driver test.robot
184 searx/preferences.py \
186 searx/engines/gigablast.py \
187 searx/engines/deviantart.py \
188 searx/engines/digg.py \
189 searx/engines/google.py \
190 searx/engines/google_news.py \
191 searx/engines/google_videos.py \
192 searx/engines/google_images.py \
193 searx/engines/mediathekviewweb.py \
194 searx/engines/solidtorrents.py \
195 searx/engines/solr.py \
196 searx/engines/google_scholar.py \
197 searx/engines/yahoo_news.py \
198 searx/engines/apkmirror.py \
199 searx_extra/update/update_external_bangs.py
201test.pylint: pyenvinstall
202 $(call cmd,pylint,$(PYLINT_FILES))
204 --disable=$(PYLINT_SEARX_DISABLE_OPTION) \
205 --additional-builtins=$(PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES) \
209 --disable=$(PYLINT_SEARX_DISABLE_OPTION) \
210 --ignore=searx/engines \
215# E402 module level import not at top of file
216# W503 line break before binary operator
218# ubu1604: uses shellcheck v0.3.7 (from 04/2015), no longer supported!
220 shellcheck -x -s bash utils/brand.env
221 shellcheck -x utils/lib.sh
222 shellcheck -x utils/filtron.sh
223 shellcheck -x utils/searx.sh
224 shellcheck -x utils/morty.sh
225 shellcheck -x utils/lxc.sh
226 shellcheck -x utils/lxc-searx.env
227 shellcheck -x .config.sh
229test.pep8: pyenvinstall
230 @echo "TEST pycodestyle (formerly pep8)"
231 $(Q)$(PY_ENV_ACT); pycodestyle --exclude='searx/static, searx/languages.py, $(foreach f,$(PYLINT_FILES),$(f),)' \
232 --max-line-length=120 --ignore "E117,E252,E402,E722,E741,W503,W504,W605" searx tests
234test.unit: pyenvinstall
235 @echo "TEST tests/unit"
236 $(Q)$(PY_ENV_ACT); python -m nose2 -s tests/unit
238test.coverage: pyenvinstall
239 @echo "TEST unit test coverage"
241 python -m nose2 -C --log-capture --with-coverage --coverage searx -s tests/unit \
245test.robot: pyenvinstall gecko.driver
247 $(Q)$(PY_ENV_ACT); PYTHONPATH=. python searx/testing.py robot
250 @echo "CLEAN intermediate test stuff"
251 $(Q)rm -rf geckodriver.log .coverage coverage/
259 $(PY_ENV_BIN)/python -c "import yaml" || make clean
263 $(Q)$(PY_ENV_BIN)/python -m pip install codecov
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list