@@ -0,0 +1,217 @@
7+.. sidebar:: build environment
9+ Before looking deeper at the targets, first read about :ref:`makefile setup`
10+ and :ref:`make pyenv`.
12+With the aim to simplify development cycles, started with :pull:`1756` a
13+``Makefile`` based boilerplate was added.
15+The usage is simple, just type ``make {target-name}`` to *build* a target.
16+Calling the ``help`` target gives a first overview::
19+ test - run developer tests
20+ docs - build documentation
21+ docs-live - autobuild HTML documentation while editing
22+ run - run developer instance
23+ install - developer install (./local)
24+ uninstall - uninstall (./local)
25+ gh-pages - build docs & deploy on gh-pages branch
26+ clean - drop builds and environments
29+.. contents:: Contents
40+.. _git stash: https://git-scm.com/docs/git-stash
42+The main setup is done in the :origin:`Makefile`::
44+ export GIT_URL=https://github.com/asciimoo/searx
45+ export SEARX_URL=https://searx.me
46+ export DOCS_URL=https://asciimoo.github.io/searx
48+.. sidebar:: fork & upstream
50+ Commit changes in your (local) branch, fork or whatever, but do not push them
51+ upstream / `git stash`_ is your friend.
53+:GIT_URL: Changes this, to point to your searx fork.
55+:SEARX_URL: Changes this, to point to your searx instance.
57+:DOCS_URL: If you host your own (branded) documentation, change this URL.
64+.. sidebar:: activate environment
66+ ``source ./local/py3/bin/activate``
68+With Makefile we do no longer need to build up the virualenv manually (as
69+described in the :ref:`devquickstart` guide). Jump into your git working tree
70+and release a ``make pyenv``:
76+ PYENV usage: source ./local/py3/bin/activate
79+With target ``pyenv`` a development environment (aka virtualenv) was build up in
80+``./local/py3/``. To make a *developer install** of searx (:origin:`setup.py`)
81+into this environment make target ``install``
86+ PYENV usage: source ./local/py3/bin/activate
87+ PYENV using virtualenv from ./local/py3
90+You have never to think about intermediate targets like ``pyenv`` or
91+``install``, the ``Makefile`` chains them as requisites. Just run your main
94+.. sidebar:: drop environment
96+ To get rid of the existing environment before re-build use :ref:`clean target
99+If you think, something goes wrong with your ./local environment or you change
100+the :origin:`setup.py` file (or the requirements listed in
101+:origin:`requirements-dev.txt` and :origin:`requirements.txt`), you have to call
110+To get up a running a developer instance simply call ``make run``. This enables
111+*debug* option in :origin:`searx/settings.yml`, starts ``./searx/webapp.py``
112+instance, disables *debug* option and opens the site (xdg-open):
117+ PYENV usage: source ./local/py3/bin/activate
119+ ./local/py3/bin/python ./searx/webapp.py
121+ INFO:werkzeug: * Running on http://127.0.0.1:8888/ (Press CTRL+C to quit)
129+Drop all intermediate files, all builds, but keep sources untouched. Includes
130+target ``pyclean`` which drops ./local environment. Before calling ``make
131+clean`` stop all processes using :ref:`make pyenv`.
141+``make docs docs-live docs-clean``
142+==================================
144+We describe the usage of the ``doc*`` targets in the :ref:`How to contribute /
145+Documentation <contrib docs>` section. If you want to edit the documentation
146+read our :ref:`make docs-live` section. If you are working in your own brand,
147+adjust your :ref:`Makefile setup <makefile setup>`.
155+To deploy on github.io first adjust your :ref:`Makefile setup <makefile
156+setup>`. For any further read :ref:`deploy on github.io`.
163+Runs a series of tests: ``test.pep8``, ``test.unit``, ``test.robot`` and does
164+additional :ref:`pylint checks <make pylint>`. You can run tests selective,
169+ $ make test.pep8 test.unit
170+ . ./local/py3/bin/activate; ./manage.sh pep8_check
171+ [!] Running pep8 check
172+ . ./local/py3/bin/activate; ./manage.sh unit_tests
173+ [!] Running unit tests
180+.. _Pylint: https://www.pylint.org/
182+Before commiting its recommend to do some (more) linting. Pylint_ is known as
183+one of the best source-code, bug and quality checker for the Python programming
184+language. Pylint_ is not yet a quality gate within our searx project (like
185+:ref:`test.pep8 <make test>` it is), but Pylint_ can help to improve code
186+quality anyway. The pylint profile we use at searx project is found in
187+project's root folder :origin:`.pylintrc`.
189+Code quality is a ongoing process. Don't try to fix all messages from Pylint,
190+run Pylint and check if your changed lines are bringing up new messages. If so,
191+fix it. By this, code quality gets incremental better and if there comes the
192+day, the linting is balanced out, we might decide to add Pylint as a quality
199+.. _PyPi: https://pypi.org/
200+.. _twine: https://twine.readthedocs.io/en/latest/
202+Build Python packages in ``./dist/py``.
213+ searx-0.15.0-py3-none-any.whl searx-0.15.0.tar.gz
215+To upload packages to PyPi_, there is also a ``upload-pypi`` target. It needs
216+twine_ to be installed. Since you are not the owner of :pypi:`searx` you will
217+never need the latter.