Skip to content

Commit 1b9d1c8

Browse files
committed
v2.13.0
1 parent 53c1473 commit 1b9d1c8

File tree

3 files changed

+121
-4
lines changed

3 files changed

+121
-4
lines changed

docs/release-notes/changelog.rst

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,116 @@
44
=============
55

66

7+
.. changelog:: 2.13.0
8+
:date: 2024-11-20
9+
10+
.. change:: Add ``request_max_body_size`` layered parameter
11+
:type: feature
12+
13+
Add a new ``request_max_body_size`` layered parameter, which limits the
14+
maximum size of a request body before returning a ``413 - Request Entity Too Large``.
15+
16+
.. seealso::
17+
:ref:`usage/requests:limits`
18+
19+
20+
.. change:: Send CSRF request header in OpenAPI plugins
21+
:type: feature
22+
:pr: 3754
23+
24+
Supported OpenAPI UI clients will extract the CSRF cookie value and attach it to
25+
the request headers if CSRF is enabled on the application.
26+
27+
.. change:: deprecate `litestar.contrib.sqlalchemy`
28+
:type: feature
29+
:pr: 3755
30+
31+
Deprecate the ``litestar.contrib.sqlalchemy`` module in favor of ``litestar.plugins.sqlalchemy``
32+
33+
34+
.. change:: implement `HTMX` plugin using `litestar-htmx`
35+
:type: feature
36+
:pr: 3837
37+
38+
This plugin migrates the HTMX integration to ``litestar.plugins.htmx``.
39+
40+
This logic has been moved to it's own repository named ``litestar-htmx``
41+
42+
.. change:: Pydantic: honor ``hide_input_in_errors`` in throwing validation exceptions
43+
:type: feature
44+
:pr: 3843
45+
46+
Pydantic's ``BaseModel`` supports configuration to hide data values when
47+
throwing exceptions, via setting ``hide_input_in_errors`` -- see
48+
https://docs.pydantic.dev/2.0/api/config/#pydantic.config.ConfigDict.hide_input_in_errors
49+
and https://docs.pydantic.dev/latest/usage/model_config/#hide-input-in-errors
50+
51+
Litestar will now honour this setting
52+
53+
.. change:: deprecate``litestar.contrib.pydantic``
54+
:type: feature
55+
:pr: 3852
56+
:issue: 3787
57+
58+
## Description
59+
60+
Deprecate ``litestar.contrib.pydantic`` in favor of ``litestar.plugins.pydantic``
61+
62+
63+
.. change:: Fix sign bug in rate limit middelware
64+
:type: bugfix
65+
:pr: 3776
66+
67+
Fix a bug in the rate limit middleware, that would cause the response header
68+
fields ``RateLimit-Remaining`` and ``RateLimit-Reset`` to have negative values.
69+
70+
71+
.. change:: OpenAPI: map JSONSchema spec naming convention to snake_case when names from ``schema_extra`` are not found
72+
:type: bugfix
73+
:pr: 3767
74+
:issue: 3766
75+
76+
Address rejection of ``schema_extra`` values using JSONSchema spec-compliant
77+
key names by mapping between the relevant naming conventions.
78+
79+
.. change:: Use correct path template for routes without path parameters
80+
:type: bugfix
81+
:pr: 3784
82+
83+
Fix a but where, when using ``PrometheusConfig.group_path=True``, the metrics
84+
exporter response content would ignore all paths with no path parameters.
85+
86+
.. change:: Fix a dangling anyio stream in ``TestClient``
87+
:type: bugfix
88+
:pr: 3836
89+
:issue: 3834
90+
91+
Fix a dangling anyio stream in ``TestClient`` that would cause a resource warning
92+
93+
Closes #3834.
94+
95+
.. change:: Fix bug in handling of missing ``more_body`` key in ASGI response
96+
:type: bugfix
97+
:pr: 3845
98+
99+
Some frameworks do not include the ``more_body`` key in the "http.response.body" ASGI event.
100+
According to the ASGI specification, this key should be set to ``False`` when
101+
there is no additional body content. Litestar expects ``more_body`` to be
102+
explicitly defined, but others might not.
103+
104+
This leads to failures when an ASGI framework mounted on Litestar throws error
105+
if this key is missing.
106+
107+
108+
.. change:: Fix duplicate ``RateLimit-*`` headers with caching
109+
:type: bugfix
110+
:pr: 3855
111+
:issue: 3625
112+
113+
Fix a bug where ``RateLimitMiddleware`` duplicate all ``RateLimit-*`` headers
114+
when handler cache is enabled.
115+
116+
7117
.. changelog:: 2.12.1
8118
:date: 2024-09-21
9119

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ maintainers = [
6262
name = "litestar"
6363
readme = "README.md"
6464
requires-python = ">=3.8,<4.0"
65-
version = "2.12.1"
65+
version = "2.13.0"
6666

6767
[project.urls]
6868
Blog = "https://blog.litestar.dev"

tools/prepare_release.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
_github_sponsors = "[GitHub Sponsors](https://github.com/sponsors/litestar-org/)"
2222

2323

24-
class PullRequest(msgspec.Struct):
24+
class PullRequest(msgspec.Struct, kw_only=True):
2525
title: str
2626
number: int
2727
body: str
@@ -127,10 +127,15 @@ async def get_closing_issues_references(self, pr_number: int) -> list[int]:
127127
for edge in data["data"]["repository"]["pullRequest"]["closingIssuesReferences"]["edges"]
128128
]
129129

130-
async def _get_pr_info_for_pr(self, number: int) -> PRInfo:
130+
async def _get_pr_info_for_pr(self, number: int) -> PRInfo | None:
131131
res = await self._api_client.get(f"/pulls/{number}")
132132
res.raise_for_status()
133-
pr = msgspec.convert(res.json(), type=PullRequest)
133+
data = res.json()
134+
if not data["body"]:
135+
data["body"] = ""
136+
if not data:
137+
return None
138+
pr = msgspec.convert(data, type=PullRequest)
134139

135140
cc_prefix, clean_title = pr.title.split(":", maxsplit=1)
136141
cc_type = cc_prefix.split("(", maxsplit=1)[0].lower()
@@ -157,6 +162,8 @@ async def get_prs(self) -> dict[str, list[PRInfo]]:
157162

158163
prs = defaultdict(list)
159164
for pr in pulls:
165+
if not pr:
166+
continue
160167
if pr.user.type != "Bot":
161168
prs[pr.cc_type].append(pr)
162169
return prs

0 commit comments

Comments
 (0)