Metadata-Version: 2.1
Name: elastic_lib
Version: 24.3.25
Summary: Common elastic stuff for the projects.
Home-page: https://labola.jp
Author: Luxeys
Author-email: tessier@luxeys.com
License: MIT
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown

You need to overwrite to setup your connections

- ElasticModel You can overwrite this constant in your settings:
-- ELASTIC_DEBUG
-- ELASTIC_INDEX_PREFIX
-- ENV


Other files not directly related to elasticsearch:
- Utils stuff for Django (paginator)
- Unit tests


Build command:
python setup.py sdist
python setup.py bdist_wheel

Run ./build.sh
build the package that will be available in the dist/ directory

if wheel return an error like not installed just run pip install wheel, you may need to install some dependencies

Resources about building lib: https://code.tutsplus.com/tutorials/how-to-write-package-and-distribute-a-library-in-python--cms-28693

http://www.diveintopython3.net/packaging.html

Project repo:
gitlab.com

Setup in projects guide:
-Create a module name elastic.py and override the get_connection to use target elastic service.
-Create a unit test to ensure that connection is working.
-Elastic periodic model in elastic.py module must inherit like this (ElasticPeriodic, ElasticCustom)
-Build the package and install
--pip install 'package_file generated by ./build.sh command'

** About tests and changes

If there's fixes changes to do in elastic_lib make the changes directly in your project i.e edit the file elastic from venv/lib/python3.5/site-packages/elastic_lib/elastic.py
then run the unit test: pytest venv/lib/python3.5/site-packages/elastic_lib/test_elastic.py

If all unit test are green check the unit test of your project if here also all is green, copy the content of your changes in the elastic_lib project and build a new version.
Then update the version in the different project then run the unit test in each project to be sure that it broke nothing.

You can't run the unit test here or on you local.

## Build the doc

Install a venv with Python 3.9 somehow 3.10 raise error when importing collections Mapping.

```shell
python3.9 -m venv ~/venv-elastic_lib_2/
source ~/venv-elastic_lib_2/bin/activate
```

Install the dependencies

```shell
pip install -r requirements/test.txt
```

Update the doc/conf.py to set the correct doc version.

Run the command to build the doc and generate the package.

```shell
./build.sh
```

The command should not raise errors, check the docs/_build/html/index.html that the doc is correctly generated.


