Skip to content

Commit 277a785

Browse files
committed
prepare 3.0
1 parent e376e30 commit 277a785

File tree

14 files changed

+11
-158
lines changed

14 files changed

+11
-158
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.0b3
1+
3.0.0

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ section-order = ["future", "standard-library", "third-party", "first-party", "lo
2424
quote-style = "double"
2525

2626
[tool.bumpversion]
27-
current_version = "3.0.0b3"
27+
current_version = "3.0.0"
2828
parse = """(?x)
2929
(?P<major>\\d+)\\.
3030
(?P<minor>\\d+)\\.

stac_fastapi/api/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
install_requires = [
99
"brotli_asgi",
10-
"stac-fastapi.types",
10+
"stac-fastapi.types~=3.0",
1111
]
1212

1313
extra_reqs = {

stac_fastapi/api/stac_fastapi/api/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ class ApiExtensions(enum.Enum):
1212
Ref: https://github.com/stac-api-extensions
1313
"""
1414

15-
context = "context"
1615
fields = "fields"
1716
filter = "filter"
1817
query = "query"
Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,10 @@
11
"""openapi."""
22

3-
import warnings
4-
53
from fastapi import FastAPI
6-
from fastapi.openapi.utils import get_openapi
74
from starlette.requests import Request
85
from starlette.responses import JSONResponse, Response
96
from starlette.routing import Route, request_response
107

11-
from stac_fastapi.api.config import ApiExtensions
12-
from stac_fastapi.types.config import ApiSettings
13-
14-
15-
class VndOaiResponse(JSONResponse):
16-
"""JSON with custom, vendor content-type."""
17-
18-
media_type = "application/vnd.oai.openapi+json;version=3.0"
19-
20-
def __init__(self, *args, **kwargs):
21-
"""Init function with deprecation warning."""
22-
warnings.warn(
23-
"VndOaiResponse is deprecated and will be removed in v3.0",
24-
DeprecationWarning,
25-
)
26-
super().__init__(*args, **kwargs)
27-
288

299
def update_openapi(app: FastAPI) -> FastAPI:
3010
"""Update OpenAPI response content-type.
@@ -55,33 +35,3 @@ async def patched_openapi_endpoint(req: Request) -> Response:
5535

5636
# return the patched app
5737
return app
58-
59-
60-
def config_openapi(app: FastAPI, settings: ApiSettings):
61-
"""Config openapi."""
62-
warnings.warn(
63-
"config_openapi is deprecated and will be removed in v3.0",
64-
DeprecationWarning,
65-
)
66-
67-
def custom_openapi():
68-
"""Config openapi."""
69-
if app.openapi_schema:
70-
return app.openapi_schema
71-
72-
openapi_schema = get_openapi(
73-
title="Arturo STAC API", version="0.1", routes=app.routes
74-
)
75-
76-
if settings.api_extension_is_enabled(ApiExtensions.fields):
77-
openapi_schema["paths"]["/search"]["get"]["responses"]["200"]["content"][
78-
"application/json"
79-
]["schema"] = {"$ref": "#/components/schemas/ItemCollection"}
80-
openapi_schema["paths"]["/search"]["post"]["responses"]["200"]["content"][
81-
"application/json"
82-
]["schema"] = {"$ref": "#/components/schemas/ItemCollection"}
83-
84-
app.openapi_schema = openapi_schema
85-
return app.openapi_schema
86-
87-
app.openapi = custom_openapi

stac_fastapi/api/stac_fastapi/api/routes.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import copy
44
import functools
55
import inspect
6-
import warnings
76
from typing import Any, Callable, Dict, List, Optional, Type, TypedDict, Union
87

98
from fastapi import Depends, params
@@ -38,19 +37,12 @@ async def run(*args, **kwargs):
3837
def create_async_endpoint(
3938
func: Callable,
4039
request_model: Union[Type[APIRequest], Type[BaseModel], Dict],
41-
response_class: Optional[Type[Response]] = None,
4240
):
4341
"""Wrap a function in a coroutine which may be used to create a FastAPI endpoint.
4442
4543
Synchronous functions are executed asynchronously using a background thread.
4644
"""
4745

48-
if response_class:
49-
warnings.warn(
50-
"`response_class` option is deprecated, please set the Response class directly in the endpoint.", # noqa: E501
51-
DeprecationWarning,
52-
)
53-
5446
if not inspect.iscoroutinefunction(func):
5547
func = sync_to_async(func)
5648

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
"""Library version."""
2-
__version__ = "3.0.0b3"
2+
3+
__version__ = "3.0.0"

stac_fastapi/extensions/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
desc = f.read()
88

99
install_requires = [
10-
"stac-fastapi.types",
11-
"stac-fastapi.api",
10+
"stac-fastapi.types~=3.0",
11+
"stac-fastapi.api~=3.0",
1212
]
1313

1414
extra_reqs = {

stac_fastapi/extensions/stac_fastapi/extensions/core/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from .aggregation import AggregationExtension
44
from .collection_search import CollectionSearchExtension, CollectionSearchPostExtension
5-
from .context import ContextExtension
65
from .fields import FieldsExtension
76
from .filter import FilterExtension
87
from .free_text import FreeTextAdvancedExtension, FreeTextExtension
@@ -13,7 +12,6 @@
1312

1413
__all__ = (
1514
"AggregationExtension",
16-
"ContextExtension",
1715
"FieldsExtension",
1816
"FilterExtension",
1917
"FreeTextExtension",

stac_fastapi/extensions/stac_fastapi/extensions/core/context.py

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)