Skip to content

Commit

Permalink
Add docs for release
Browse files Browse the repository at this point in the history
  • Loading branch information
ahopkins committed Jun 30, 2024
1 parent 2cd2292 commit 17fd9f4
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 41 deletions.
2 changes: 1 addition & 1 deletion guide/config/en/general.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
current_version: "23.6"
current_version: "24.6"
4 changes: 2 additions & 2 deletions guide/config/en/sidebar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ root:
items:
- label: "2024"
items:
- label: Sanic 24.4
path: release-notes/2024/v24.4.html
- label: Sanic 24.6
path: release-notes/2024/v24.6.html
- label: "2023"
items:
- label: Sanic 23.12
Expand Down
14 changes: 12 additions & 2 deletions guide/content/en/release-notes/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,27 @@ content_class: changelog
_Current version_

### Features
- [#2838](https://github.com/sanic-org/sanic/pull/2838) Simplify request cookies `getlist`
- [#2850](https://github.com/sanic-org/sanic/pull/2850) Unix sockets can now use `pathlib.Path`
- [#2931](https://github.com/sanic-org/sanic/pull/2931) Logging improvements
- [#2931](https://github.com/sanic-org/sanic/pull/2931) [#2958](https://github.com/sanic-org/sanic/pull/2958) Logging improvements
- [#2947](https://github.com/sanic-org/sanic/pull/2947) Make the .message field on exceptions non-empty
- [#2961](https://github.com/sanic-org/sanic/pull/2961) [#2964](https://github.com/sanic-org/sanic/pull/2964) Allow for custom name generation

### Bugfixes
- [#2919](https://github.com/sanic-org/sanic/pull/2919) Remove deprecation notice in websockets
- [#2937](https://github.com/sanic-org/sanic/pull/2937) Resolve response streaming error when in ASGI mode
- [#2959](https://github.com/sanic-org/sanic/pull/2959) Resolve Python 3.12 deprecation notic
- [#2960](https://github.com/sanic-org/sanic/pull/2960) Ensure proper intent for noisy exceptions
- [#2970](https://github.com/sanic-org/sanic/pull/2970) [#2978](https://github.com/sanic-org/sanic/pull/2978) Fix missing dependencies for 3.12
- [#2971](https://github.com/sanic-org/sanic/pull/2971) Fix middleware exceptions on Not Found routes with error in middleware
- [#2973](https://github.com/sanic-org/sanic/pull/2973) Resolve cheduling logic for `transport.close` and `transport.abort`
- [#2976](https://github.com/sanic-org/sanic/pull/2976) Fix deleting a cookie that was created with `secure=False`
- [#2979](https://github.com/sanic-org/sanic/pull/2979) Throw error on bad body length
- [#2980](https://github.com/sanic-org/sanic/pull/2980) Throw error on bad body encoding

### Deprecations and Removals
- [#2899](https://github.com/sanic-org/sanic/pull/2899) Remove erroneous line from REPL impacting environments without HTTPX
- [#2962](https://github.com/sanic-org/sanic/pull/2962) Merge entity header removal

### Developer infrastructure
- [#2882](https://github.com/sanic-org/sanic/pull/2882) [#2896](https://github.com/sanic-org/sanic/pull/2896) Apply dynamic port fixture for improving tests with port selection
Expand All @@ -35,7 +45,7 @@ _Current version_
- [#2930](https://github.com/sanic-org/sanic/pull/2930) Cleanup typo on Sanic Extensions README.md
- [#2934](https://github.com/sanic-org/sanic/pull/2934) Add more context to the health check documents
- [#2936](https://github.com/sanic-org/sanic/pull/2936) Improve worker manager documentation

- [#2955](https://github.com/sanic-org/sanic/pull/2955) Fixed wrong formatting in `request.md`

## Version 23.12.0 🔷

Expand Down
14 changes: 14 additions & 0 deletions guide/webapp/display/layouts/elements/sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ def _menu_items(request: Request) -> list[Builder]:
.a("sanicbook.com", href="https://sanicbook.com", target="_blank")
.br.img(src="https://sanicbook.com/images/SanicCoverFinal.png"),
E.br.small("Book proceeds fund our journey"),
E.hr(),
E.p("Secure, auto-document, and monetize your Sanic API with:").a(
E.img(
src="/assets/images/zuplo.svg",
alt=(
"Zuplo - Secure, auto-document, "
"and monetize your Sanic API"
),
style="width: 90%;",
),
href="https://zuplo.com",
target="_blank",
rel="nofollow noopener noreferrer",
),
]


Expand Down
2 changes: 1 addition & 1 deletion sanic/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "24.4.0"
__version__ = "24.6.0"
4 changes: 2 additions & 2 deletions sanic/cookies/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ class CookieRequestParameters(RequestParameters):
def __getitem__(self, key: str) -> Optional[str]:
deprecation(
f"You are accessing cookie key '{key}', which is currently in "
"compat mode returning a single cookie value. Starting in v24.3 "
"compat mode returning a single cookie value. Starting in v24.9 "
"accessing a cookie value like this will return a list of values. "
"To avoid this behavior and continue accessing a single value, "
f"please upgrade from request.cookies['{key}'] to "
f"request.cookies.get('{key}'). See more details: "
"https://sanic.dev/en/guide/release-notes/v23.3.html#request-cookies", # noqa
24.3,
24.9,
)
try:
value = self._get_prefixed_cookie(key)
Expand Down
66 changes: 33 additions & 33 deletions sanic/cookies/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _quote(str): # no cov
_is_legal_key = re.compile("[%s]+" % re.escape(LEGAL_CHARS)).fullmatch


# In v24.3, we should remove this as being a subclass of dict
# In v24.9, we should remove this as being a subclass of dict
class CookieJar(dict):
"""A container to manipulate cookies.
Expand Down Expand Up @@ -111,82 +111,82 @@ def __getitem__(self, key: str) -> Cookie:
def __iter__(self): # no cov
deprecation(
"Iterating over the CookieJar has been deprecated and will be "
"removed in v24.3. To learn more, please see: "
"removed in v24.9. To learn more, please see: "
"https://sanic.dev/en/guide/release-notes/v23.3.html#response-cookies", # noqa
24.3,
24.9,
)
return super().__iter__()

def keys(self): # no cov
"""Deprecated in v24.3"""
"""Deprecated in v24.9"""
deprecation(
"Accessing CookieJar.keys() has been deprecated and will be "
"removed in v24.3. To learn more, please see: "
"removed in v24.9. To learn more, please see: "
"https://sanic.dev/en/guide/release-notes/v23.3.html#response-cookies", # noqa
24.3,
24.9,
)
return super().keys()

def values(self): # no cov
"""Deprecated in v24.3"""
"""Deprecated in v24.9"""
deprecation(
"Accessing CookieJar.values() has been deprecated and will be "
"removed in v24.3. To learn more, please see: "
"removed in v24.9. To learn more, please see: "
"https://sanic.dev/en/guide/release-notes/v23.3.html#response-cookies", # noqa
24.3,
24.9,
)
return super().values()

def items(self): # no cov
"""Deprecated in v24.3"""
"""Deprecated in v24.9"""
deprecation(
"Accessing CookieJar.items() has been deprecated and will be "
"removed in v24.3. To learn more, please see: "
"removed in v24.9. To learn more, please see: "
"https://sanic.dev/en/guide/release-notes/v23.3.html#response-cookies", # noqa
24.3,
24.9,
)
return super().items()

def get(self, *args, **kwargs): # no cov
"""Deprecated in v24.3"""
"""Deprecated in v24.9"""
deprecation(
"Accessing cookies from the CookieJar using get is deprecated "
"and will be removed in v24.3. You should instead use the "
"and will be removed in v24.9. You should instead use the "
"cookies.get_cookie method. To learn more, please see: "
"https://sanic.dev/en/guide/release-notes/v23.3.html#response-cookies", # noqa
24.3,
24.9,
)
return super().get(*args, **kwargs)

def pop(self, key, *args, **kwargs): # no cov
"""Deprecated in v24.3"""
"""Deprecated in v24.9"""
deprecation(
"Using CookieJar.pop() has been deprecated and will be "
"removed in v24.3. To learn more, please see: "
"removed in v24.9. To learn more, please see: "
"https://sanic.dev/en/guide/release-notes/v23.3.html#response-cookies", # noqa
24.3,
24.9,
)
self.delete(key)
return super().pop(key, *args, **kwargs)

@property
def header_key(self): # no cov
"""Deprecated in v24.3"""
"""Deprecated in v24.9"""
deprecation(
"The CookieJar.header_key property has been deprecated and will "
"be removed in version 24.3. Use CookieJar.HEADER_KEY. ",
24.3,
"be removed in version 24.9. Use CookieJar.HEADER_KEY. ",
24.9,
)
return CookieJar.HEADER_KEY

@property
def cookie_headers(self) -> Dict[str, str]: # no cov
"""Deprecated in v24.3"""
"""Deprecated in v24.9"""
deprecation(
"The CookieJar.coookie_headers property has been deprecated "
"and will be removed in version 24.3. If you need to check if a "
"and will be removed in version 24.9. If you need to check if a "
"particular cookie key has been set, use CookieJar.has_cookie.",
24.3,
24.9,
)
return {key: self.header_key for key in self}

Expand Down Expand Up @@ -352,7 +352,7 @@ def add_cookie(
)
self.headers.add(self.HEADER_KEY, cookie)

# This should be removed in v24.3
# This should be removed in v24.9
super().__setitem__(key, cookie)

return cookie
Expand Down Expand Up @@ -413,7 +413,7 @@ def delete_cookie(
self.headers.add(self.HEADER_KEY, cookie)
elif existing_cookie is None:
existing_cookie = cookie
# This should be removed in v24.3
# This should be removed in v24.9
try:
super().__delitem__(key)
except KeyError:
Expand Down Expand Up @@ -449,7 +449,7 @@ def delete_cookie(
)


# In v24.3, we should remove this as being a subclass of dict
# In v24.9, we should remove this as being a subclass of dict
# Instead, it should be an object with __slots__
# All of the current property accessors should be removed in favor
# of actual slotted properties.
Expand Down Expand Up @@ -583,14 +583,14 @@ def __init__(
def __setitem__(self, key, value):
deprecation(
"Setting values on a Cookie object as a dict has been deprecated. "
"This feature will be removed in v24.3. You should instead set "
"This feature will be removed in v24.9. You should instead set "
f"values on cookies as object properties: cookie.{key}=... ",
24.3,
24.9,
)
self._set_value(key, value)

# This is a temporary method for backwards compat and should be removed
# in v24.3 when this is no longer a dict
# in v24.9 when this is no longer a dict
def _set_value(self, key: str, value: Any) -> None:
if key not in self._keys:
raise KeyError("Unknown cookie property: %s=%s" % (key, value))
Expand Down Expand Up @@ -619,7 +619,7 @@ def encode(self, encoding: str) -> bytes:
the cookies.
.. warning::
Direct encoding of a Cookie object has been deprecated and will be removed in v24.3.
Direct encoding of a Cookie object has been deprecated and will be removed in v24.9.
Args:
encoding (str): The encoding type to be used.
Expand All @@ -629,8 +629,8 @@ def encode(self, encoding: str) -> bytes:
""" # noqa: E501
deprecation(
"Direct encoding of a Cookie object has been deprecated and will "
"be removed in v24.3.",
24.3,
"be removed in v24.9.",
24.9,
)
return str(self).encode(encoding)

Expand Down

0 comments on commit 17fd9f4

Please sign in to comment.