Metadata-Version: 2.1
Name: pilot-platform-common
Version: 0.1.0
Summary: Generates entity ID and connects with Vault (secret engine) to retrieve credentials
Author: Indoc Research
Author-email: etaylor@indocresearch.org
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: python-dotenv (==0.19.1)
Requires-Dist: httpx (==0.23.0)
Requires-Dist: aioredis (>=2.0.0<3.0.0.)
Requires-Dist: aioboto3 (==9.6.0)
Requires-Dist: xmltodict (==0.13.0)
Requires-Dist: minio (==7.1.8)
Requires-Dist: python-json-logger (==2.0.2)

# common

[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg?style=for-the-badge)](https://www.gnu.org/licenses/agpl-3.0)
[![Python 3.8](https://img.shields.io/badge/python-3.8-green?style=for-the-badge)](https://www.python.org/)
[![PyPI](https://img.shields.io/pypi/v/pilot-platform-common?style=for-the-badge)](https://pypi.org/project/pilot-platform-common/)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/pilotdataplatform/common/Run%20Tests?style=for-the-badge)](https://github.com/PilotDataPlatform/common/actions)
[![codecov](https://img.shields.io/codecov/c/github/PilotDataPlatform/common?style=for-the-badge)](https://codecov.io/gh/PilotDataPlatform/common)


Importable Pip package that generates entity ID and connects with Vault (secret engine) to retrieve credentials.

## Import package
Pip install command from GitLab:
```
pip install common --index-url https://__token__:<GITLAB_PAT>@git.indocresearch.org/api/v4/projects/158/packages/pypi/simple
```

Pip install command from `.whl` file:
```
pip install common-<VERSION>-py3-none-any.whl
```

In `requirements.txt`:
```
--index-url https://__token__:<GITLAB_PAT>@git.indocresearch.org/api/v4/projects/158/packages/pypi/simple
common
```

`<GITLAB_PAT>` is a GitLab personal access token with the `read_api` scope.

## Update package
Refer to documentation: https://docs.gitlab.com/ee/user/packages/pypi_repository/#publish-a-pypi-package-by-using-twine

1. Update the package version in `setup.py`. Otherwise, the push will fail with duplicate version number.

2. Install the python `build` and `twine` package:
```
python3 -m pip install --upgrade build
python3 -m pip install --upgrade twine
```

3. Build the common package:
```
python3 -m build
```

Now you will see two more folder generated under ./common/
```
|- common.egg-info/
|- dist/
```

4. Push to GitLab:
```
TWINE_PASSWORD=<PASS>  TWINE_USERNAME=<USER> python3 -m twine upload --repository-url https://git.indocresearch.org/api/v4/projects/158/packages/pypi dist/*
```
