on 97b86fd help sign in
searx/docs/dev/quickstart.rst
110 lines 2.8 kB history raw
1.. _devquickstart:
3======================
4Development Quickstart
5======================
7This quickstart guide gets your environment set up with searx. Furthermore, it
8gives a short introduction to the ``manage.sh`` script.
10How to setup your development environment
11=========================================
13First, clone the source code of searx to the desired folder. In this case the
14source is cloned to ``~/myprojects/searx``. Then create and activate the
15searx-ve virtualenv and install the required packages using manage.sh.
17.. code:: sh
19 cd ~/myprojects
20 git clone https://github.com/asciimoo/searx.git
21 cd searx
22 virtualenv searx-ve
23 . ./searx-ve/bin/activate
24 ./manage.sh update_dev_packages
27How to run tests
28================
30Tests can be run using the ``manage.sh`` script. Following tests and checks are
31available:
33- Unit tests
34- Selenium tests
35- PEP8 validation
36- Unit test coverage check
38For example unit tests are run with the command below:
40.. code:: sh
42 ./manage.sh unit_tests
44For further test options, please consult the help of the ``manage.sh`` script.
47How to compile styles and javascript
48====================================
50.. _less: http://lesscss.org/
51.. _NodeJS: https://nodejs.org
53How to build styles
54-------------------
56Less_ is required to build the styles of searx. Less_ can be installed using
57either NodeJS_ or Apt.
59.. code:: sh
61 sudo -H apt-get install nodejs
62 sudo -H npm install -g less
64OR
66.. code:: sh
68 sudo -H apt-get install node-less
70After satisfying the requirements styles can be build using ``manage.sh``
72.. code:: sh
74 ./manage.sh styles
77How to build the source of the oscar theme
78==========================================
80.. _grunt: https://gruntjs.com/
82Grunt_ must be installed in order to build the javascript sources. It depends on
83NodeJS, so first Node has to be installed.
85.. code:: sh
87 sudo -H apt-get install nodejs
88 sudo -H npm install -g grunt-cli
90After installing grunt, the files can be built using the following command:
92.. code:: sh
94 ./manage.sh grunt_build
97Tips for debugging/development
98==============================
100Turn on debug logging
101 Whether you are working on a new engine or trying to eliminate a bug, it is
102 always a good idea to turn on debug logging. When debug logging is enabled a
103 stack trace appears, instead of the cryptic ``Internal Server Error``
104 message. It can be turned on by setting ``debug: False`` to ``debug: True`` in
105 :origin:`settings.yml <searx/settings.yml>`.
107Run ``./manage.sh tests`` before creating a PR.
108 Failing build on Travis is common because of PEP8 checks. So a new commit
109 must be created containing these format fixes. This phase can be skipped if
110 ``./manage.sh tests`` is run locally before creating a PR.