From 00b07c863ec147256b68f71c3fe9b6b2f9dbe6bc Mon Sep 17 00:00:00 2001 From: Philipp Rohde Date: Tue, 9 Aug 2022 09:48:02 +0200 Subject: [PATCH 01/11] fix typo fixes #4756 --- src/flask/globals.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/flask/globals.py b/src/flask/globals.py index b230ef7e..254da42b 100644 --- a/src/flask/globals.py +++ b/src/flask/globals.py @@ -88,7 +88,7 @@ def __getattr__(name: str) -> t.Any: import warnings warnings.warn( - "'_app_ctx_stack' is deprecated and will be remoevd in Flask 2.3.", + "'_app_ctx_stack' is deprecated and will be removed in Flask 2.3.", DeprecationWarning, stacklevel=2, ) @@ -98,7 +98,7 @@ def __getattr__(name: str) -> t.Any: import warnings warnings.warn( - "'_request_ctx_stack' is deprecated and will be remoevd in Flask 2.3.", + "'_request_ctx_stack' is deprecated and will be removed in Flask 2.3.", DeprecationWarning, stacklevel=2, ) From 22b6296830113827810d4e89c634f8153020f097 Mon Sep 17 00:00:00 2001 From: tautv <60752171+tautv@users.noreply.github.com> Date: Tue, 9 Aug 2022 09:45:02 +0100 Subject: [PATCH 02/11] Update javascript.rst Spelling --- docs/patterns/javascript.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/patterns/javascript.rst b/docs/patterns/javascript.rst index dd3bcb9b..4b1d7e0f 100644 --- a/docs/patterns/javascript.rst +++ b/docs/patterns/javascript.rst @@ -28,7 +28,7 @@ It is important to understand the difference between templates and JavaScript. Templates are rendered on the server, before the response is sent to the user's browser. JavaScript runs in the user's browser, after the template is rendered and sent. Therefore, it is impossible to use -JavaScript to affect how the Jinja template is rendered, but is is +JavaScript to affect how the Jinja template is rendered, but it is possible to render data into the JavaScript that will run. To provide data to JavaScript when rendering the template, use the From 77cdefcceeb90e261977493318bc8e71c5b15c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuzhan=20=C3=87elikarslan?= Date: Fri, 12 Aug 2022 13:26:26 +0300 Subject: [PATCH 03/11] Fix typo --- docs/quickstart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 22c411ee..02dbc978 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -41,7 +41,7 @@ itself. To run the application, use the ``flask`` command or ``python -m flask``. You need to tell the Flask where your application -is with the ``-app`` option. +is with the ``--app`` option. .. code-block:: text From 1d07857b1ddd2c0aef6d09436b307eb7abfdbd39 Mon Sep 17 00:00:00 2001 From: David Lord Date: Mon, 15 Aug 2022 07:29:34 -0700 Subject: [PATCH 04/11] fix typo --- docs/patterns/streaming.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/patterns/streaming.rst b/docs/patterns/streaming.rst index e35ac4ab..c9e6ef22 100644 --- a/docs/patterns/streaming.rst +++ b/docs/patterns/streaming.rst @@ -20,7 +20,7 @@ data and to then invoke that function and pass it to a response object:: def generate(): for row in iter_all_rows(): yield f"{','.join(row)}\n" - return generate(), {"Content-Type": "text/csv") + return generate(), {"Content-Type": "text/csv"} Each ``yield`` expression is directly sent to the browser. Note though that some WSGI middlewares might break streaming, so be careful there in From d94634b1beaf81afea662692874fdaa4c8a6bd89 Mon Sep 17 00:00:00 2001 From: David Lord Date: Mon, 15 Aug 2022 07:34:50 -0700 Subject: [PATCH 05/11] fix view docs --- docs/views.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/views.rst b/docs/views.rst index b7c5ba20..3eebbfaa 100644 --- a/docs/views.rst +++ b/docs/views.rst @@ -116,7 +116,10 @@ function. item = self.model.query.get_or_404(id) return render_template(self.template, item=item) - app.add_url_rule("/users/", view_func=DetailView.as_view("user_detail")) + app.add_url_rule( + "/users/", + view_func=DetailView.as_view("user_detail", User) + ) View Lifetime and ``self`` @@ -295,8 +298,10 @@ provide get (list) and post (create) methods. return jsonify(item.to_json()) def register_api(app, model, url): - app.add_url_rule(f"/{name}/", view_func=ItemAPI(f"{name}-item", model)) - app.add_url_rule(f"/{name}/", view_func=GroupAPI(f"{name}-group", model)) + item = ItemAPI.as_view(f"{name}-item", model) + group = GroupAPI.as_view(f"{name}-group", model) + app.add_url_rule(f"/{name}/", view_func=item) + app.add_url_rule(f"/{name}/", view_func=group) register_api(app, User, "users") register_api(app, Story, "stories") From 2d3f72574dcb9026c3fed6b68568351a4b18a69a Mon Sep 17 00:00:00 2001 From: David Lord Date: Mon, 15 Aug 2022 12:37:11 -0700 Subject: [PATCH 06/11] fix typo --- docs/extensiondev.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/extensiondev.rst b/docs/extensiondev.rst index 95745119..7b54917d 100644 --- a/docs/extensiondev.rst +++ b/docs/extensiondev.rst @@ -184,7 +184,7 @@ context is active when a request context is, or when a CLI command is run. If you're storing something that should be closed, use :meth:`~flask.Flask.teardown_appcontext` to ensure that it gets closed when the application context ends. If it should only be valid during a -request, or would not be used in the CLI outside a reqeust, use +request, or would not be used in the CLI outside a request, use :meth:`~flask.Flask.teardown_request`. From 86bf3f205feaa86e149674cd0f23a14f3e5c2e22 Mon Sep 17 00:00:00 2001 From: Dillon Barnes Date: Wed, 17 Aug 2022 17:00:25 +0100 Subject: [PATCH 07/11] Correct `waitress-serve` command --- docs/deploying/waitress.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/deploying/waitress.rst b/docs/deploying/waitress.rst index 9b2fe13f..eb70e058 100644 --- a/docs/deploying/waitress.rst +++ b/docs/deploying/waitress.rst @@ -45,10 +45,10 @@ pattern, use ``--call {module}:{factory}`` instead. .. code-block:: text # equivalent to 'from hello import app' - $ waitress-serve hello:app --host 127.0.0.1 + $ waitress-serve --host 127.0.0.1 hello:app # equivalent to 'from hello import create_app; create_app()' - $ waitress-serve --call hello:create_app --host 127.0.0.1 + $ waitress-serve --host 127.0.0.1 --call hello:create_app Serving on http://127.0.0.1:8080 From 746455d1038fd5479f396cbf2d19b48edfeb8290 Mon Sep 17 00:00:00 2001 From: Thomas Rhines Date: Sun, 14 Aug 2022 18:59:19 -0400 Subject: [PATCH 08/11] Fix misrendered docstring The API reference for `flask.Config.from_mapping` needs a newline to separate the summary from the return description. I also wrapped the docstring at 72 characters as suggested in CONTRIBUTING.rst. --- src/flask/config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/flask/config.py b/src/flask/config.py index 7b6a137a..d4fc310f 100644 --- a/src/flask/config.py +++ b/src/flask/config.py @@ -275,8 +275,9 @@ class Config(dict): def from_mapping( self, mapping: t.Optional[t.Mapping[str, t.Any]] = None, **kwargs: t.Any ) -> bool: - """Updates the config like :meth:`update` ignoring items with non-upper - keys. + """Updates the config like :meth:`update` ignoring items with + non-upper keys. + :return: Always returns ``True``. .. versionadded:: 0.11 From 212b72a1feeae69739fb50fc5ab11d1c025350bc Mon Sep 17 00:00:00 2001 From: David Lord Date: Mon, 22 Aug 2022 09:00:33 -0700 Subject: [PATCH 09/11] start version 2.2.3 --- CHANGES.rst | 6 ++++++ src/flask/__init__.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index e33abe8a..94257a8b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,9 @@ +Version 2.2.3 +------------- + +Unreleased + + Version 2.2.2 ------------- diff --git a/src/flask/__init__.py b/src/flask/__init__.py index e02531c5..463f55f2 100644 --- a/src/flask/__init__.py +++ b/src/flask/__init__.py @@ -42,7 +42,7 @@ from .templating import render_template_string as render_template_string from .templating import stream_template as stream_template from .templating import stream_template_string as stream_template_string -__version__ = "2.2.2" +__version__ = "2.2.3" def __getattr__(name): From 00bdc2b448a10c690b159d778391fe23852cfc08 Mon Sep 17 00:00:00 2001 From: Kevin Kirsche Date: Mon, 22 Aug 2022 12:05:52 -0400 Subject: [PATCH 10/11] fix: remove obsolete `zip_safe` (#4783) remove obsolete `zip_safe` --- docs/tutorial/install.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/tutorial/install.rst b/docs/tutorial/install.rst index 7380b302..f6820ebd 100644 --- a/docs/tutorial/install.rst +++ b/docs/tutorial/install.rst @@ -41,7 +41,6 @@ to it. version='1.0.0', packages=find_packages(), include_package_data=True, - zip_safe=False, install_requires=[ 'flask', ], From ce6ad90ecf79daf759e177e0403f27c469c7f6a8 Mon Sep 17 00:00:00 2001 From: David Lord Date: Sat, 27 Aug 2022 06:03:46 -0700 Subject: [PATCH 11/11] remove heroku link --- docs/deploying/index.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/deploying/index.rst b/docs/deploying/index.rst index 2e48682a..4135596a 100644 --- a/docs/deploying/index.rst +++ b/docs/deploying/index.rst @@ -66,7 +66,6 @@ interface. The links below are for some of the most common platforms, which have instructions for Flask, WSGI, or Python. - `PythonAnywhere `_ -- `Heroku `_ - `Google App Engine `_ - `Google Cloud Run `_ - `AWS Elastic Beanstalk `_