Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Getting started with aioelasticsearch
- =====================================
- There you will find full description to get aioelasticsearch library up
- and ready. For this example Ubuntu 18.04 and Python 3.6 were used.
- The main steps:
- ---------------
- On Linux
- ~~~~~~~~
- #. Clone this github repo.
- #. Install and configure docker for this project:
- .. code:: bash
- sudo apt install docker.io
- systemctl start docker
- systemctl enable docker
- You might also want to check the docker version:
- .. code:: bash
- docker --version
- After that, you need to add your current user to the 'docker' group:
- .. code:: bash
- usermod -aG docker $USER
- To verify that docker is configured correctly, run following command:
- .. code:: bash
- docker ps -a
- If it doesn't raise any errors, you can proceed with next steps.
- #. Create and activate virtual env in downloaded folder:
- .. code:: bash
- virtualenv -p python3 <envname>
- source <envname>/bin/activate
- Also you can use another method, like
- `venv <https://docs.python.org/3/library/venv.html>`__.
- #. Install required packages from requirements.txt:
- .. code:: bash
- pip install -r requirements.txt
- #. Run tests:
- .. code:: bash
- pytest tests
- | Note: the first time you will have to wait while docker downloads the ElasticSearch image.
- | This takes some time (usually up to 5 minutes).
- | All further test runs will take less time (usually up to 3 minutes).
- On macOS X
- ~~~~~~
- #. Clone this github repo.
- #. `Install docker <https://docs.docker.com/docker-for-mac/install/>`__.
- #. Create a new virtual environment,
- if you use virtualenv:
- .. code:: bash
- virtualenv -p python3 <envname>
- source <envname>/bin/activate
- if you use Anaconda:
- .. code:: bash
- conda create -n <envname>
- conda activate <envname>
- #. Now you can proceed to install requirements:
- .. code:: bash
- pip install -r requirements.txt
- #. Make sure to install the project package locally:
- .. code:: bash
- pip install -e .
- #. Great! Now you can run some tests, to see if everything works
- correctly.
- | Tests use docker for setting up an ElasticSearch server.
- | You can make sure that docker is running by typing:
- .. code:: bash
- docker ps -a
- If it doesn't raise any errors, you can proceed with running tests:
- .. code:: bash
- pytest --local-docker
- | Note: the first time you will have to wait while docker downloads the ElasticSearch image.
- | This takes some time (usually up to 5 minutes).
- | All further test runs will take less time (usually up to 3 minutes).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement