`python3 -m pip --no-cache-dir install common --index-url https://code.ornl.gov/api/v4/projects/10568/packages/pypi/simple --trusted-host code.ornl.gov`
`python3 -m pip --no-cache-dir install pygarden`
## Usage
@@ -40,7 +42,9 @@ A docker image and python package are provided for use as a base image in `docke
To initiate a release, increment the value in `COMMON_VERSION` run `./release.sh release`. This will force checkout develop and run the release process to push to the package registry and container registry.
### Configuration via Environment Variables
Below is a list of environmental variables and what they do:
- DATABASE_TIMEOUT, PG_TIMEOUT: an integer representing the seconds to wait before deciding a timeout occurred.
- DATABASE_DB, PG_DATABASE: a string representing the database to connect to
- DATABASE_USER, PG_USER: a string representing the user to connect to the database as
@@ -52,6 +56,7 @@ Below is a list of environmental variables and what they do:
These environmental variables have been assigned default values for the Docker container in the file `envfile`, which is called in `docker-compose.yaml` and `docker-compose.test.yaml`
### Creating an extensible Database Python Class
Some `Database` methods such as `query` and `open` rely on
[python mixins](https://www.python.org/dev/peps/pep-0487/), which allow
abstract classes to interact with different types of databases and provide
@@ -72,6 +77,7 @@ with PostgresDatabase() as db:
```
### Creating a CRUD table with crud_table.py
```python
frompygarden.mixins.postgresimportPostgresMixin
frompygarden.databaseimportDatabase
@@ -152,4 +158,3 @@ Testing for the `common_package` is contained within `/common_package/test/test.
`docker-compose -f docker-compose.test.yaml up -d`
and subsequently checking the results in the logs: