From 59dd6814f8a8f3fced1b502eb791ccc830f1131c Mon Sep 17 00:00:00 2001 From: Adam Hopkins Date: Thu, 30 Sep 2021 22:36:34 +0300 Subject: [PATCH] 21.9 release docs (#2218) * Beging 21.9 release docs * Add PRs to changelog * Change deprecation version * Update logging tests * Bump version * Update changelog --- CHANGELOG.rst | 4 ++++ docs/conf.py | 20 ++----------------- docs/sanic/changelog.rst | 2 ++ docs/sanic/contributing.rst | 2 +- docs/sanic/releases/21.9.md | 40 +++++++++++++++++++++++++++++++++++++ sanic/__version__.py | 2 +- sanic/base.py | 2 +- sanic/config.py | 1 + sanic/mixins/routes.py | 2 +- setup.py | 4 ++-- tests/test_app.py | 2 +- tests/test_blueprints.py | 2 +- 12 files changed, 57 insertions(+), 26 deletions(-) create mode 100644 docs/sanic/releases/21.9.md diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e0f3c37a..a9940da1 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,7 @@ +.. note:: + + From v21.9, CHANGELOG files are maintained in ``./docs/sanic/releases`` + Version 21.6.1 -------------- diff --git a/docs/conf.py b/docs/conf.py index 62f6ae4a..30a01e4c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,10 +10,8 @@ import os import sys -# Add support for auto-doc -import recommonmark -from recommonmark.transform import AutoStructify +# Add support for auto-doc # Ensure that sanic is present in the path, to allow sphinx-apidoc to @@ -26,7 +24,7 @@ import sanic # -- General configuration ------------------------------------------------ -extensions = ["sphinx.ext.autodoc", "recommonmark"] +extensions = ["sphinx.ext.autodoc", "m2r2"] templates_path = ["_templates"] @@ -162,20 +160,6 @@ autodoc_default_options = { "member-order": "groupwise", } - -# app setup hook -def setup(app): - app.add_config_value( - "recommonmark_config", - { - "enable_eval_rst": True, - "enable_auto_doc_ref": False, - }, - True, - ) - app.add_transform(AutoStructify) - - html_theme_options = { "style_external_links": False, } diff --git a/docs/sanic/changelog.rst b/docs/sanic/changelog.rst index fb389e05..516b8587 100644 --- a/docs/sanic/changelog.rst +++ b/docs/sanic/changelog.rst @@ -1,4 +1,6 @@ 📜 Changelog ============ +.. mdinclude:: ./releases/21.9.md + .. include:: ../../CHANGELOG.rst diff --git a/docs/sanic/contributing.rst b/docs/sanic/contributing.rst index 91cfd11e..5d21caa2 100644 --- a/docs/sanic/contributing.rst +++ b/docs/sanic/contributing.rst @@ -1,4 +1,4 @@ ♥️ Contributing -============== +=============== .. include:: ../../CONTRIBUTING.rst diff --git a/docs/sanic/releases/21.9.md b/docs/sanic/releases/21.9.md new file mode 100644 index 00000000..8900340d --- /dev/null +++ b/docs/sanic/releases/21.9.md @@ -0,0 +1,40 @@ +## Version 21.9 + +### Features +- [#2158](https://github.com/sanic-org/sanic/pull/2158), [#2248](https://github.com/sanic-org/sanic/pull/2248) Complete overhaul of I/O to websockets +- [#2160](https://github.com/sanic-org/sanic/pull/2160) Add new 17 signals into server and request lifecycles +- [#2162](https://github.com/sanic-org/sanic/pull/2162) Smarter `auto` fallback formatting upon exception +- [#2184](https://github.com/sanic-org/sanic/pull/2184) Introduce implementation for copying a Blueprint +- [#2200](https://github.com/sanic-org/sanic/pull/2200) Accept header parsing +- [#2207](https://github.com/sanic-org/sanic/pull/2207) Log remote address if available +- [#2209](https://github.com/sanic-org/sanic/pull/2209) Add convenience methods to BP groups +- [#2216](https://github.com/sanic-org/sanic/pull/2216) Add default messages to SanicExceptions +- [#2225](https://github.com/sanic-org/sanic/pull/2225) Type annotation convenience for annotated handlers with path parameters +- [#2236](https://github.com/sanic-org/sanic/pull/2236) Allow Falsey (but not-None) responses from route handlers +- [#2238](https://github.com/sanic-org/sanic/pull/2238) Add `exception` decorator to Blueprint Groups +- [#2244](https://github.com/sanic-org/sanic/pull/2244) Explicit static directive for serving file or dir (ex: `static(..., resource_type="file")`) +- [#2245](https://github.com/sanic-org/sanic/pull/2245) Close HTTP loop when connection task cancelled + +### Bugfixes +- [#2188](https://github.com/sanic-org/sanic/pull/2188) Fix the handling of the end of a chunked request +- [#2195](https://github.com/sanic-org/sanic/pull/2195) Resolve unexpected error handling on static requests +- [#2208](https://github.com/sanic-org/sanic/pull/2208) Make blueprint-based exceptions attach and trigger in a more intuitive manner +- [#2211](https://github.com/sanic-org/sanic/pull/2211) Fixed for handling exceptions of asgi app call +- [#2213](https://github.com/sanic-org/sanic/pull/2213) Fix bug where ws exceptions not being logged +- [#2231](https://github.com/sanic-org/sanic/pull/2231) Cleaner closing of tasks by using `abort()` in strategic places to avoid dangling sockets +- [#2247](https://github.com/sanic-org/sanic/pull/2247) Fix logging of auto-reload status in debug mode +- [#2246](https://github.com/sanic-org/sanic/pull/2246) Account for BP with exception handler but no routes + +### Developer infrastructure +- [#2194](https://github.com/sanic-org/sanic/pull/2194) HTTP unit tests with raw client +- [#2199](https://github.com/sanic-org/sanic/pull/2199) Switch to codeclimate +- [#2214](https://github.com/sanic-org/sanic/pull/2214) Try Reopening Windows Tests +- [#2229](https://github.com/sanic-org/sanic/pull/2229) Refactor `HttpProtocol` into a base class +- [#2230](https://github.com/sanic-org/sanic/pull/2230) Refactor `server.py` into multi-file module + +### Miscellaneous +- [#2173](https://github.com/sanic-org/sanic/pull/2173) Remove Duplicated Dependencies and PEP 517 Support +- [#2193](https://github.com/sanic-org/sanic/pull/2193), [#2196](https://github.com/sanic-org/sanic/pull/2196), [#2217](https://github.com/sanic-org/sanic/pull/2217) Type annotation changes + + + diff --git a/sanic/__version__.py b/sanic/__version__.py index 74a495e2..32566438 100644 --- a/sanic/__version__.py +++ b/sanic/__version__.py @@ -1 +1 @@ -__version__ = "21.6.2" +__version__ = "21.9.0" diff --git a/sanic/base.py b/sanic/base.py index ff4833fa..5d1358d8 100644 --- a/sanic/base.py +++ b/sanic/base.py @@ -58,7 +58,7 @@ class BaseSanic( if name not in self.__fake_slots__: warn( f"Setting variables on {self.__class__.__name__} instances is " - "deprecated and will be removed in version 21.9. You should " + "deprecated and will be removed in version 21.12. You should " f"change your {self.__class__.__name__} instance to use " f"instance.ctx.{name} instead.", DeprecationWarning, diff --git a/sanic/config.py b/sanic/config.py index 2971f4e4..649d9414 100644 --- a/sanic/config.py +++ b/sanic/config.py @@ -60,6 +60,7 @@ class Config(dict): REQUEST_MAX_SIZE: int REQUEST_TIMEOUT: int RESPONSE_TIMEOUT: int + SERVER_NAME: str WEBSOCKET_MAX_SIZE: int WEBSOCKET_PING_INTERVAL: int WEBSOCKET_PING_TIMEOUT: int diff --git a/sanic/mixins/routes.py b/sanic/mixins/routes.py index 3d9733cd..8467a2e3 100644 --- a/sanic/mixins/routes.py +++ b/sanic/mixins/routes.py @@ -927,7 +927,7 @@ class RouteMixin: if len(http_response_types) == 1: return next(iter(http_response_types)) - except OSError: + except (OSError, TypeError): ... return "auto" diff --git a/setup.py b/setup.py index ebfe85c9..ecbf1e07 100644 --- a/setup.py +++ b/setup.py @@ -93,7 +93,7 @@ requirements = [ ] tests_require = [ - "sanic-testing>=0.7.0b2", + "sanic-testing>=0.7.0", "pytest==5.2.1", "coverage==5.3", "gunicorn==20.0.4", @@ -117,9 +117,9 @@ tests_require = [ docs_require = [ "sphinx>=2.1.2", "sphinx_rtd_theme>=0.4.3", - "recommonmark>=0.5.0", "docutils", "pygments", + "m2r2", ] dev_require = tests_require + [ diff --git a/tests/test_app.py b/tests/test_app.py index 196f34f5..f222fba1 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -388,7 +388,7 @@ def test_app_set_attribute_warning(app): assert len(record) == 1 assert record[0].message.args[0] == ( "Setting variables on Sanic instances is deprecated " - "and will be removed in version 21.9. You should change your " + "and will be removed in version 21.12. You should change your " "Sanic instance to use instance.ctx.foo instead." ) diff --git a/tests/test_blueprints.py b/tests/test_blueprints.py index 0ffff197..b6a23151 100644 --- a/tests/test_blueprints.py +++ b/tests/test_blueprints.py @@ -1085,6 +1085,6 @@ def test_bp_set_attribute_warning(): assert len(record) == 1 assert record[0].message.args[0] == ( "Setting variables on Blueprint instances is deprecated " - "and will be removed in version 21.9. You should change your " + "and will be removed in version 21.12. You should change your " "Blueprint instance to use instance.ctx.foo instead." )