Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 22.12 release notes #2637

Merged
merged 11 commits into from Dec 27, 2022
8 changes: 4 additions & 4 deletions CHANGELOG.rst
Expand Up @@ -313,8 +313,8 @@ Version 21.3.0
`#2074 <https://github.com/sanic-org/sanic/pull/2074>`_
Performance adjustments in ``handle_request_``

Version 20.12.3 🔷
------------------
Version 20.12.3
---------------

`Current LTS version`

Expand Down Expand Up @@ -350,8 +350,8 @@ Version 19.12.5
`#2027 <https://github.com/sanic-org/sanic/pull/2027>`_
Remove old chardet requirement, add in hard multidict requirement

Version 20.12.0 🔹
-----------------
Version 20.12.0
---------------

**Features**

Expand Down
7 changes: 4 additions & 3 deletions SECURITY.md
Expand Up @@ -7,14 +7,15 @@ Sanic releases long term support release once a year in December. LTS releases r

| Version | LTS | Supported |
| ------- | ------------- | ----------------------- |
| 22.9 | | :white_check_mark: |
| 22.12 | until 2024-12 | :white_check_mark: |
| 22.9 | | :x: |
| 22.6 | | :x: |
| 22.3 | | :x: |
| 21.12 | until 2023-12 | :white_check_mark: |
| 21.12 | until 2023-12 | :ballot_box_with_check: |
| 21.9 | | :x: |
| 21.6 | | :x: |
| 21.3 | | :x: |
| 20.12 | until 2022-12 | :ballot_box_with_check: |
| 20.12 | | :x: |
| 20.9 | | :x: |
| 20.6 | | :x: |
| 20.3 | | :x: |
Expand Down
1 change: 1 addition & 0 deletions docs/sanic/changelog.rst
@@ -1,6 +1,7 @@
📜 Changelog
============

.. mdinclude:: ./releases/22/22.12.md
.. mdinclude:: ./releases/22/22.9.md
.. mdinclude:: ./releases/22/22.6.md
.. mdinclude:: ./releases/22/22.3.md
Expand Down
55 changes: 55 additions & 0 deletions docs/sanic/releases/22/22.12.md
@@ -0,0 +1,55 @@
## Version 22.12.0 🔶

_Current version_

### Features

