on a2bd1e5 help sign in
searx/docs/dev/quickstart.rst
108 lines 2.6 kB history raw
1.. _devquickstart:
3Development Quickstart
4----------------------
6This quickstart guide gets your environment set up with searx. Furthermore, it gives a
7short introduction to the new manage.sh script.
9How to setup your development environment
10~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12First, clone the source code of searx to the desired folder. In this case the source
13is cloned to ~/myprojects/searx. Then create and activate the searx-ve
14virtualenv and install the required packages using manage.sh.
16.. code:: sh
18 cd ~/myprojects
19 git clone https://github.com/asciimoo/searx.git
20 cd searx
21 virtualenv searx-ve
22 . ./searx-ve/bin/activate
23 ./manage.sh update_dev_packages
26How to run tests
27~~~~~~~~~~~~~~~~
29Tests can be run using the manage.sh script.
31Following tests and checks are available:
33- Unit tests
35- Selenium tests
37- PEP8 validation
39- Unit test coverage check
41For example unit tests are run with the command below:
43.. code:: sh
45 ./manage.sh unit_tests
47For further test options, please consult the help of the manage.sh script.
50How to compile styles and javascript
51~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53How to build styles
54^^^^^^^^^^^^^^^^^^^
56Less is required to build the styles of searx. Less can be installed using either NodeJS or Apt.
58.. code:: sh
60 sudo apt-get install nodejs
61 sudo npm install -g less
64OR
66.. code:: sh
68 sudo 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^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
80Grunt must be installed in order to build the javascript sources. It depends on NodeJS, so first
81Node has to be installed.
83.. code:: sh
85 sudo apt-get install nodejs
86 sudo npm install -g grunt-cli
88After installing grunt, the files can be built using the following command:
90.. code:: sh
92 ./manage.sh build_grunt
96Tips for debugging/development
97~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
991. Turn on debug logging
100 Whether you are working on a new engine or trying to eliminate a bug, it is always a good idea
101 to turn on debug logging. When debug logging is enabled a stack trace appears,
102 instead of the cryptic ``Internal Server Error`` message. It can be turned on by setting
103 ``debug: False`` to ``debug: True`` in settings.yml.
1052. Run ``./manage.sh tests`` before creating a PR.
106 Failing build on Travis is common because of PEP8 checks. So a new commit must be created
107 containing these format fixes. This phase can be skipped if ``./manage.sh tests`` is run
108 locally before creating a PR.