Skip to content

Commit 0b56c1c

Browse files
committed
remove PostgresSettings init main.py
1 parent 6832efa commit 0b56c1c

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Note: Minor version `0.X.0` update might break the API, It's recommended to pin
88

99
## [unreleased]
1010

11+
## [0.10.1] - 2025-03-04
12+
13+
* remove `PostgresSettings` initialization from main.py
14+
1115
## [0.10.0] - 2025-02-20
1216

1317
* convert tile bbox into collection's CRS for `MVT` where selection (author @callsumzg, https://github.com/developmentseed/tipg/pull/205)

tests/conftest.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,7 @@ def app(database_url, monkeypatch):
177177

178178
monkeypatch.setenv("TIPG_DEBUG", "TRUE")
179179

180-
from tipg.main import app, db_settings, postgres_settings
181-
182-
postgres_settings.database_url = database_url
180+
from tipg.main import app, db_settings
183181

184182
db_settings.only_spatial_tables = False
185183
db_settings.exclude_tables = None

tipg/main.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@
1111
from tipg.errors import DEFAULT_STATUS_CODES, add_exception_handlers
1212
from tipg.factory import Endpoints
1313
from tipg.middleware import CacheControlMiddleware, CatalogUpdateMiddleware
14-
from tipg.settings import (
15-
APISettings,
16-
CustomSQLSettings,
17-
DatabaseSettings,
18-
PostgresSettings,
19-
)
14+
from tipg.settings import APISettings, CustomSQLSettings, DatabaseSettings
2015

2116
from fastapi import FastAPI, Request
2217

@@ -25,7 +20,6 @@
2520
from starlette_cramjam.middleware import CompressionMiddleware
2621

2722
settings = APISettings()
28-
postgres_settings = PostgresSettings()
2923
db_settings = DatabaseSettings()
3024
custom_sql_settings = CustomSQLSettings()
3125

@@ -36,7 +30,6 @@ async def lifespan(app: FastAPI):
3630
# Create Connection Pool
3731
await connect_to_db(
3832
app,
39-
settings=postgres_settings,
4033
schemas=db_settings.schemas,
4134
user_sql_files=custom_sql_settings.sql_files,
4235
)

0 commit comments

Comments
 (0)