searx/dev/quickstart.html

163 lines
9.5 KiB
HTML
Raw Normal View History

2016-02-01 21:28:13 +01:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
2017-03-18 23:56:08 +01:00
<title>Development Quickstart &#8212; searx 0.11.0 documentation</title>
2016-02-01 21:28:13 +01:00
<link rel="stylesheet" href="../_static/style.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
2017-03-18 23:56:08 +01:00
VERSION: '0.11.0',
2016-02-01 21:28:13 +01:00
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
2016-11-04 21:56:14 +01:00
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
2017-03-18 23:56:08 +01:00
<link rel="top" title="searx 0.11.0 documentation" href="../index.html" />
2016-04-21 13:15:04 +02:00
<link rel="next" title="How to contribute" href="contribution_guide.html" />
2016-11-04 21:56:14 +01:00
<link rel="prev" title="How to protect an instance" href="../admin/filtron.html" />
2016-02-01 21:28:13 +01:00
<link media="only screen and (max-device-width: 480px)" href="../_static/small_flask.css" type= "text/css" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body role="document">
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="development-quickstart">
2016-04-21 13:15:04 +02:00
<span id="devquickstart"></span><h1>Development Quickstart<a class="headerlink" href="#development-quickstart" title="Permalink to this headline"></a></h1>
2016-02-01 21:28:13 +01:00
<p>This quickstart guide gets your environment set up with searx. Furthermore, it gives a
short introduction to the new manage.sh script.</p>
<div class="section" id="how-to-setup-your-development-environment">
<h2>How to setup your development environment<a class="headerlink" href="#how-to-setup-your-development-environment" title="Permalink to this headline"></a></h2>
<p>First, clone the source code of searx to the desired folder. In this case the source
is cloned to ~/myprojects/searx. Then create and activate the searx-ve
virtualenv and install the required packages using manage.sh.</p>
2016-11-04 21:56:14 +01:00
<div class="code sh highlight-default"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">~/</span><span class="n">myprojects</span>
2016-04-21 13:15:04 +02:00
<span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">asciimoo</span><span class="o">/</span><span class="n">searx</span><span class="o">.</span><span class="n">git</span>
<span class="n">cd</span> <span class="n">searx</span>
<span class="n">virtualenv</span> <span class="n">searx</span><span class="o">-</span><span class="n">ve</span>
<span class="o">.</span> <span class="o">./</span><span class="n">searx</span><span class="o">-</span><span class="n">ve</span><span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">activate</span>
<span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">update_dev_packages</span>
2016-02-01 21:28:13 +01:00
</pre></div>
</div>
</div>
<div class="section" id="how-to-run-tests">
<h2>How to run tests<a class="headerlink" href="#how-to-run-tests" title="Permalink to this headline"></a></h2>
<p>Tests can be run using the manage.sh script.</p>
<p>Following tests and checks are available:</p>
<ul class="simple">
<li>Unit tests</li>
<li>Selenium tests</li>
<li>PEP8 validation</li>
<li>Unit test coverage check</li>
</ul>
<p>For example unit tests are run with the command below:</p>
2016-11-04 21:56:14 +01:00
<div class="code sh highlight-default"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">unit_tests</span>
2016-02-01 21:28:13 +01:00
</pre></div>
</div>
<p>For further test options, please consult the help of the manage.sh script.</p>
</div>
<div class="section" id="how-to-compile-styles-and-javascript">
<h2>How to compile styles and javascript<a class="headerlink" href="#how-to-compile-styles-and-javascript" title="Permalink to this headline"></a></h2>
<div class="section" id="how-to-build-styles">
<h3>How to build styles<a class="headerlink" href="#how-to-build-styles" title="Permalink to this headline"></a></h3>
<p>Less is required to build the styles of searx. Less can be installed using either NodeJS or Apt.</p>
2016-11-04 21:56:14 +01:00
<div class="code sh highlight-default"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">nodejs</span>
2016-04-21 13:15:04 +02:00
<span class="n">sudo</span> <span class="n">npm</span> <span class="n">install</span> <span class="o">-</span><span class="n">g</span> <span class="n">less</span>
2016-02-01 21:28:13 +01:00
</pre></div>
</div>
<p>OR</p>
2016-11-04 21:56:14 +01:00
<div class="code sh highlight-default"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">node</span><span class="o">-</span><span class="n">less</span>
2016-02-01 21:28:13 +01:00
</pre></div>
</div>
<p>After satisfying the requirements styles can be build using manage.sh</p>
2016-11-04 21:56:14 +01:00
<div class="code sh highlight-default"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">styles</span>
2016-02-01 21:28:13 +01:00
</pre></div>
</div>
</div>
<div class="section" id="how-to-build-the-source-of-the-oscar-theme">
<h3>How to build the source of the oscar theme<a class="headerlink" href="#how-to-build-the-source-of-the-oscar-theme" title="Permalink to this headline"></a></h3>
<p>Grunt must be installed in order to build the javascript sources. It depends on NodeJS, so first
Node has to be installed.</p>
2016-11-04 21:56:14 +01:00
<div class="code sh highlight-default"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">nodejs</span>
2016-04-21 13:15:04 +02:00
<span class="n">sudo</span> <span class="n">npm</span> <span class="n">install</span> <span class="o">-</span><span class="n">g</span> <span class="n">grunt</span><span class="o">-</span><span class="n">cli</span>
2016-02-01 21:28:13 +01:00
</pre></div>
</div>
<p>After installing grunt, the files can be built using the following command:</p>
2016-11-04 21:56:14 +01:00
<div class="code sh highlight-default"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">build_grunt</span>
2016-02-01 21:28:13 +01:00
</pre></div>
</div>
</div>
</div>
2016-04-21 13:15:04 +02:00
<div class="section" id="tips-for-debugging-development">
<h2>Tips for debugging/development<a class="headerlink" href="#tips-for-debugging-development" title="Permalink to this headline"></a></h2>
<ol class="arabic">
2016-04-21 13:15:04 +02:00
<li><dl class="first docutils">
<dt>Turn on debug logging</dt>
<dd><p class="first last">Whether you are working on a new engine or trying to eliminate a bug, it is always a good idea
2016-04-21 13:15:04 +02:00
to turn on debug logging. When debug logging is enabled a stack trace appears,
instead of the cryptic <code class="docutils literal"><span class="pre">Internal</span> <span class="pre">Server</span> <span class="pre">Error</span></code> message. It can be turned on by setting
<code class="docutils literal"><span class="pre">debug:</span> <span class="pre">False</span></code> to <code class="docutils literal"><span class="pre">debug:</span> <span class="pre">True</span></code> in settings.yml.</p>
</dd>
2016-04-21 13:15:04 +02:00
</dl>
</li>
<li><dl class="first docutils">
<dt>Run <code class="docutils literal"><span class="pre">./manage.sh</span> <span class="pre">tests</span></code> before creating a PR.</dt>
<dd><p class="first last">Failing build on Travis is common because of PEP8 checks. So a new commit must be created
2016-04-21 13:15:04 +02:00
containing these format fixes. This phase can be skipped if <code class="docutils literal"><span class="pre">./manage.sh</span> <span class="pre">tests</span></code> is run
locally before creating a PR.</p>
</dd>
2016-04-21 13:15:04 +02:00
</dl>
</li>
</ol>
</div>
2016-02-01 21:28:13 +01:00
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper"><div class="sidebar_container body">
<h1>Searx</h1>
<ul>
<li><a href="../index.html">Home</a></li>
<li><a href="https://github.com/asciimoo/searx">Source</a></li>
<li><a href="../blog/blog.html">Blog</a></li>
2016-02-01 21:28:13 +01:00
<li><a href="https://github.com/asciimoo/searx/wiki">Wiki</a></li>
<li><a href="https://github.com/asciimoo/searx/wiki/Searx-instances">Public instances</a></li>
</ul>
<hr />
<ul>
<li><a href="https://twitter.com/Searx_engine">Twitter</a></li>
<li><a href="https://flattr.com/submit/auto?user_id=asciimoo&url=https://github.com/asciimoo/searx&title=searx&language=&tags=github&category=software">Flattr</a></li>
<li><a href="https://gratipay.com/searx">Gratipay</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
2016-07-09 22:32:57 +02:00
&copy; Copyright 2015-2016, Adam Tauber.
2016-02-01 21:28:13 +01:00
</div>
</body>
</html>