stac-fastapi.api 6.1.0__tar.gz → 6.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stac-fastapi-api
3
- Version: 6.1.0
3
+ Version: 6.1.1
4
4
  Summary: An implementation of STAC API based on the FastAPI framework.
5
5
  Project-URL: Homepage, https://github.com/stac-utils/stac-fastapi
6
6
  Author-email: ArturoAI <engineering@arturo.ai>
@@ -1,6 +1,7 @@
1
1
  """Fastapi app creation."""
2
2
 
3
3
 
4
+ import inspect
4
5
  from typing import Awaitable, Callable, Dict, List, Optional, Tuple, Type, Union
5
6
 
6
7
  import attr
@@ -8,7 +9,6 @@ from brotli_asgi import BrotliMiddleware
8
9
  from fastapi import APIRouter, FastAPI
9
10
  from fastapi.params import Depends
10
11
  from stac_pydantic import api
11
- from stac_pydantic.api.collections import Collections
12
12
  from stac_pydantic.shared import MimeTypes
13
13
  from stac_pydantic.version import STAC_VERSION
14
14
  from starlette.middleware import Middleware
@@ -32,6 +32,7 @@ from stac_fastapi.api.routes import (
32
32
  add_direct_response,
33
33
  add_route_dependencies,
34
34
  create_async_endpoint,
35
+ sync_to_async,
35
36
  )
36
37
  from stac_fastapi.types.config import ApiSettings, Settings
37
38
  from stac_fastapi.types.core import AsyncBaseCoreClient, BaseCoreClient
@@ -277,14 +278,14 @@ class StacApi:
277
278
  name="Get Collections",
278
279
  path="/collections",
279
280
  response_model=(
280
- Collections if self.settings.enable_response_models else None
281
+ api.Collections if self.settings.enable_response_models else None
281
282
  ),
282
283
  responses={
283
284
  200: {
284
285
  "content": {
285
286
  MimeTypes.json.value: {},
286
287
  },
287
- "model": Collections,
288
+ "model": api.Collections,
288
289
  },
289
290
  },
290
291
  response_class=self.response_class,
@@ -411,7 +412,9 @@ class StacApi:
411
412
  },
412
413
  response_class=self.response_class,
413
414
  methods=["GET"],
414
- endpoint=self.health_check,
415
+ endpoint=self.health_check
416
+ if inspect.iscoroutinefunction(self.health_check)
417
+ else sync_to_async(self.health_check),
415
418
  )
416
419
  self.app.include_router(mgmt_router, tags=["Liveliness/Readiness"])
417
420
 
@@ -1,3 +1,3 @@
1
1
  """Library version."""
2
2
 
3
- __version__ = "6.1.0"
3
+ __version__ = "6.1.1"