quickstart.html 9.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>Development Quickstart &#8212; searx 0.12.0 documentation</title>
  7. <link rel="stylesheet" href="../_static/style.css" type="text/css" />
  8. <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: '../',
  12. VERSION: '0.12.0',
  13. COLLAPSE_INDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true,
  16. SOURCELINK_SUFFIX: '.txt'
  17. };
  18. </script>
  19. <script type="text/javascript" src="../_static/jquery.js"></script>
  20. <script type="text/javascript" src="../_static/underscore.js"></script>
  21. <script type="text/javascript" src="../_static/doctools.js"></script>
  22. <link rel="index" title="Index" href="../genindex.html" />
  23. <link rel="search" title="Search" href="../search.html" />
  24. <link rel="next" title="How to contribute" href="contribution_guide.html" />
  25. <link rel="prev" title="How to setup result proxy" href="../admin/morty.html" />
  26. <link media="only screen and (max-device-width: 480px)" href="../_static/small_flask.css" type= "text/css" rel="stylesheet" />
  27. <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
  28. </head>
  29. <body>
  30. <div class="document">
  31. <div class="documentwrapper">
  32. <div class="bodywrapper">
  33. <div class="body" role="main">
  34. <div class="section" id="development-quickstart">
  35. <span id="devquickstart"></span><h1>Development Quickstart<a class="headerlink" href="#development-quickstart" title="Permalink to this headline">¶</a></h1>
  36. <p>This quickstart guide gets your environment set up with searx. Furthermore, it gives a
  37. short introduction to the new manage.sh script.</p>
  38. <div class="section" id="how-to-setup-your-development-environment">
  39. <h2>How to setup your development environment<a class="headerlink" href="#how-to-setup-your-development-environment" title="Permalink to this headline">¶</a></h2>
  40. <p>First, clone the source code of searx to the desired folder. In this case the source
  41. is cloned to ~/myprojects/searx. Then create and activate the searx-ve
  42. virtualenv and install the required packages using manage.sh.</p>
  43. <div class="code sh highlight-default"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">~/</span><span class="n">myprojects</span>
  44. <span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">asciimoo</span><span class="o">/</span><span class="n">searx</span><span class="o">.</span><span class="n">git</span>
  45. <span class="n">cd</span> <span class="n">searx</span>
  46. <span class="n">virtualenv</span> <span class="n">searx</span><span class="o">-</span><span class="n">ve</span>
  47. <span class="o">.</span> <span class="o">./</span><span class="n">searx</span><span class="o">-</span><span class="n">ve</span><span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">activate</span>
  48. <span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">update_dev_packages</span>
  49. </pre></div>
  50. </div>
  51. </div>
  52. <div class="section" id="how-to-run-tests">
  53. <h2>How to run tests<a class="headerlink" href="#how-to-run-tests" title="Permalink to this headline">¶</a></h2>
  54. <p>Tests can be run using the manage.sh script.</p>
  55. <p>Following tests and checks are available:</p>
  56. <ul class="simple">
  57. <li>Unit tests</li>
  58. <li>Selenium tests</li>
  59. <li>PEP8 validation</li>
  60. <li>Unit test coverage check</li>
  61. </ul>
  62. <p>For example unit tests are run with the command below:</p>
  63. <div class="code sh highlight-default"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">unit_tests</span>
  64. </pre></div>
  65. </div>
  66. <p>For further test options, please consult the help of the manage.sh script.</p>
  67. </div>
  68. <div class="section" id="how-to-compile-styles-and-javascript">
  69. <h2>How to compile styles and javascript<a class="headerlink" href="#how-to-compile-styles-and-javascript" title="Permalink to this headline">¶</a></h2>
  70. <div class="section" id="how-to-build-styles">
  71. <h3>How to build styles<a class="headerlink" href="#how-to-build-styles" title="Permalink to this headline">¶</a></h3>
  72. <p>Less is required to build the styles of searx. Less can be installed using either NodeJS or Apt.</p>
  73. <div class="code sh highlight-default"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">nodejs</span>
  74. <span class="n">sudo</span> <span class="n">npm</span> <span class="n">install</span> <span class="o">-</span><span class="n">g</span> <span class="n">less</span>
  75. </pre></div>
  76. </div>
  77. <p>OR</p>
  78. <div class="code sh highlight-default"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">node</span><span class="o">-</span><span class="n">less</span>
  79. </pre></div>
  80. </div>
  81. <p>After satisfying the requirements styles can be build using manage.sh</p>
  82. <div class="code sh highlight-default"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">styles</span>
  83. </pre></div>
  84. </div>
  85. </div>
  86. <div class="section" id="how-to-build-the-source-of-the-oscar-theme">
  87. <h3>How to build the source of the oscar theme<a class="headerlink" href="#how-to-build-the-source-of-the-oscar-theme" title="Permalink to this headline">¶</a></h3>
  88. <p>Grunt must be installed in order to build the javascript sources. It depends on NodeJS, so first
  89. Node has to be installed.</p>
  90. <div class="code sh highlight-default"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">nodejs</span>
  91. <span class="n">sudo</span> <span class="n">npm</span> <span class="n">install</span> <span class="o">-</span><span class="n">g</span> <span class="n">grunt</span><span class="o">-</span><span class="n">cli</span>
  92. </pre></div>
  93. </div>
  94. <p>After installing grunt, the files can be built using the following command:</p>
  95. <div class="code sh highlight-default"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">build_grunt</span>
  96. </pre></div>
  97. </div>
  98. </div>
  99. </div>
  100. <div class="section" id="tips-for-debugging-development">
  101. <h2>Tips for debugging/development<a class="headerlink" href="#tips-for-debugging-development" title="Permalink to this headline">¶</a></h2>
  102. <ol class="arabic simple">
  103. <li><dl class="first docutils">
  104. <dt>Turn on debug logging</dt>
  105. <dd>Whether you are working on a new engine or trying to eliminate a bug, it is always a good idea
  106. to turn on debug logging. When debug logging is enabled a stack trace appears,
  107. instead of the cryptic <code class="docutils literal"><span class="pre">Internal</span> <span class="pre">Server</span> <span class="pre">Error</span></code> message. It can be turned on by setting
  108. <code class="docutils literal"><span class="pre">debug:</span> <span class="pre">False</span></code> to <code class="docutils literal"><span class="pre">debug:</span> <span class="pre">True</span></code> in settings.yml.</dd>
  109. </dl>
  110. </li>
  111. <li><dl class="first docutils">
  112. <dt>Run <code class="docutils literal"><span class="pre">./manage.sh</span> <span class="pre">tests</span></code> before creating a PR.</dt>
  113. <dd>Failing build on Travis is common because of PEP8 checks. So a new commit must be created
  114. containing these format fixes. This phase can be skipped if <code class="docutils literal"><span class="pre">./manage.sh</span> <span class="pre">tests</span></code> is run
  115. locally before creating a PR.</dd>
  116. </dl>
  117. </li>
  118. </ol>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  125. <div class="sphinxsidebarwrapper"><div class="sidebar_container body">
  126. <h1>Searx</h1>
  127. <ul>
  128. <li><a href="../index.html">Home</a></li>
  129. <li><a href="https://github.com/asciimoo/searx">Source</a></li>
  130. <li><a href="../blog/blog.html">Blog</a></li>
  131. <li><a href="https://github.com/asciimoo/searx/wiki">Wiki</a></li>
  132. <li><a href="https://github.com/asciimoo/searx/wiki/Searx-instances">Public instances</a></li>
  133. </ul>
  134. <hr />
  135. <ul>
  136. <li><a href="https://twitter.com/Searx_engine">Twitter</a></li>
  137. </ul>
  138. </div>
  139. </div>
  140. </div>
  141. <div class="clearer"></div>
  142. </div>
  143. <div class="footer">
  144. &copy; Copyright 2015-2017, Adam Tauber.
  145. </div>
  146. </body>
  147. </html>