- [#2569](https://github.com/sanic-org/sanic/pull/2569) Add `JSONResponse` class with some convenient methods when updating a response object
- [#2598](https://github.com/sanic-org/sanic/pull/2598) Change `uvloop` requirement to `>=0.15.0`
- [#2609](https://github.com/sanic-org/sanic/pull/2609) Add compatibility with `websockets` v11.0
- [#2610](https://github.com/sanic-org/sanic/pull/2610) Kill server early on worker error
- Raise deadlock timeout to 30s
- [#2617](https://github.com/sanic-org/sanic/pull/2617) Scale number of running server workers
- [#2621](https://github.com/sanic-org/sanic/pull/2621) [#2634](https://github.com/sanic-org/sanic/pull/2634) Send `SIGKILL` on subsequent `ctrl+c` to force worker exit
- [#2622](https://github.com/sanic-org/sanic/pull/2622) Add API to restart all workers from the multiplexer
- [#2624](https://github.com/sanic-org/sanic/pull/2624) Default to `spawn` for all subprocesses unless specifically set:
```python
from sanic import Sanic

Sanic.start_method = "fork"
```
- [#2625](https://github.com/sanic-org/sanic/pull/2625) Filename normalisation of form-data/multipart file uploads
- [#2626](https://github.com/sanic-org/sanic/pull/2626) Move to HTTP Inspector:
- Remote access to inspect running Sanic instances
- TLS support for encrypted calls to Inspector
- Authentication to Inspector with API key
- Ability to extend Inspector with custom commands
- [#2632](https://github.com/sanic-org/sanic/pull/2632) Control order of restart operations
- [#2633](https://github.com/sanic-org/sanic/pull/2633) Move reload interval to class variable
- [#2636](https://github.com/sanic-org/sanic/pull/2636) Add `priority` to `register_middleware` method
- [#2639](https://github.com/sanic-org/sanic/pull/2639) Add `unquote` to `add_route` method
- [#2640](https://github.com/sanic-org/sanic/pull/2640) ASGI websockets to receive `text` or `bytes`


### Bugfixes

- [#2607](https://github.com/sanic-org/sanic/pull/2607) Force socket shutdown before close to allow rebinding
- [#2590](https://github.com/sanic-org/sanic/pull/2590) Use actual `StrEnum` in Python 3.11+
- [#2615](https://github.com/sanic-org/sanic/pull/2615) Ensure middleware executes only once per request timeout
- [#2627](https://github.com/sanic-org/sanic/pull/2627) Crash ASGI application on lifespan failure
- [#2635](https://github.com/sanic-org/sanic/pull/2635) Resolve error with low-level server creation on Windows


### Deprecations and Removals

- [#2608](https://github.com/sanic-org/sanic/pull/2608) [#2630](https://github.com/sanic-org/sanic/pull/2630) Signal conditions and triggers saved on `signal.extra`
- [#2626](https://github.com/sanic-org/sanic/pull/2626) Move to HTTP Inspector
- 🚨 *BREAKING CHANGE*: Moves the Inspector to a Sanic app from a simple TCP socket with a custom protocol
- *DEPRECATE*: The `--inspect*` commands have been deprecated in favor of `inspect ...` commands
- [#2628](https://github.com/sanic-org/sanic/pull/2628) Replace deprecated `distutils.strtobool`


### Developer infrastructure

- [#2612](https://github.com/sanic-org/sanic/pull/2612) Add CI testing for Python 3.11

31 changes: 29 additions & 2 deletions docs/sanic/releases/22/22.9.md
@@ -1,6 +1,33 @@
## Version 22.9.0 🔶
## Version 22.9.1

_Current version_
### Features

- [#2585](https://github.com/sanic-org/sanic/pull/2585) Improved error message when no applications have been registered


### Bugfixes

- [#2578](https://github.com/sanic-org/sanic/pull/2578) Add certificate loader for in process certificate creation
- [#2591](https://github.com/sanic-org/sanic/pull/2591) Do not use sentinel identity for `spawn` compatibility
- [#2592](https://github.com/sanic-org/sanic/pull/2592) Fix properties in nested blueprint groups
- [#2595](https://github.com/sanic-org/sanic/pull/2595) Introduce sleep interval on new worker reloader


### Deprecations and Removals


### Developer infrastructure

- [#2588](https://github.com/sanic-org/sanic/pull/2588) Markdown templates on issue forms


### Improved Documentation

- [#2556](https://github.com/sanic-org/sanic/pull/2556) v22.9 documentation
- [#2582](https://github.com/sanic-org/sanic/pull/2582) Cleanup documentation on Windows support


## Version 22.9.0

### Features

Expand Down
2 changes: 1 addition & 1 deletion sanic/__version__.py
@@ -1 +1 @@
__version__ = "22.12.0a0"
__version__ = "22.12.0"
2 changes: 1 addition & 1 deletion sanic/app.py
Expand Up @@ -164,7 +164,7 @@ class Sanic(BaseSanic, StartupMixin, metaclass=TouchUpMeta):

def __init__(
self,
name: str = None,
name: Optional[str] = None,
config: Optional[Config] = None,
ctx: Optional[Any] = None,
router: Optional[Router] = None,
Expand Down
6 changes: 4 additions & 2 deletions sanic/base/root.py
@@ -1,6 +1,6 @@
import re

from typing import Any
from typing import Any, Optional

from sanic.base.meta import SanicMeta
from sanic.exceptions import SanicException
Expand All @@ -24,7 +24,9 @@ class BaseSanic(
):
__slots__ = ("name",)

def __init__(self, name: str = None, *args: Any, **kwargs: Any) -> None:
def __init__(
self, name: Optional[str] = None, *args: Any, **kwargs: Any
) -> None:
class_name = self.__class__.__name__

if name is None:
Expand Down
6 changes: 4 additions & 2 deletions sanic/cli/app.py
Expand Up @@ -61,7 +61,7 @@ def __init__(self) -> None:
self.inspecting = False

def attach(self):
if sys.argv[1] == "inspect":
if len(sys.argv) > 1 and sys.argv[1] == "inspect":
self.inspecting = True
self.parser.description = get_logo(True)
make_inspector_parser(self.parser)
Expand Down Expand Up @@ -137,7 +137,9 @@ def _inspector_legacy(self, app_loader: AppLoader):
sys.stdout.write(
f"\n{Colors.BOLD}{Colors.YELLOW}WARNING:{Colors.END} "
"You are using the legacy CLI command that will be removed in "
f"{Colors.RED}v23.3{Colors.END}. See ___ or checkout the new "
f"{Colors.RED}v23.3{Colors.END}. See "
"https://sanic.dev/en/guide/release-notes/v22.12.html"
"#deprecations-and-removals or checkout the new "
"style commands:\n\n\t"
f"{Colors.YELLOW}sanic inspect --help{Colors.END}\n"
)
Expand Down
2 changes: 1 addition & 1 deletion sanic/cli/inspector.py
Expand Up @@ -53,7 +53,7 @@ def make_inspector_parser(parser: ArgumentParser) -> None:
"Or, you can optionally follow inspect with a subcommand. "
"If you have created a custom "
"Inspector instance, then you can run custom commands. See "
"https://sanic.dev/en/guide/deployment/inspector.html"
"https://sanic.dev/en/guide/deployment/inspector.html "
"for more details."
),
title=" Subcommands",
Expand Down
3 changes: 2 additions & 1 deletion sanic/config.py
Expand Up @@ -2,6 +2,7 @@

import sys

from abc import ABCMeta
from inspect import getmembers, isclass, isdatadescriptor
from os import environ
from pathlib import Path
Expand Down Expand Up @@ -75,7 +76,7 @@
}


class DescriptorMeta(type):
class DescriptorMeta(ABCMeta):
def __init__(cls, *_):
cls.__setters__ = {name for name, _ in getmembers(cls, cls._is_setter)}

Expand Down
8 changes: 0 additions & 8 deletions sanic/handlers.py
Expand Up @@ -36,14 +36,6 @@ def __init__(
self.debug = False
self.base = base

@classmethod
def finalize(cls, *args, **kwargs):
deprecation(
"ErrorHandler.finalize is deprecated and no longer needed. "
"Please remove update your code to remove it. ",
22.12,
)

def _full_lookup(self, exception, route_name: Optional[str] = None):
return self.lookup(exception, route_name)

Expand Down
1 change: 0 additions & 1 deletion sanic/http/http1.py
Expand Up @@ -71,7 +71,6 @@ class Http(Stream, metaclass=TouchUpMeta):
"request_body",
"request_bytes",
"request_bytes_left",
"request_max_size",
"response",
"response_func",
"response_size",
Expand Down
2 changes: 1 addition & 1 deletion sanic/http/stream.py
Expand Up @@ -19,7 +19,7 @@ class Stream:
request_max_size: Union[int, float]

__touchup__: Tuple[str, ...] = tuple()
__slots__ = ()
__slots__ = ("request_max_size",)

def respond(
self, response: BaseHTTPResponse
Expand Down
2 changes: 1 addition & 1 deletion sanic/worker/manager.py
Expand Up @@ -207,7 +207,7 @@ def wait_for_ack(self): # no cov
"online in the allowed time. Sanic is shutting down to avoid a "
f"deadlock. The current threshold is {self.THRESHOLD / 10}s. "
"If this problem persists, please check out the documentation "
"___."
"https://sanic.dev/en/guide/deployment/manager.html#worker-ack."
)
while not self._all_workers_ack():
if self.monitor_subscriber.poll(0.1):
Expand Down