Prepare for v23.6 release (#2797)
This commit is contained in:
parent
9cbe1fb8ad
commit
205795d1e8
55
.github/workflows/publish-package.yml
vendored
55
.github/workflows/publish-package.yml
vendored
|
@ -1,28 +1,39 @@
|
||||||
name: Publish Artifacts
|
name: Upload Python Package
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [created]
|
types: [created]
|
||||||
|
workflow_dispatch:
|
||||||
jobs:
|
jobs:
|
||||||
publishPythonPackage:
|
build-n-publish:
|
||||||
name: Publishing Sanic Release Artifacts
|
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: true
|
|
||||||
matrix:
|
|
||||||
python-version: ["3.10"]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v2
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
- name: Publish Python Package
|
with:
|
||||||
uses: harshanarayana/custom-actions@main
|
python-version: "3.x"
|
||||||
with:
|
- name: Install pypa/build
|
||||||
python-version: ${{ matrix.python-version }}
|
run: >-
|
||||||
package-infra-name: "twine"
|
python3 -m
|
||||||
pypi-user: __token__
|
pip install
|
||||||
pypi-access-token: ${{ secrets.PYPI_ACCESS_TOKEN }}
|
build
|
||||||
action: "package-publish"
|
--user
|
||||||
pypi-verify-metadata: "true"
|
- name: Build a binary wheel and a source tarball
|
||||||
|
run: >-
|
||||||
|
python3 -m
|
||||||
|
build
|
||||||
|
--sdist
|
||||||
|
--wheel
|
||||||
|
--outdir dist/
|
||||||
|
.
|
||||||
|
- name: Publish distribution 📦 to Test PyPI
|
||||||
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
with:
|
||||||
|
password: ${{ secrets.SANIC_TEST_PYPI_API_TOKEN }}
|
||||||
|
repository-url: https://test.pypi.org/legacy/
|
||||||
|
- name: Publish distribution 📦 to PyPI
|
||||||
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
with:
|
||||||
|
password: ${{ secrets.SANIC_PYPI_API_TOKEN }}
|
|
@ -5,6 +5,7 @@
|
||||||
| 🔷 In support release
|
| 🔷 In support release
|
||||||
|
|
|
|
||||||
|
|
||||||
|
.. mdinclude:: ./releases/23/23.6.md
|
||||||
.. mdinclude:: ./releases/23/23.3.md
|
.. mdinclude:: ./releases/23/23.3.md
|
||||||
.. mdinclude:: ./releases/22/22.12.md
|
.. mdinclude:: ./releases/22/22.12.md
|
||||||
.. mdinclude:: ./releases/22/22.9.md
|
.. mdinclude:: ./releases/22/22.9.md
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
## Version 23.3.0 🔶
|
## Version 23.3.0
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
- [#2545](https://github.com/sanic-org/sanic/pull/2545) Standardize init of exceptions for more consistent control of HTTP responses using exceptions
|
- [#2545](https://github.com/sanic-org/sanic/pull/2545) Standardize init of exceptions for more consistent control of HTTP responses using exceptions
|
||||||
|
|
33
docs/sanic/releases/23/23.6.md
Normal file
33
docs/sanic/releases/23/23.6.md
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
## Version 23.6.0 🔶
|
||||||
|
|
||||||
|
### Features
|
||||||
|
- [#2670](https://github.com/sanic-org/sanic/pull/2670) Increase `KEEP_ALIVE_TIMEOUT` default to 120 seconds
|
||||||
|
- [#2716](https://github.com/sanic-org/sanic/pull/2716) Adding allow route overwrite option in blueprint
|
||||||
|
- [#2724](https://github.com/sanic-org/sanic/pull/2724) and [#2792](https://github.com/sanic-org/sanic/pull/2792) Add a new exception signal for ALL exceptions raised anywhere in application
|
||||||
|
- [#2727](https://github.com/sanic-org/sanic/pull/2727) Add name prefixing to BP groups
|
||||||
|
- [#2754](https://github.com/sanic-org/sanic/pull/2754) Update request type on middleware types
|
||||||
|
- [#2770](https://github.com/sanic-org/sanic/pull/2770) Better exception message on startup time application induced import error
|
||||||
|
- [#2776](https://github.com/sanic-org/sanic/pull/2776) Set multiprocessing start method early
|
||||||
|
- [#2785](https://github.com/sanic-org/sanic/pull/2785) Add custom typing to config and ctx objects
|
||||||
|
- [#2790](https://github.com/sanic-org/sanic/pull/2790) Add `request.client_ip`
|
||||||
|
|
||||||
|
### Bugfixes
|
||||||
|
- [#2728](https://github.com/sanic-org/sanic/pull/2728) Fix traversals for intended results
|
||||||
|
- [#2729](https://github.com/sanic-org/sanic/pull/2729) Handle case when headers argument of ResponseStream constructor is None
|
||||||
|
- [#2737](https://github.com/sanic-org/sanic/pull/2737) Fix type annotation for `JSONREsponse` default content type
|
||||||
|
- [#2740](https://github.com/sanic-org/sanic/pull/2740) Use Sanic's serializer for JSON responses in the Inspector
|
||||||
|
- [#2760](https://github.com/sanic-org/sanic/pull/2760) Support for `Request.get_current` in ASGI mode
|
||||||
|
- [#2773](https://github.com/sanic-org/sanic/pull/2773) Alow Blueprint routes to explicitly define error_format
|
||||||
|
- [#2774](https://github.com/sanic-org/sanic/pull/2774) Resolve headers on different renderers
|
||||||
|
- [#2782](https://github.com/sanic-org/sanic/pull/2782) Resolve pypy compatibility issues
|
||||||
|
|
||||||
|
### Deprecations and Removals
|
||||||
|
- [#2777](https://github.com/sanic-org/sanic/pull/2777) Remove Python 3.7 support
|
||||||
|
|
||||||
|
### Developer infrastructure
|
||||||
|
- [#2766](https://github.com/sanic-org/sanic/pull/2766) Unpin setuptools version
|
||||||
|
- [#2779](https://github.com/sanic-org/sanic/pull/2779) Run keep alive tests in loop to get available port
|
||||||
|
|
||||||
|
### Improved Documentation
|
||||||
|
- [#2741](https://github.com/sanic-org/sanic/pull/2741) Better documentation examples about running Sanic
|
||||||
|
From that list, the items to highlight in the release notes:
|
|
@ -1 +1 @@
|
||||||
__version__ = "23.3.1"
|
__version__ = "23.6.0"
|
||||||
|
|
|
@ -38,3 +38,15 @@ class ExceptionMixin(metaclass=SanicMeta):
|
||||||
return handler
|
return handler
|
||||||
|
|
||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
|
def all_exceptions(self, handler):
|
||||||
|
"""
|
||||||
|
This method enables the process of creating a global exception
|
||||||
|
handler for the current blueprint under question.
|
||||||
|
|
||||||
|
:param handler: A coroutine function to handle exceptions
|
||||||
|
|
||||||
|
:return a decorated method to handle global exceptions for any
|
||||||
|
route registered under this blueprint.
|
||||||
|
"""
|
||||||
|
return self.exception(Exception)(handler)
|
||||||
|
|
|
@ -4,7 +4,7 @@ from typing import Any, Callable, Dict, Optional, Set, Union
|
||||||
from sanic.base.meta import SanicMeta
|
from sanic.base.meta import SanicMeta
|
||||||
from sanic.models.futures import FutureSignal
|
from sanic.models.futures import FutureSignal
|
||||||
from sanic.models.handler_types import SignalHandler
|
from sanic.models.handler_types import SignalHandler
|
||||||
from sanic.signals import Signal
|
from sanic.signals import Event, Signal
|
||||||
from sanic.types import HashableDict
|
from sanic.types import HashableDict
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,3 +80,9 @@ class SignalMixin(metaclass=SanicMeta):
|
||||||
|
|
||||||
def event(self, event: str):
|
def event(self, event: str):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def catch_exception(self, handler):
|
||||||
|
async def signal_handler(exception: Exception):
|
||||||
|
await handler(self, exception)
|
||||||
|
|
||||||
|
self.signal(Event.SERVER_LIFECYCLE_EXCEPTION)(signal_handler)
|
||||||
|
|
|
@ -230,14 +230,6 @@ class SignalRouter(BaseRouter):
|
||||||
if not trigger:
|
if not trigger:
|
||||||
event = ".".join([*parts[:2], "<__trigger__>"])
|
event = ".".join([*parts[:2], "<__trigger__>"])
|
||||||
|
|
||||||
try:
|
|
||||||
# Attaching __requirements__ and __trigger__ to the handler
|
|
||||||
# is deprecated and will be removed in v23.6.
|
|
||||||
handler.__requirements__ = condition # type: ignore
|
|
||||||
handler.__trigger__ = trigger # type: ignore
|
|
||||||
except AttributeError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
signal = super().add(
|
signal = super().add(
|
||||||
event,
|
event,
|
||||||
handler,
|
handler,
|
||||||
|
|
4
setup.py
4
setup.py
|
@ -103,7 +103,7 @@ ujson = "ujson>=1.35" + env_dependency
|
||||||
uvloop = "uvloop>=0.15.0" + env_dependency
|
uvloop = "uvloop>=0.15.0" + env_dependency
|
||||||
types_ujson = "types-ujson" + env_dependency
|
types_ujson = "types-ujson" + env_dependency
|
||||||
requirements = [
|
requirements = [
|
||||||
"sanic-routing>=22.8.0",
|
"sanic-routing>=23.6.0",
|
||||||
"httptools>=0.0.10",
|
"httptools>=0.0.10",
|
||||||
uvloop,
|
uvloop,
|
||||||
ujson,
|
ujson,
|
||||||
|
@ -116,7 +116,7 @@ requirements = [
|
||||||
]
|
]
|
||||||
|
|
||||||
tests_require = [
|
tests_require = [
|
||||||
"sanic-testing>=23.3.0",
|
"sanic-testing>=23.6.0",
|
||||||
"pytest==7.1.*",
|
"pytest==7.1.*",
|
||||||
"coverage",
|
"coverage",
|
||||||
"beautifulsoup4",
|
"beautifulsoup4",
|
||||||
|
|
|
@ -126,7 +126,7 @@ def test_redirect_with_params(app, test_str):
|
||||||
|
|
||||||
@app.route("/api/v2/test/<test>/", unquote=True)
|
@app.route("/api/v2/test/<test>/", unquote=True)
|
||||||
async def target_handler(request, test):
|
async def target_handler(request, test):
|
||||||
assert test == test_str
|
assert test == quote(test_str)
|
||||||
return text("OK")
|
return text("OK")
|
||||||
|
|
||||||
_, response = app.test_client.get(f"/api/v1/test/{use_in_uri}/")
|
_, response = app.test_client.get(f"/api/v1/test/{use_in_uri}/")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user