Skip to content

Commit

Permalink
update stac-fastapi-pgstac version and rename env files
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed May 23, 2024
1 parent ea2eaca commit 213343c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/data/noaa-emergency-response.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"id":"noaa-emergency-response", "title": "NOAA Emergency Response Imagery", "description":"NOAA Emergency Response Imagery hosted on AWS Public Dataset.","stac_version":"1.0.0","license":"public-domain","links":[],"extent":{"spatial":{"bbox":[[-180,-90,180,90]]},"temporal":{"interval":[["2005-01-01T00:00:00Z",null]]}}}
{"type": "Collection", "id":"noaa-emergency-response", "title": "NOAA Emergency Response Imagery", "description":"NOAA Emergency Response Imagery hosted on AWS Public Dataset.","stac_version":"1.0.0","license":"public-domain","links":[],"extent":{"spatial":{"bbox":[[-180,-90,180,90]]},"temporal":{"interval":[["2005-01-01T00:00:00Z",null]]}}}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,4 @@ node_modules/
.pgdata

.ruff_cache/
.env-local
.env-cdk
2 changes: 1 addition & 1 deletion infrastructure/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class AppConfig(BaseSettings):
)

model_config = SettingsConfigDict(
env_file=".env", yaml_file="config.yaml", extra="allow"
env_file=".env-cdk", yaml_file="config.yaml", extra="allow"
)

@field_validator("tags")
Expand Down
2 changes: 1 addition & 1 deletion runtimes/eoapi/raster/eoapi/raster/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ApiSettings(BaseSettings):

model_config = {
"env_prefix": "EOAPI_RASTER_",
"env_file": ".env-local",
"env_file": ".env",
"extra": "allow",
}

Expand Down
22 changes: 8 additions & 14 deletions runtimes/eoapi/stac/eoapi/stac/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
templates = Jinja2Templates(directory=str(resources_files(__package__) / "templates")) # type: ignore

api_settings = ApiSettings()
settings = Settings()
settings = Settings(enable_response_models=True)

extensions_map = {
"transaction": TransactionExtension(
Expand Down Expand Up @@ -92,7 +92,13 @@ async def lifespan(app: FastAPI):
)

api = StacApi(
app=FastAPI(title=api_settings.name, lifespan=lifespan),
app=FastAPI(
title=api_settings.name,
lifespan=lifespan,
openapi_url="/api",
docs_url="/api.html",
redoc_url=None,
),
title=api_settings.name,
description=api_settings.name,
settings=settings,
Expand All @@ -106,18 +112,6 @@ async def lifespan(app: FastAPI):
app = api.app


@app.on_event("startup")
async def startup_event():
"""Connect to database on startup."""
await connect_to_db(app)


@app.on_event("shutdown")
async def shutdown_event():
"""Close database connection."""
await close_db_connection(app)


if api_settings.titiler_endpoint:
# Register to the TiTiler extension to the api
extension = TiTilerExtension()
Expand Down
2 changes: 1 addition & 1 deletion runtimes/eoapi/stac/eoapi/stac/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ def parse_cors_methods(cls, v):

model_config = {
"env_prefix": "EOAPI_STAC_",
"env_file": ".env-local",
"env_file": ".env",
"extra": "allow",
}
2 changes: 1 addition & 1 deletion runtimes/eoapi/stac/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ classifiers = [
]
dynamic = ["version"]
dependencies = [
"stac-fastapi.pgstac==3.0.0a0",
"stac-fastapi.pgstac==3.0.0a1",
"jinja2>=2.11.2,<4.0.0",
"starlette-cramjam>=0.3,<0.4",
"importlib_resources>=1.1.0;python_version<'3.9'",
Expand Down
2 changes: 1 addition & 1 deletion runtimes/eoapi/vector/eoapi/vector/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ApiSettings(BaseSettings):

model_config = {
"env_prefix": "EOAPI_VECTOR_",
"env_file": ".env-local",
"env_file": ".env",
"extra": "allow",
}

Expand Down

0 comments on commit 213343c

Please sign in to comment.