Browse Source

Merge remote-tracking branch 'tiangolo/master' into free-form-queries

pull/9255/head
JONEMI19 3 years ago
parent
commit
2fd29c1775
  1. 6
      docs/en/docs/release-notes.md
  2. 2
      fastapi/__init__.py
  3. 7
      fastapi/applications.py
  4. 4
      fastapi/routing.py
  5. 2
      pyproject.toml

6
docs/en/docs/release-notes.md

@ -3,6 +3,12 @@
## Latest Changes ## Latest Changes
## 0.94.1
### Fixes
* 🎨 Fix types for lifespan, upgrade Starlette to 0.26.1. PR [#9245](https://github.com/tiangolo/fastapi/pull/9245) by [@tiangolo](https://github.com/tiangolo).
## 0.94.0 ## 0.94.0
### Upgrades ### Upgrades

2
fastapi/__init__.py

@ -1,6 +1,6 @@
"""FastAPI framework, high performance, easy to learn, fast to code, ready for production""" """FastAPI framework, high performance, easy to learn, fast to code, ready for production"""
__version__ = "0.94.0" __version__ = "0.94.1"
from starlette import status as status from starlette import status as status

7
fastapi/applications.py

@ -9,6 +9,7 @@ from typing import (
Optional, Optional,
Sequence, Sequence,
Type, Type,
TypeVar,
Union, Union,
) )
@ -43,10 +44,12 @@ from starlette.responses import HTMLResponse, JSONResponse, Response
from starlette.routing import BaseRoute from starlette.routing import BaseRoute
from starlette.types import ASGIApp, Lifespan, Receive, Scope, Send from starlette.types import ASGIApp, Lifespan, Receive, Scope, Send
AppType = TypeVar("AppType", bound="FastAPI")
class FastAPI(Starlette): class FastAPI(Starlette):
def __init__( def __init__(
self, self: AppType,
*, *,
debug: bool = False, debug: bool = False,
routes: Optional[List[BaseRoute]] = None, routes: Optional[List[BaseRoute]] = None,
@ -71,7 +74,7 @@ class FastAPI(Starlette):
] = None, ] = None,
on_startup: Optional[Sequence[Callable[[], Any]]] = None, on_startup: Optional[Sequence[Callable[[], Any]]] = None,
on_shutdown: Optional[Sequence[Callable[[], Any]]] = None, on_shutdown: Optional[Sequence[Callable[[], Any]]] = None,
lifespan: Optional[Lifespan] = None, lifespan: Optional[Lifespan[AppType]] = None,
terms_of_service: Optional[str] = None, terms_of_service: Optional[str] = None,
contact: Optional[Dict[str, Union[str, Any]]] = None, contact: Optional[Dict[str, Union[str, Any]]] = None,
license_info: Optional[Dict[str, Union[str, Any]]] = None, license_info: Optional[Dict[str, Union[str, Any]]] = None,

4
fastapi/routing.py

@ -492,7 +492,9 @@ class APIRouter(routing.Router):
route_class: Type[APIRoute] = APIRoute, route_class: Type[APIRoute] = APIRoute,
on_startup: Optional[Sequence[Callable[[], Any]]] = None, on_startup: Optional[Sequence[Callable[[], Any]]] = None,
on_shutdown: Optional[Sequence[Callable[[], Any]]] = None, on_shutdown: Optional[Sequence[Callable[[], Any]]] = None,
lifespan: Optional[Lifespan] = None, # the generic to Lifespan[AppType] is the type of the top level application
# which the router cannot know statically, so we use typing.Any
lifespan: Optional[Lifespan[Any]] = None,
deprecated: Optional[bool] = None, deprecated: Optional[bool] = None,
include_in_schema: bool = True, include_in_schema: bool = True,
generate_unique_id_function: Callable[[APIRoute], str] = Default( generate_unique_id_function: Callable[[APIRoute], str] = Default(

2
pyproject.toml

@ -41,7 +41,7 @@ classifiers = [
"Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP",
] ]
dependencies = [ dependencies = [
"starlette>=0.26.0,<0.27.0", "starlette>=0.26.1,<0.27.0",
"pydantic >=1.6.2,!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0", "pydantic >=1.6.2,!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0",
] ]
dynamic = ["version"] dynamic = ["version"]

Loading…
Cancel
Save