|
6 | 6 | import os |
7 | 7 |
|
8 | 8 | from mangum import Mangum |
| 9 | +from tipg.collections import register_collection_catalog |
| 10 | +from tipg.database import connect_to_db |
| 11 | +from tipg.main import app |
| 12 | +from tipg.settings import ( |
| 13 | + CustomSQLSettings, |
| 14 | + DatabaseSettings, |
| 15 | + PostgresSettings, |
| 16 | +) |
9 | 17 | from utils import get_secret_dict |
10 | 18 |
|
11 | 19 | secret = get_secret_dict(secret_arn_env_var="PGSTAC_SECRET_ARN") |
12 | | -os.environ.update( |
13 | | - { |
14 | | - "postgres_host": secret["host"], |
15 | | - "postgres_dbname": secret["dbname"], |
16 | | - "postgres_user": secret["username"], |
17 | | - "postgres_pass": secret["password"], |
18 | | - "postgres_port": str(secret["port"]), |
19 | | - } |
20 | | -) |
21 | 20 |
|
22 | | -from tipg.collections import register_collection_catalog # noqa: E402 |
23 | | -from tipg.database import connect_to_db # noqa: E402 |
24 | 21 |
|
25 | | -# skipping linting rule that wants all imports at the top |
26 | | -from tipg.main import app # noqa: E402 |
27 | | -from tipg.settings import ( |
28 | | - CustomSQLSettings, # noqa: E402 |
29 | | - DatabaseSettings, # noqa: E402 |
30 | | - PostgresSettings, # noqa: E402; noqa: E402 |
| 22 | +postgres_settings = PostgresSettings( |
| 23 | + postgres_host=secret["host"], |
| 24 | + postgres_dbname=secret["dbname"], |
| 25 | + postgres_user=secret["username"], |
| 26 | + postgres_pass=secret["password"], |
| 27 | + postgres_port=str(secret["port"]), |
31 | 28 | ) |
32 | | - |
33 | | -postgres_settings = PostgresSettings() |
34 | 29 | db_settings = DatabaseSettings() |
35 | 30 | custom_sql_settings = CustomSQLSettings() |
36 | 31 |
|
|
0 commit comments