-

Development Quickstart

+

Development Quickstart

This quickstart guide gets your environment set up with searx. Furthermore, it gives a short introduction to the new manage.sh script.

@@ -46,12 +48,12 @@ short introduction to the new manage.sh script.

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.

-
cd ~/myprojects
-git clone https://github.com/asciimoo/searx.git
-cd searx
-virtualenv searx-ve
-. ./searx-ve/bin/activate
-./manage.sh update_dev_packages
+
cd ~/myprojects
+git clone https://github.com/asciimoo/searx.git
+cd searx
+virtualenv searx-ve
+. ./searx-ve/bin/activate
+./manage.sh update_dev_packages
 
@@ -66,7 +68,7 @@ virtualenv searx-ve
  • Unit test coverage check
  • For example unit tests are run with the command below:

    -
    ./manage.sh unit_tests
    +
    ./manage.sh unit_tests
     

    For further test options, please consult the help of the manage.sh script.

    @@ -76,16 +78,16 @@ virtualenv searx-ve

    How to build styles

    Less is required to build the styles of searx. Less can be installed using either NodeJS or Apt.

    -
    sudo apt-get install nodejs
    -sudo npm install -g less
    +
    sudo apt-get install nodejs
    +sudo npm install -g less
     

    OR

    -
    sudo apt-get install node-less
    +
    sudo apt-get install node-less
     

    After satisfying the requirements styles can be build using manage.sh

    -
    ./manage.sh styles
    +
    ./manage.sh styles
     
    @@ -93,16 +95,38 @@ sudo npm install -g less

    How to build the source of the oscar theme

    Grunt must be installed in order to build the javascript sources. It depends on NodeJS, so first Node has to be installed.

    -
    sudo apt-get install nodejs
    -sudo npm install -g grunt-cli
    +
    sudo apt-get install nodejs
    +sudo npm install -g grunt-cli
     

    After installing grunt, the files can be built using the following command:

    -
    ./manage.sh build_grunt
    +
    ./manage.sh build_grunt
     
    +
    +

    Tips for debugging/development

    +
      +
    1. +
      Turn on debug logging
      +

      Whether you are working on a new engine or trying to eliminate a bug, it is always a good idea +to turn on debug logging. When debug logging is enabled a stack trace appears, +instead of the cryptic Internal Server Error message. It can be turned on by setting +debug: False to debug: True in settings.yml.

      +
      +
      +
    2. +
    3. +
      Run ./manage.sh tests before creating a PR.
      +

      Failing build on Travis is common because of PEP8 checks. So a new commit must be created +containing these format fixes. This phase can be skipped if ./manage.sh tests is run +locally before creating a PR.

      +
      +
      +
    4. +
    +
    diff --git a/docs/dev/contribution_guide.rst b/docs/dev/contribution_guide.rst index 73f4ea33..65e58729 100644 --- a/docs/dev/contribution_guide.rst +++ b/docs/dev/contribution_guide.rst @@ -64,6 +64,8 @@ In order to submit a patch, please follow the steps below: - Create a pull request. +For more help on getting started with searx development, see :ref:`devquickstart`. + Translation ~~~~~~~~~~~ diff --git a/docs/dev/quickstart.rst b/docs/dev/quickstart.rst index edca8af5..92ef6238 100644 --- a/docs/dev/quickstart.rst +++ b/docs/dev/quickstart.rst @@ -1,3 +1,5 @@ +.. _devquickstart: + Development Quickstart ---------------------- @@ -88,3 +90,19 @@ After installing grunt, the files can be built using the following command: .. code:: sh ./manage.sh build_grunt + + + +Tips for debugging/development +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +1. Turn on debug logging + Whether you are working on a new engine or trying to eliminate a bug, it is always a good idea + to turn on debug logging. When debug logging is enabled a stack trace appears, + instead of the cryptic ``Internal Server Error`` message. It can be turned on by setting + ``debug: False`` to ``debug: True`` in settings.yml. + +2. Run ``./manage.sh tests`` before creating a PR. + Failing build on Travis is common because of PEP8 checks. So a new commit must be created + containing these format fixes. This phase can be skipped if ``./manage.sh tests`` is run + locally before creating a PR.