quickstart.rst 2.7 KB

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