Skip to content

Commit

Permalink
Merge pull request #172 from developmentseed/feature/update-vector-an…
Browse files Browse the repository at this point in the history
…d-raster-requirements

update titiler and tipg requirements
  • Loading branch information
vincentsarago authored Jan 10, 2024
2 parents 1b76db7 + b65df44 commit 3c5a623
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
17 changes: 9 additions & 8 deletions runtime/eoapi/raster/eoapi/raster/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from contextlib import asynccontextmanager
from typing import Dict

import jinja2
import pystac
from eoapi.raster import __version__ as eoapi_raster_version
from eoapi.raster.config import ApiSettings
Expand Down Expand Up @@ -36,20 +37,20 @@
)
from titiler.pgstac.reader import PgSTACReader

try:
from importlib.resources import files as resources_files # type: ignore
except ImportError:
# Try backported to PY<39 `importlib_resources`.
from importlib_resources import files as resources_files # type: ignore

logging.getLogger("botocore.credentials").disabled = True
logging.getLogger("botocore.utils").disabled = True
logging.getLogger("rio-tiler").setLevel(logging.ERROR)

settings = ApiSettings()

# TODO: mypy fails in python 3.9, we need to find a proper way to do this
templates = Jinja2Templates(directory=str(resources_files(__package__) / "templates")) # type: ignore
jinja2_env = jinja2.Environment(
loader=jinja2.ChoiceLoader(
[
jinja2.PackageLoader(__package__, "templates"),
]
)
)
templates = Jinja2Templates(env=jinja2_env)


@asynccontextmanager
Expand Down
2 changes: 1 addition & 1 deletion runtime/eoapi/raster/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ classifiers = [
]
dynamic = ["version"]
dependencies = [
"titiler.pgstac==1.0.0a3",
"titiler.pgstac==1.1.0",
"titiler.extensions",
"starlette-cramjam>=0.3,<0.4",
"importlib_resources>=1.1.0;python_version<'3.9'",
Expand Down
6 changes: 3 additions & 3 deletions runtime/eoapi/vector/eoapi/vector/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ async def lifespan(app: FastAPI):
)

# add eoapi_vector templates and tipg templates
templates = Jinja2Templates( # type: ignore
directory="",
jinja2_env = jinja2.Environment(
loader=jinja2.ChoiceLoader(
[
jinja2.PackageLoader(__package__, "templates"),
jinja2.PackageLoader("tipg", "templates"),
]
),
)
)
templates = Jinja2Templates(env=jinja2_env)

# Register TiPg endpoints.
endpoints = TiPgEndpoints(
Expand Down
2 changes: 1 addition & 1 deletion runtime/eoapi/vector/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ classifiers = [
]
dynamic = ["version"]
dependencies = [
"tipg==0.5.0",
"tipg==0.6.0",
]

[project.optional-dependencies]
Expand Down

0 comments on commit 3c5a623

Please sign in to comment.