<p>Before looking deeper at the targets, first read about <aclass="reference internal"href="#make-pyenv"><spanclass="std std-ref">Python environment</span></a>.</p>
<codeclass="docutils literal notranslate"><spanclass="pre">Makefile</span></code> based boilerplate was added. If you are not familiar with
Makefiles, we recommend to read <aclass="reference external"href="https://www.gnu.org/software/make/manual/make.html#Introduction">gnu-make</a> introduction.</p>
<p>The usage is simple, just type <codeclass="docutils literal notranslate"><spanclass="pre">make</span><spanclass="pre">{target-name}</span></code> to <em>build</em> a target.
Calling the <codeclass="docutils literal notranslate"><spanclass="pre">help</span></code> target gives a first overview (<codeclass="docutils literal notranslate"><spanclass="pre">make</span><spanclass="pre">help</span></code>):</p>
<divclass="highlight-text notranslate"><divclass="highlight"><pre><span></span> test - run developer tests
<spanid="make-pyenv"></span><h2><aclass="toc-backref"href="#id6">Python environment</a><aclass="headerlink"href="#python-environment"title="Permalink to this headline">¶</a></h2>
described in the <aclass="reference internal"href="quickstart.html#devquickstart"><spanclass="std std-ref">Development Quickstart</span></a> guide). Jump into your git working tree
and release a <codeclass="docutils literal notranslate"><spanclass="pre">make</span><spanclass="pre">pyenv</span></code>:</p>
<p>With target <codeclass="docutils literal notranslate"><spanclass="pre">pyenv</span></code> a development environment (aka virtualenv) was build up in
<codeclass="docutils literal notranslate"><spanclass="pre">./local/py3/</span></code>. To make a <em>developer install</em> of searx (<aclass="reference external"href="https://github.com/searx/searx/blob/master/setup.py">git://setup.py</a>)
<p>You have never to think about intermediate targets like <codeclass="docutils literal notranslate"><spanclass="pre">pyenv</span></code> or
<codeclass="docutils literal notranslate"><spanclass="pre">install</span></code>, the <codeclass="docutils literal notranslate"><spanclass="pre">Makefile</span></code> chains them as requisites. Just run your main
<p>To get rid of the existing environment before re-build use <aclass="reference internal"href="#make-clean"><spanclass="std std-ref">clean target</span></a> first.</p>
the <aclass="reference external"href="https://github.com/searx/searx/blob/master/setup.py">git://setup.py</a> file (or the requirements listed in
<aclass="reference external"href="https://github.com/searx/searx/blob/master/requirements-dev.txt">git://requirements-dev.txt</a> and <aclass="reference external"href="https://github.com/searx/searx/blob/master/requirements.txt">git://requirements.txt</a>), you have to call
<spanid="id1"></span><h2><aclass="toc-backref"href="#id7"><codeclass="docutils literal notranslate"><spanclass="pre">make</span><spanclass="pre">run</span></code></a><aclass="headerlink"href="#make-run"title="Permalink to this headline">¶</a></h2>
<p>To get up a running a developer instance simply call <codeclass="docutils literal notranslate"><spanclass="pre">make</span><spanclass="pre">run</span></code>. This enables
<em>debug</em> option in <aclass="reference external"href="https://github.com/searx/searx/blob/master/searx/settings.yml">git://searx/settings.yml</a>, starts a <codeclass="docutils literal notranslate"><spanclass="pre">./searx/webapp.py</span></code>
<spanid="id2"></span><h2><aclass="toc-backref"href="#id8"><codeclass="docutils literal notranslate"><spanclass="pre">make</span><spanclass="pre">clean</span></code></a><aclass="headerlink"href="#make-clean"title="Permalink to this headline">¶</a></h2>
<p>Drop all intermediate files, all builds, but keep sources untouched. Includes
target <codeclass="docutils literal notranslate"><spanclass="pre">pyclean</span></code> which drops ./local environment. Before calling <codeclass="docutils literal notranslate"><spanclass="pre">make</span>
<spanclass="pre">clean</span></code> stop all processes using <aclass="reference internal"href="#make-pyenv"><spanclass="std std-ref">Python environment</span></a>.</p>
<divclass="highlight-sh notranslate"><divclass="highlight"><pre><span></span>$ make clean
<spanid="make-docs"></span><h2><aclass="toc-backref"href="#id9"><codeclass="docutils literal notranslate"><spanclass="pre">make</span><spanclass="pre">docs</span><spanclass="pre">docs-live</span><spanclass="pre">docs-clean</span></code></a><aclass="headerlink"href="#make-docs-docs-live-docs-clean"title="Permalink to this headline">¶</a></h2>
<p>We describe the usage of the <codeclass="docutils literal notranslate"><spanclass="pre">doc*</span></code> targets in the <aclass="reference internal"href="contribution_guide.html#contrib-docs"><spanclass="std std-ref">How to contribute /
Documentation</span></a> section. If you want to edit the documentation
read our <aclass="reference internal"href="contribution_guide.html#make-docs-live"><spanclass="std std-ref">live build</span></a> section. If you are working in your own brand,
<spanid="make-books"></span><h2><aclass="toc-backref"href="#id10"><codeclass="docutils literal notranslate"><spanclass="pre">make</span><spanclass="pre">books/{name}.html</span><spanclass="pre">books/{name}.pdf</span></code></a><aclass="headerlink"href="#make-books-name-html-books-name-pdf"title="Permalink to this headline">¶</a></h2>
<p>To build PDF a <aclass="reference external"href="https://tug.org/xetex/">XeTeX</a> is needed, see <aclass="reference internal"href="../admin/buildhosts.html#buildhosts"><spanclass="std std-ref">Buildhosts</span></a>.</p>
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">books/{name}.*</span></code> targets are building <em>books</em>. A <em>book</em> is a
sub-directory containing a <codeclass="docutils literal notranslate"><spanclass="pre">conf.py</span></code> file. One example is the user handbook
which can deployed separately (<aclass="reference external"href="https://github.com/searx/searx/blob/master/docs/user/conf.py">git://docs/user/conf.py</a>). Such <codeclass="docutils literal notranslate"><spanclass="pre">conf.py</span></code>
do inherit from <aclass="reference external"href="https://github.com/searx/searx/blob/master/docs/conf.py">git://docs/conf.py</a> and overwrite values to fit <em>book’s</em>
needs.</p>
<p>With the help of <aclass="reference external"href="https://www.sphinx-doc.org/en/stable/ext/intersphinx.html">Intersphinx</a> (<aclass="reference internal"href="reST.html#rest-smart-ref"><spanclass="std std-ref">Smart refs</span></a>) the links to searx’s
documentation outside of the book will be bound by the object inventory of
<codeclass="docutils literal notranslate"><spanclass="pre">DOCS_URL</span></code>. Take into account that URLs will be picked from the inventary at
documentation’s build time.</p>
<p>Use <codeclass="docutils literal notranslate"><spanclass="pre">make</span><spanclass="pre">docs-help</span></code> to see which books available:</p>
<spanid="id3"></span><h2><aclass="toc-backref"href="#id11"><codeclass="docutils literal notranslate"><spanclass="pre">make</span><spanclass="pre">gh-pages</span></code></a><aclass="headerlink"href="#make-gh-pages"title="Permalink to this headline">¶</a></h2>
<p>To deploy on github.io first adjust your <aclass="reference internal"href="../admin/settings.html#settings-global"><spanclass="std std-ref">Global Settings</span></a>. For any
further read <aclass="reference internal"href="contribution_guide.html#deploy-on-github-io"><spanclass="std std-ref">deploy on github.io</span></a>.</p>
<spanid="id4"></span><h2><aclass="toc-backref"href="#id12"><codeclass="docutils literal notranslate"><spanclass="pre">make</span><spanclass="pre">test</span></code></a><aclass="headerlink"href="#make-test"title="Permalink to this headline">¶</a></h2>
<p>Runs a series of tests: <codeclass="docutils literal notranslate"><spanclass="pre">test.pep8</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">test.unit</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">test.robot</span></code> and does
additional <aclass="reference internal"href="#make-pylint"><spanclass="std std-ref">pylint checks</span></a>. You can run tests selective,
<spanid="id5"></span><h2><aclass="toc-backref"href="#id13"><codeclass="docutils literal notranslate"><spanclass="pre">make</span><spanclass="pre">pylint</span></code></a><aclass="headerlink"href="#make-pylint"title="Permalink to this headline">¶</a></h2>
<p>Before commiting its recommend to do some (more) linting. <aclass="reference external"href="https://www.pylint.org/">Pylint</a> is known as
one of the best source-code, bug and quality checker for the Python programming
language. <aclass="reference external"href="https://www.pylint.org/">Pylint</a> is not yet a quality gate within our searx project (like
<aclass="reference internal"href="#make-test"><spanclass="std std-ref">test.pep8</span></a> it is), but <aclass="reference external"href="https://www.pylint.org/">Pylint</a> can help to improve code
quality anyway. The pylint profile we use at searx project is found in
<h2><aclass="toc-backref"href="#id14"><codeclass="docutils literal notranslate"><spanclass="pre">make</span><spanclass="pre">pybuild</span></code></a><aclass="headerlink"href="#make-pybuild"title="Permalink to this headline">¶</a></h2>
<p>Build Python packages in <codeclass="docutils literal notranslate"><spanclass="pre">./dist/py</span></code>.</p>
<divclass="highlight-sh notranslate"><divclass="highlight"><pre><span></span>$ make pybuild
...
BUILD pybuild
running sdist
running egg_info
...
$ ls ./dist/py/
searx-0.15.0-py3-none-any.whl searx-0.15.0.tar.gz
</pre></div>
</div>
<p>To upload packages to <aclass="reference external"href="https://pypi.org/">PyPi</a>, there is also a <codeclass="docutils literal notranslate"><spanclass="pre">upload-pypi</span></code> target. It needs
<aclass="reference external"href="https://twine.readthedocs.io/en/latest/">twine</a> to be installed. Since you are not the owner of <aclass="reference external"href="https://pypi.org/project/searx">PyPi: searx</a> you will