Skip to content

Commit 3c5a623

Browse files
Merge pull request #172 from developmentseed/feature/update-vector-and-raster-requirements
update titiler and tipg requirements
2 parents 1b76db7 + b65df44 commit 3c5a623

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

runtime/eoapi/raster/eoapi/raster/app.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from contextlib import asynccontextmanager
55
from typing import Dict
66

7+
import jinja2
78
import pystac
89
from eoapi.raster import __version__ as eoapi_raster_version
910
from eoapi.raster.config import ApiSettings
@@ -36,20 +37,20 @@
3637
)
3738
from titiler.pgstac.reader import PgSTACReader
3839

39-
try:
40-
from importlib.resources import files as resources_files # type: ignore
41-
except ImportError:
42-
# Try backported to PY<39 `importlib_resources`.
43-
from importlib_resources import files as resources_files # type: ignore
44-
4540
logging.getLogger("botocore.credentials").disabled = True
4641
logging.getLogger("botocore.utils").disabled = True
4742
logging.getLogger("rio-tiler").setLevel(logging.ERROR)
4843

4944
settings = ApiSettings()
5045

51-
# TODO: mypy fails in python 3.9, we need to find a proper way to do this
52-
templates = Jinja2Templates(directory=str(resources_files(__package__) / "templates")) # type: ignore
46+
jinja2_env = jinja2.Environment(
47+
loader=jinja2.ChoiceLoader(
48+
[
49+
jinja2.PackageLoader(__package__, "templates"),
50+
]
51+
)
52+
)
53+
templates = Jinja2Templates(env=jinja2_env)
5354

5455

5556
@asynccontextmanager

runtime/eoapi/raster/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ classifiers = [
1919
]
2020
dynamic = ["version"]
2121
dependencies = [
22-
"titiler.pgstac==1.0.0a3",
22+
"titiler.pgstac==1.1.0",
2323
"titiler.extensions",
2424
"starlette-cramjam>=0.3,<0.4",
2525
"importlib_resources>=1.1.0;python_version<'3.9'",

runtime/eoapi/vector/eoapi/vector/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ async def lifespan(app: FastAPI):
6464
)
6565

6666
# add eoapi_vector templates and tipg templates
67-
templates = Jinja2Templates( # type: ignore
68-
directory="",
67+
jinja2_env = jinja2.Environment(
6968
loader=jinja2.ChoiceLoader(
7069
[
7170
jinja2.PackageLoader(__package__, "templates"),
7271
jinja2.PackageLoader("tipg", "templates"),
7372
]
74-
),
73+
)
7574
)
75+
templates = Jinja2Templates(env=jinja2_env)
7676

7777
# Register TiPg endpoints.
7878
endpoints = TiPgEndpoints(

runtime/eoapi/vector/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ classifiers = [
1919
]
2020
dynamic = ["version"]
2121
dependencies = [
22-
"tipg==0.5.0",
22+
"tipg==0.6.0",
2323
]
2424

2525
[project.optional-dependencies]

0 commit comments

Comments
 (0)