forked from sanic-org/sanic
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LTS v21.12 Deprecations (sanic-org#2306)
Co-authored-by: Néstor Pérez <25409753+prryplatypus@users.noreply.github.com>
- Loading branch information
1 parent
ad4d030
commit b4f2da4
Showing
72 changed files
with
637 additions
and
846 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
📜 Changelog | ||
============ | ||
|
||
.. mdinclude:: ./releases/21.9.md | ||
|
||
.. mdinclude:: ./releases/21/21.12.md | ||
.. mdinclude:: ./releases/21/21.9.md | ||
.. include:: ../../CHANGELOG.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
## Version 21.12.0 | ||
|
||
### Features | ||
- [#2260](https://github.com/sanic-org/sanic/pull/2260) Allow early Blueprint registrations to still apply later added objects | ||
- [#2262](https://github.com/sanic-org/sanic/pull/2262) Noisy exceptions - force logging of all exceptions | ||
- [#2264](https://github.com/sanic-org/sanic/pull/2264) Optional `uvloop` by configuration | ||
- [#2270](https://github.com/sanic-org/sanic/pull/2270) Vhost support using multiple TLS certificates | ||
- [#2277](https://github.com/sanic-org/sanic/pull/2277) Change signal routing for increased consistency | ||
- *BREAKING CHANGE*: If you were manually routing signals there is a breaking change. The signal router's `get` is no longer 100% determinative. There is now an additional step to loop thru the returned signals for proper matching on the requirements. If signals are being dispatched using `app.dispatch` or `bp.dispatch`, there is no change. | ||
- [#2290](https://github.com/sanic-org/sanic/pull/2290) Add contextual exceptions | ||
- [#2291](https://github.com/sanic-org/sanic/pull/2291) Increase join concat performance | ||
- [#2295](https://github.com/sanic-org/sanic/pull/2295), [#2316](https://github.com/sanic-org/sanic/pull/2316), [#2331](https://github.com/sanic-org/sanic/pull/2331) Restructure of CLI and application state with new displays and more command parity with `app.run` | ||
- [#2302](https://github.com/sanic-org/sanic/pull/2302) Add route context at definition time | ||
- [#2304](https://github.com/sanic-org/sanic/pull/2304) Named tasks and new API for managing background tasks | ||
- [#2307](https://github.com/sanic-org/sanic/pull/2307) On app auto-reload, provide insight of changed files | ||
- [#2308](https://github.com/sanic-org/sanic/pull/2308) Auto extend application with [Sanic Extensions](https://sanicframework.org/en/plugins/sanic-ext/getting-started.html) if it is installed, and provide first class support for accessing the extensions | ||
- [#2309](https://github.com/sanic-org/sanic/pull/2309) Builtin signals changed to `Enum` | ||
- [#2313](https://github.com/sanic-org/sanic/pull/2313) Support additional config implementation use case | ||
- [#2321](https://github.com/sanic-org/sanic/pull/2321) Refactor environment variable hydration logic | ||
- [#2327](https://github.com/sanic-org/sanic/pull/2327) Prevent sending multiple or mixed responses on a single request | ||
- [#2330](https://github.com/sanic-org/sanic/pull/2330) Custom type casting on environment variables | ||
- [#2332](https://github.com/sanic-org/sanic/pull/2332) Make all deprecation notices consistent | ||
- [#2335](https://github.com/sanic-org/sanic/pull/2335) Allow underscore to start instance names | ||
|
||
### Bugfixes | ||
- [#2273](https://github.com/sanic-org/sanic/pull/2273) Replace assignation by typing for `websocket_handshake` | ||
- [#2285](https://github.com/sanic-org/sanic/pull/2285) Fix IPv6 display in startup logs | ||
- [#2299](https://github.com/sanic-org/sanic/pull/2299) Dispatch `http.lifecyle.response` from exception handler | ||
|
||
### Deprecations and Removals | ||
- [#2306](https://github.com/sanic-org/sanic/pull/2306) Removal of deprecated items | ||
- `Sanic` and `Blueprint` may no longer have arbitrary properties attached to them | ||
- `Sanic` and `Blueprint` forced to have compliant names | ||
- alphanumeric + `_` + `-` | ||
- must start with letter or `_` | ||
- `load_env` keyword argument of `Sanic` | ||
- `sanic.exceptions.abort` | ||
- `sanic.views.CompositionView` | ||
- `sanic.response.StreamingHTTPResponse` | ||
- *NOTE:* the `stream()` response method (where you pass a callable streaming function) has been deprecated and will be removed in v22.6. You should upgrade all streaming responses to the new style: https://sanicframework.org/en/guide/advanced/streaming.html#response-streaming | ||
- [#2320](https://github.com/sanic-org/sanic/pull/2320) Remove app instance from Config for error handler setting | ||
|
||
### Developer infrastructure | ||
- [#2251](https://github.com/sanic-org/sanic/pull/2251) Change dev install command | ||
- [#2286](https://github.com/sanic-org/sanic/pull/2286) Change codeclimate complexity threshold from 5 to 10 | ||
- [#2287](https://github.com/sanic-org/sanic/pull/2287) Update host test function names so they are not overwritten | ||
- [#2292](https://github.com/sanic-org/sanic/pull/2292) Fail CI on error | ||
- [#2311](https://github.com/sanic-org/sanic/pull/2311), [#2324](https://github.com/sanic-org/sanic/pull/2324) Do not run tests for draft PRs | ||
- [#2336](https://github.com/sanic-org/sanic/pull/2336) Remove paths from coverage checks | ||
- [#2338](https://github.com/sanic-org/sanic/pull/2338) Cleanup ports on tests | ||
|
||
### Improved Documentation | ||
- [#2269](https://github.com/sanic-org/sanic/pull/2269), [#2329](https://github.com/sanic-org/sanic/pull/2329), [#2333](https://github.com/sanic-org/sanic/pull/2333) Cleanup typos and fix language | ||
|
||
### Miscellaneous | ||
- [#2257](https://github.com/sanic-org/sanic/pull/2257), [#2294](https://github.com/sanic-org/sanic/pull/2294), [#2341](https://github.com/sanic-org/sanic/pull/2341) Add Python 3.10 support | ||
- [#2279](https://github.com/sanic-org/sanic/pull/2279), [#2317](https://github.com/sanic-org/sanic/pull/2317), [#2322](https://github.com/sanic-org/sanic/pull/2322) Add/correct missing type annotations | ||
- [#2305](https://github.com/sanic-org/sanic/pull/2305) Fix examples to use modern implementations |
12 changes: 11 additions & 1 deletion
12
docs/sanic/releases/21.9.md → docs/sanic/releases/21/21.9.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
from sanic import Sanic | ||
from sanic import response | ||
from sanic import Sanic, response | ||
|
||
app = Sanic(__name__) | ||
|
||
app = Sanic("Example") | ||
|
||
|
||
@app.route("/") | ||
async def test(request): | ||
return response.json({"test": True}) | ||
|
||
|
||
if __name__ == '__main__': | ||
if __name__ == "__main__": | ||
app.run(host="0.0.0.0", port=8000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
from sanic.response import json | ||
|
||
|
||
app = Sanic(__name__) | ||
app = Sanic("Example") | ||
|
||
sem = None | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
from sanic import Sanic | ||
from sanic import response | ||
from sanic import Sanic, response | ||
|
||
app = Sanic(__name__) | ||
|
||
|
||
@app.route('/') | ||
app = Sanic("Example") | ||
|
||
|
||
@app.route("/") | ||
def handle_request(request): | ||
return response.redirect('/redirect') | ||
return response.redirect("/redirect") | ||
|
||
|
||
@app.route('/redirect') | ||
@app.route("/redirect") | ||
async def test(request): | ||
return response.json({"Redirected": True}) | ||
|
||
|
||
if __name__ == '__main__': | ||
app.run(host="0.0.0.0", port=8000) | ||
if __name__ == "__main__": | ||
app.run(host="0.0.0.0", port=8000) |
Oops, something went wrong.