Skip to content

Commit

Permalink
Merge pull request #157 from developmentseed/patch/update-starlette-env
Browse files Browse the repository at this point in the history
update FastAPI version lower limit to `>0.107.0` and adapt for new starlette version
  • Loading branch information
vincentsarago authored Jan 8, 2024
2 parents 2e03692 + 1e7b484 commit 8483d54
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).

Note: Minor version `0.X.0` update might break the API, It's recommended to pin `tipg` to minor version: `tipg>=0.1,<0.2`

## [unreleased]

- update FastAPI version lower limit to `>0.107.0` and adapt for new starlette version

## [0.5.7] - 2024-01-08

- add `tags` to all routes
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies = [
"orjson",
"asyncpg>=0.23.0",
"buildpg>=0.3",
"fastapi>=0.100.0,<0.107.0",
"fastapi>=0.107.0",
"jinja2>=2.11.2,<4.0.0",
"morecantile>=5.0,<6.0",
"pydantic>=2.4,<3.0",
Expand Down
9 changes: 5 additions & 4 deletions tipg/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@
mvt_settings = MVTSettings()
features_settings = FeaturesSettings()

DEFAULT_TEMPLATES = Jinja2Templates(
directory="",
loader=jinja2.ChoiceLoader([jinja2.PackageLoader(__package__, "templates")]),
) # type:ignore

jinja2_env = jinja2.Environment(
loader=jinja2.ChoiceLoader([jinja2.PackageLoader(__package__, "templates")])
)
DEFAULT_TEMPLATES = Jinja2Templates(env=jinja2_env)


COMMON_CONFORMS = [
Expand Down
6 changes: 2 additions & 4 deletions tipg/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ async def lifespan(app: FastAPI):
# default template directory
templates_location.append(jinja2.PackageLoader(__package__, "templates"))

templates = Jinja2Templates(
directory="", # we need to set a dummy directory variable, see https://github.com/encode/starlette/issues/1214
loader=jinja2.ChoiceLoader(templates_location),
) # type: ignore
jinja2_env = jinja2.Environment(loader=jinja2.ChoiceLoader(templates_location))
templates = Jinja2Templates(env=jinja2_env)

ogc_api = Endpoints(
title=settings.name,
Expand Down

1 comment on commit 8483d54

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'TiPg Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.30.

Benchmark suite Current: 8483d54 Previous: 2e03692 Ratio
tests/benchmarks.py::test_benchmark_tile[0/0/0-WGS1984Quad] 7.622517267915683 iter/sec (stddev: 0.1447163345939142) 10.641267986082802 iter/sec (stddev: 0.0035199611338707897) 1.40

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.