quickstart.rst.txt 2.6KB

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