<commit_before>Elastic Hadoop on OpenStack
===========================

QuickStart (Ubuntu)
----------
1. Install Python with headers and virtualenv:
::
    apt-get install python-dev python-virtualenv

2. Prepare virtual environment:
::
    tools/install_venv

3. To run Python fro created environment just call:
::
    tools/with_venv python

4. Run PEP8 (style) and PyFlakes (static analysis) checks:
::
    tools/run_fast_checks

5. Build docs:
::
    tools/build_docs

6. Run all tests:
::
    tools/run_tests


Pip speedup
-----------

Add the following lines to ~/.pip/pip.conf
::
    [global]
    download-cache = /home/<username>/.pip/cache
    index-url = <mirror url>

Note! The ~/.pip/cache folder should be created.
For Saratov location the http://mirrors.sgu.ru/pypi/simple is preferred.

Git hook for fast checks
------------------------
Just add the following lines to .git/hooks/pre-commit and do chmod +x for it.
::
    #!/bin/sh
    # Run fast checks (PEP8 style check and PyFlakes fast static analysis)
    tools/run_fast_checks

You can added the same check for pre-push, for example, run_tests and run_pylint.

Running static analysis (PyLint)
--------------------------------
Just run the following command
::
    tools/run_pylint<commit_msg>run command added to README<commit_after>Elastic Hadoop on OpenStack
===========================

QuickStart (Ubuntu)
----------
1. Install Python with headers and virtualenv:
::
    apt-get install python-dev python-virtualenv

2. Prepare virtual environment:
::
    tools/install_venv

3. To run Python fro created environment just call:
::
    tools/with_venv python

4. Run PEP8 (style) and PyFlakes (static analysis) checks:
::
    tools/run_fast_checks

5. Build docs:
::
    tools/build_docs

6. Run all tests:
::
    tools/run_tests

7. Run EHO REST API with stub data and cluster ops on port 8080
::
    .venv/bin/python bin/eho-api --reset-db --stub-data --allow-cluster-ops


Pip speedup
-----------

Add the following lines to ~/.pip/pip.conf
::
    [global]
    download-cache = /home/<username>/.pip/cache
    index-url = <mirror url>

Note! The ~/.pip/cache folder should be created.
For Saratov location the http://mirrors.sgu.ru/pypi/simple is preferred.

Git hook for fast checks
------------------------
Just add the following lines to .git/hooks/pre-commit and do chmod +x for it.
::
    #!/bin/sh
    # Run fast checks (PEP8 style check and PyFlakes fast static analysis)
    tools/run_fast_checks

You can added the same check for pre-push, for example, run_tests and run_pylint.

Running static analysis (PyLint)
--------------------------------
Just run the following command
::
    tools/run_pylint
{'fraction_non_alphanumeric': 0.15997023809523808, 'fraction_numerical': 0.0078125, 'mean_word_length': 2.7140883977900554, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7602435', 'n_tokens_mistral': 848, 'n_tokens_neox': 820, 'n_words': 290}