Skip to content

Commit

Permalink
remove previously deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Feb 23, 2023
1 parent 604de4b commit 6650764
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 946 deletions.
18 changes: 18 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@ Version 2.3.0

Unreleased

- Remove previously deprecated code. :pr:`4995`

- The ``push`` and ``pop`` methods of the deprecated ``_app_ctx_stack`` and
``_request_ctx_stack`` objects are removed. ``top`` still exists to give
extensions more time to update, but it will be removed.
- The ``FLASK_ENV`` environment variable, ``ENV`` config key, and ``app.env``
property are removed.
- The ``session_cookie_name``, ``send_file_max_age_default``, ``use_x_sendfile``,
``propagate_exceptions``, and ``templates_auto_reload`` properties on ``app``
are removed.
- The ``JSON_AS_ASCII``, ``JSON_SORT_KEYS``, ``JSONIFY_MIMETYPE``, and
``JSONIFY_PRETTYPRINT_REGULAR`` config keys are removed.
- The ``app.before_first_request`` and ``bp.before_app_first_request`` decorators
are removed.
- ``json_encoder`` and ``json_decoder`` attributes on app and blueprint, and the
corresponding ``json.JSONEncoder`` and ``JSONDecoder`` classes, are removed.
- The ``json.htmlsafe_dumps`` and ``htmlsafe_dump`` functions are removed.

- Use modern packaging metadata with ``pyproject.toml`` instead of ``setup.cfg``.
:pr:`4947`
- Ensure subdomains are applied with nested blueprints. :issue:`4834`
Expand Down
6 changes: 0 additions & 6 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,6 @@ HTML ``<script>`` tags.
:members:
:member-order: bysource

.. autoclass:: JSONEncoder
:members:

.. autoclass:: JSONDecoder
:members:

.. automodule:: flask.json.tag


Expand Down
69 changes: 5 additions & 64 deletions docs/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,6 @@ Builtin Configuration Values

The following configuration values are used internally by Flask:

.. py:data:: ENV
What environment the app is running in. The :attr:`~flask.Flask.env` attribute maps
to this config key.

Default: ``'production'``

.. deprecated:: 2.2
Will be removed in Flask 2.3. Use ``--debug`` instead.

.. versionadded:: 1.0

.. py:data:: DEBUG
Whether debug mode is enabled. When using ``flask run`` to start the development
Expand Down Expand Up @@ -271,52 +259,6 @@ The following configuration values are used internally by Flask:

Default: ``None``

.. py:data:: JSON_AS_ASCII
Serialize objects to ASCII-encoded JSON. If this is disabled, the
JSON returned from ``jsonify`` will contain Unicode characters. This
has security implications when rendering the JSON into JavaScript in
templates, and should typically remain enabled.

Default: ``True``

.. deprecated:: 2.2
Will be removed in Flask 2.3. Set ``app.json.ensure_ascii``
instead.

.. py:data:: JSON_SORT_KEYS
Sort the keys of JSON objects alphabetically. This is useful for caching
because it ensures the data is serialized the same way no matter what
Python's hash seed is. While not recommended, you can disable this for a
possible performance improvement at the cost of caching.

Default: ``True``

.. deprecated:: 2.2
Will be removed in Flask 2.3. Set ``app.json.sort_keys``
instead.

.. py:data:: JSONIFY_PRETTYPRINT_REGULAR
:func:`~flask.jsonify` responses will be output with newlines,
spaces, and indentation for easier reading by humans. Always enabled
in debug mode.

Default: ``False``

.. deprecated:: 2.2
Will be removed in Flask 2.3. Set ``app.json.compact`` instead.

.. py:data:: JSONIFY_MIMETYPE
The mimetype of ``jsonify`` responses.

Default: ``'application/json'``

.. deprecated:: 2.2
Will be removed in Flask 2.3. Set ``app.json.mimetype`` instead.

.. py:data:: TEMPLATES_AUTO_RELOAD
Reload templates when they are changed. If not set, it will be enabled in
Expand Down Expand Up @@ -381,14 +323,13 @@ The following configuration values are used internally by Flask:
.. versionchanged:: 2.2
Removed ``PRESERVE_CONTEXT_ON_EXCEPTION``.

.. versionchanged:: 2.2
``JSON_AS_ASCII``, ``JSON_SORT_KEYS``,
``JSONIFY_MIMETYPE``, and ``JSONIFY_PRETTYPRINT_REGULAR`` will be
removed in Flask 2.3. The default ``app.json`` provider has
.. versionchanged:: 2.3
``JSON_AS_ASCII``, ``JSON_SORT_KEYS``, ``JSONIFY_MIMETYPE``, and
``JSONIFY_PRETTYPRINT_REGULAR`` were removed. The default ``app.json`` provider has
equivalent attributes instead.

.. versionchanged:: 2.2
``ENV`` will be removed in Flask 2.3. Use ``--debug`` instead.
.. versionchanged:: 2.3
``ENV`` was removed.


Configuring from Python Files
Expand Down
4 changes: 2 additions & 2 deletions src/flask/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __getattr__(name):
from .globals import __app_ctx_stack

warnings.warn(
"'_app_ctx_stack' is deprecated and will be removed in Flask 2.3.",
"'_app_ctx_stack' is deprecated and will be removed in Flask 2.4.",
DeprecationWarning,
stacklevel=2,
)
Expand All @@ -62,7 +62,7 @@ def __getattr__(name):
from .globals import __request_ctx_stack

warnings.warn(
"'_request_ctx_stack' is deprecated and will be removed in Flask 2.3.",
"'_request_ctx_stack' is deprecated and will be removed in Flask 2.4.",
DeprecationWarning,
stacklevel=2,
)
Expand Down
Loading

0 comments on commit 6650764

Please sign in to comment.