Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. Getting started with aioelasticsearch
  2. =====================================
  3.  
  4. There you will find full description to get aioelasticsearch library up
  5. and ready. For this example Ubuntu 18.04 and Python 3.6 were used.
  6.  
  7. The main steps:
  8. ---------------
  9.  
  10. On Linux
  11. ~~~~~~~~
  12.  
  13. #. Clone this github repo.
  14. #. Install and configure docker for this project:
  15.  
  16. .. code:: bash
  17.  
  18. sudo apt install docker.io
  19. systemctl start docker
  20. systemctl enable docker
  21.  
  22. You might also want to check the docker version:
  23.  
  24. .. code:: bash
  25.  
  26. docker --version
  27.  
  28. After that, you need to add your current user to the 'docker' group:
  29.  
  30. .. code:: bash
  31.  
  32. usermod -aG docker $USER
  33.  
  34. To verify that docker is configured correctly, run following command:
  35.  
  36. .. code:: bash
  37.  
  38. docker ps -a
  39.  
  40. If it doesn't raise any errors, you can proceed with next steps.
  41.  
  42. #. Create and activate virtual env in downloaded folder:
  43.  
  44. .. code:: bash
  45.  
  46. virtualenv -p python3 <envname>
  47. source <envname>/bin/activate
  48.  
  49. Also you can use another method, like
  50. `venv <https://docs.python.org/3/library/venv.html>`__.
  51.  
  52. #. Install required packages from requirements.txt:
  53.  
  54. .. code:: bash
  55.  
  56. pip install -r requirements.txt
  57.  
  58. #. Run tests:
  59.  
  60. .. code:: bash
  61.  
  62. pytest tests
  63.  
  64. | Note: the first time you will have to wait while docker downloadsthe ElasticSearch image.
  65. | This takes some time (usually up to 5 minutes).
  66. | All further test runs will take less time (usually up to 3 minutes).
  67.  
  68. On macOS X
  69. ~~~~~~
  70.  
  71. #. Clone this github repo.
  72. #. `Install docker <https://docs.docker.com/docker-for-mac/install/>`__.
  73. #. Create a new virtual environment,
  74.  
  75. if you use virtualenv:
  76.  
  77. .. code:: bash
  78.  
  79. virtualenv -p python3 <envname>
  80. source <envname>/bin/activate
  81.  
  82. if you use Anaconda:
  83.  
  84. .. code:: bash
  85.  
  86. conda create -n <envname>
  87. conda activate <envname>
  88.  
  89. #. Now you can proceed to install requirements:
  90.  
  91. .. code:: bash
  92.  
  93. pip install -r requirements.txt
  94.  
  95. #. Make sure to install the project package locally:
  96.  
  97. .. code:: bash
  98.  
  99. pip install -e .
  100.  
  101. #. Great! Now you can run some tests, to see if everything works
  102. correctly.
  103.  
  104. | Tests use docker for setting up an ElasticSearch server.
  105. | You can make sure that docker is running by typing:
  106.  
  107. .. code:: bash
  108.  
  109. docker ps -a
  110.  
  111. If it doesn't raise any errors, you can proceed with running tests:
  112.  
  113. .. code:: bash
  114.  
  115. pytest --local-docker
  116.  
  117. | Note: the first time you will have to wait while docker downloadsthe ElasticSearch image.
  118. | This takes some time (usually up to 5 minutes).
  119. | All further test runs will take less time (usually up to 3 minutes).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement