8000 ⬆ Upgrade Starlette from 0.18.0 to 0.19.0 (#4488) · JeanArhancet/fastapi@62f2c3a · GitHub
[go: up one dir, main page]

Skip to content

Commit 62f2c3a

Browse files
Kludextiangolo
authored andcommitted
⬆ Upgrade Starlette from 0.18.0 to 0.19.0 (fastapi#4488)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
1 parent cd2950a commit 62f2c3a

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

fastapi/exceptions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ def __init__(
1212
detail: Any = None,
1313
headers: Optional[Dict[str, Any]] = None,
1414
) -> None:
15-
super().__init__(status_code=status_code, detail=detail)
16-
self.headers = headers
15+
super().__init__(
16+
status_code=status_code, detail=detail, headers=headers # type: ignore
17+
)
1718

1819

1920
RequestErrorModel: Type[BaseModel] = create_model("Request")

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ classifiers = [
3535
"Topic :: Internet :: WWW/HTTP",
3636
]
3737
requires = [
38-
"starlette ==0.18.0",
38+
"starlette==0.19.0",
3939
"pydantic >=1.6.2,!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0",
4040
]
4141
description-file = "README.md"
@@ -140,6 +140,7 @@ filterwarnings = [
140140
"error",
141141
# TODO: needed by asyncio in Python 3.9.7 https://bugs.python.org/issue45097, try to remove on 3.9.8
142142
'ignore:The loop argument is deprecated since Python 3\.8, and scheduled for removal in Python 3\.10:DeprecationWarning:asyncio',
143+
'ignore:starlette.middleware.wsgi is deprecated and will be removed in a future release\..*:DeprecationWarning:starlette',
143144
# TODO: remove after dropping support for Python 3.6
144145
'ignore:Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.:UserWarning:jose',
145146
]

tests/test_extra_routes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ def delete_item(item_id: str, item: Item):
3232

3333
@app.head("/items/{item_id}")
3434
def head_item(item_id: str):
35-
return JSONResponse(headers={"x-fastapi-item-id": item_id})
35+
return JSONResponse(None, headers={"x-fastapi-item-id": item_id})
3636

3737

3838
@app.options("/items/{item_id}")
3939
def options_item(item_id: str):
40-
return JSONResponse(headers={"x-fastapi-item-id": item_id})
40+
return JSONResponse(None, headers={"x-fastapi-item-id": item_id})
4141

4242

4343
@app.patch("/items/{item_id}")
@@ -47,7 +47,7 @@ def patch_item(item_id: str, item: Item):
4747

4848
@app.trace("/items/{item_id}")
4949
def trace_item(item_id: str):
50-
return JSONResponse(media_type="message/http")
50+
return JSONResponse(None, media_type="message/http")
5151

5252

5353
client = TestClient(app)

0 commit comments

Comments
 (0)
0