mirror of https://github.com/pallets/flask.git
Merge branch '2.2.x'
This commit is contained in:
commit
7464e17c5e
|
|
@ -3,7 +3,7 @@ ci:
|
||||||
autoupdate_schedule: monthly
|
autoupdate_schedule: monthly
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v3.2.2
|
rev: v3.3.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: ["--py37-plus"]
|
args: ["--py37-plus"]
|
||||||
|
|
@ -15,7 +15,7 @@ repos:
|
||||||
files: "^(?!examples/)"
|
files: "^(?!examples/)"
|
||||||
args: ["--application-directories", "src"]
|
args: ["--application-directories", "src"]
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 22.10.0
|
rev: 22.12.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
- repo: https://github.com/PyCQA/flake8
|
- repo: https://github.com/PyCQA/flake8
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@ Unreleased
|
||||||
- Autoescaping is now enabled by default for ``.svg`` files. Inside
|
- Autoescaping is now enabled by default for ``.svg`` files. Inside
|
||||||
templates this behavior can be changed with the ``autoescape`` tag.
|
templates this behavior can be changed with the ``autoescape`` tag.
|
||||||
:issue:`4831`
|
:issue:`4831`
|
||||||
|
- Fix the type of ``template_folder`` to accept ``pathlib.Path``. :issue:`4892`
|
||||||
|
|
||||||
|
|
||||||
Version 2.2.2
|
Version 2.2.2
|
||||||
-------------
|
-------------
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ Start coding
|
||||||
|
|
||||||
$ git push --set-upstream fork your-branch-name
|
$ git push --set-upstream fork your-branch-name
|
||||||
|
|
||||||
.. _committing as you go: https://dont-be-afraid-to-commit.readthedocs.io/en/latest/git/commandlinegit.html#commit-your-changes
|
.. _committing as you go: https://afraid-to-commit.readthedocs.io/en/latest/git/commandlinegit.html#commit-your-changes
|
||||||
.. _create a pull request: https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request
|
.. _create a pull request: https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -248,7 +248,7 @@ HTML ``<script>`` tags.
|
||||||
.. sourcecode:: html+jinja
|
.. sourcecode:: html+jinja
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const names = {{ names|tosjon }};
|
const names = {{ names|tojson }};
|
||||||
renderChart(names, {{ axis_data|tojson }});
|
renderChart(names, {{ axis_data|tojson }});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ Debug Mode
|
||||||
|
|
||||||
The :data:`DEBUG` config value is special because it may behave inconsistently if
|
The :data:`DEBUG` config value is special because it may behave inconsistently if
|
||||||
changed after the app has begun setting up. In order to set debug mode reliably, use the
|
changed after the app has begun setting up. In order to set debug mode reliably, use the
|
||||||
``--debug`` option on the ``flask`` command.``flask run`` will use the interactive
|
``--debug`` option on the ``flask`` command. ``flask run`` will use the interactive
|
||||||
debugger and reloader by default in debug mode.
|
debugger and reloader by default in debug mode.
|
||||||
|
|
||||||
.. code-block:: text
|
.. code-block:: text
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,7 @@ class's :meth:`~views.View.as_view` method.
|
||||||
def __init__(self, model):
|
def __init__(self, model):
|
||||||
self.model = model
|
self.model = model
|
||||||
|
|
||||||
def get(id):
|
def get(self, id):
|
||||||
post = self.model.query.get(id)
|
post = self.model.query.get(id)
|
||||||
return jsonify(post.to_json())
|
return jsonify(post.to_json())
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ exist yet, it is dynamically created and remembered::
|
||||||
|
|
||||||
from threading import Lock
|
from threading import Lock
|
||||||
|
|
||||||
class SubdomainDispatcher(object):
|
class SubdomainDispatcher:
|
||||||
|
|
||||||
def __init__(self, domain, create_app):
|
def __init__(self, domain, create_app):
|
||||||
self.domain = domain
|
self.domain = domain
|
||||||
|
|
@ -148,7 +148,7 @@ request path up to the first slash::
|
||||||
from threading import Lock
|
from threading import Lock
|
||||||
from werkzeug.wsgi import pop_path_info, peek_path_info
|
from werkzeug.wsgi import pop_path_info, peek_path_info
|
||||||
|
|
||||||
class PathDispatcher(object):
|
class PathDispatcher:
|
||||||
|
|
||||||
def __init__(self, default_app, create_app):
|
def __init__(self, default_app, create_app):
|
||||||
self.default_app = default_app
|
self.default_app = default_app
|
||||||
|
|
|
||||||
|
|
@ -256,7 +256,7 @@ provide get (list) and post (create) methods.
|
||||||
return self.model.query.get_or_404(id)
|
return self.model.query.get_or_404(id)
|
||||||
|
|
||||||
def get(self, id):
|
def get(self, id):
|
||||||
user = self._get_item(id)
|
item = self._get_item(id)
|
||||||
return jsonify(item.to_json())
|
return jsonify(item.to_json())
|
||||||
|
|
||||||
def patch(self, id):
|
def patch(self, id):
|
||||||
|
|
|
||||||
|
|
@ -10,19 +10,25 @@
|
||||||
-r typing.txt
|
-r typing.txt
|
||||||
build==0.9.0
|
build==0.9.0
|
||||||
# via pip-tools
|
# via pip-tools
|
||||||
|
cachetools==5.2.0
|
||||||
|
# via tox
|
||||||
cfgv==3.3.1
|
cfgv==3.3.1
|
||||||
# via pre-commit
|
# via pre-commit
|
||||||
|
chardet==5.1.0
|
||||||
|
# via tox
|
||||||
click==8.1.3
|
click==8.1.3
|
||||||
# via
|
# via
|
||||||
# pip-compile-multi
|
# pip-compile-multi
|
||||||
# pip-tools
|
# pip-tools
|
||||||
|
colorama==0.4.6
|
||||||
|
# via tox
|
||||||
distlib==0.3.6
|
distlib==0.3.6
|
||||||
# via virtualenv
|
# via virtualenv
|
||||||
filelock==3.8.0
|
filelock==3.8.2
|
||||||
# via
|
# via
|
||||||
# tox
|
# tox
|
||||||
# virtualenv
|
# virtualenv
|
||||||
identify==2.5.9
|
identify==2.5.11
|
||||||
# via pre-commit
|
# via pre-commit
|
||||||
nodeenv==1.7.0
|
nodeenv==1.7.0
|
||||||
# via pre-commit
|
# via pre-commit
|
||||||
|
|
@ -30,25 +36,25 @@ pep517==0.13.0
|
||||||
# via build
|
# via build
|
||||||
pip-compile-multi==2.6.1
|
pip-compile-multi==2.6.1
|
||||||
# via -r requirements/dev.in
|
# via -r requirements/dev.in
|
||||||
pip-tools==6.10.0
|
pip-tools==6.12.1
|
||||||
# via pip-compile-multi
|
# via pip-compile-multi
|
||||||
platformdirs==2.5.4
|
platformdirs==2.6.0
|
||||||
# via virtualenv
|
# via
|
||||||
|
# tox
|
||||||
|
# virtualenv
|
||||||
pre-commit==2.20.0
|
pre-commit==2.20.0
|
||||||
# via -r requirements/dev.in
|
# via -r requirements/dev.in
|
||||||
py==1.11.0
|
pyproject-api==1.2.1
|
||||||
# via tox
|
# via tox
|
||||||
pyyaml==6.0
|
pyyaml==6.0
|
||||||
# via pre-commit
|
# via pre-commit
|
||||||
six==1.16.0
|
|
||||||
# via tox
|
|
||||||
toml==0.10.2
|
toml==0.10.2
|
||||||
# via pre-commit
|
# via pre-commit
|
||||||
toposort==1.7
|
toposort==1.7
|
||||||
# via pip-compile-multi
|
# via pip-compile-multi
|
||||||
tox==3.27.1
|
tox==4.0.16
|
||||||
# via -r requirements/dev.in
|
# via -r requirements/dev.in
|
||||||
virtualenv==20.16.7
|
virtualenv==20.17.1
|
||||||
# via
|
# via
|
||||||
# pre-commit
|
# pre-commit
|
||||||
# tox
|
# tox
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ alabaster==0.7.12
|
||||||
# via sphinx
|
# via sphinx
|
||||||
babel==2.11.0
|
babel==2.11.0
|
||||||
# via sphinx
|
# via sphinx
|
||||||
certifi==2022.9.24
|
certifi==2022.12.7
|
||||||
# via requests
|
# via requests
|
||||||
charset-normalizer==2.1.1
|
charset-normalizer==2.1.1
|
||||||
# via requests
|
# via requests
|
||||||
|
|
@ -25,19 +25,17 @@ jinja2==3.1.2
|
||||||
# via sphinx
|
# via sphinx
|
||||||
markupsafe==2.1.1
|
markupsafe==2.1.1
|
||||||
# via jinja2
|
# via jinja2
|
||||||
packaging==21.3
|
packaging==22.0
|
||||||
# via
|
# via
|
||||||
# pallets-sphinx-themes
|
# pallets-sphinx-themes
|
||||||
# sphinx
|
# sphinx
|
||||||
pallets-sphinx-themes==2.0.2
|
pallets-sphinx-themes==2.0.3
|
||||||
# via -r requirements/docs.in
|
# via -r requirements/docs.in
|
||||||
pygments==2.13.0
|
pygments==2.13.0
|
||||||
# via
|
# via
|
||||||
# sphinx
|
# sphinx
|
||||||
# sphinx-tabs
|
# sphinx-tabs
|
||||||
pyparsing==3.0.9
|
pytz==2022.7
|
||||||
# via packaging
|
|
||||||
pytz==2022.6
|
|
||||||
# via babel
|
# via babel
|
||||||
requests==2.28.1
|
requests==2.28.1
|
||||||
# via sphinx
|
# via sphinx
|
||||||
|
|
|
||||||
|
|
@ -5,20 +5,18 @@
|
||||||
#
|
#
|
||||||
# pip-compile-multi
|
# pip-compile-multi
|
||||||
#
|
#
|
||||||
asgiref==3.5.2
|
asgiref==3.6.0
|
||||||
# via -r requirements/tests.in
|
# via -r requirements/tests.in
|
||||||
attrs==22.1.0
|
attrs==22.2.0
|
||||||
# via pytest
|
# via pytest
|
||||||
blinker==1.5
|
blinker==1.5
|
||||||
# via -r requirements/tests.in
|
# via -r requirements/tests.in
|
||||||
iniconfig==1.1.1
|
iniconfig==1.1.1
|
||||||
# via pytest
|
# via pytest
|
||||||
packaging==21.3
|
packaging==22.0
|
||||||
# via pytest
|
# via pytest
|
||||||
pluggy==1.0.0
|
pluggy==1.0.0
|
||||||
# via pytest
|
# via pytest
|
||||||
pyparsing==3.0.9
|
|
||||||
# via packaging
|
|
||||||
pytest==7.2.0
|
pytest==7.2.0
|
||||||
# via -r requirements/tests.in
|
# via -r requirements/tests.in
|
||||||
python-dotenv==0.21.0
|
python-dotenv==0.21.0
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
#
|
#
|
||||||
cffi==1.15.1
|
cffi==1.15.1
|
||||||
# via cryptography
|
# via cryptography
|
||||||
cryptography==38.0.3
|
cryptography==38.0.4
|
||||||
# via -r requirements/typing.in
|
# via -r requirements/typing.in
|
||||||
mypy==0.991
|
mypy==0.991
|
||||||
# via -r requirements/typing.in
|
# via -r requirements/typing.in
|
||||||
|
|
@ -19,7 +19,7 @@ types-contextvars==2.4.7
|
||||||
# via -r requirements/typing.in
|
# via -r requirements/typing.in
|
||||||
types-dataclasses==0.6.6
|
types-dataclasses==0.6.6
|
||||||
# via -r requirements/typing.in
|
# via -r requirements/typing.in
|
||||||
types-setuptools==65.6.0.1
|
types-setuptools==65.6.0.2
|
||||||
# via -r requirements/typing.in
|
# via -r requirements/typing.in
|
||||||
typing-extensions==4.4.0
|
typing-extensions==4.4.0
|
||||||
# via mypy
|
# via mypy
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,8 @@ ignore =
|
||||||
E722
|
E722
|
||||||
# bin op line break, invalid
|
# bin op line break, invalid
|
||||||
W503
|
W503
|
||||||
|
# requires Python 3.10
|
||||||
|
B905
|
||||||
# up to 88 allowed by bugbear B950
|
# up to 88 allowed by bugbear B950
|
||||||
max-line-length = 80
|
max-line-length = 80
|
||||||
per-file-ignores =
|
per-file-ignores =
|
||||||
|
|
|
||||||
|
|
@ -558,7 +558,7 @@ class Flask(Scaffold):
|
||||||
static_host: t.Optional[str] = None,
|
static_host: t.Optional[str] = None,
|
||||||
host_matching: bool = False,
|
host_matching: bool = False,
|
||||||
subdomain_matching: bool = False,
|
subdomain_matching: bool = False,
|
||||||
template_folder: t.Optional[str] = "templates",
|
template_folder: t.Optional[t.Union[str, os.PathLike]] = "templates",
|
||||||
instance_path: t.Optional[str] = None,
|
instance_path: t.Optional[str] = None,
|
||||||
instance_relative_config: bool = False,
|
instance_relative_config: bool = False,
|
||||||
root_path: t.Optional[str] = None,
|
root_path: t.Optional[str] = None,
|
||||||
|
|
|
||||||
|
|
@ -250,7 +250,7 @@ class Blueprint(Scaffold):
|
||||||
import_name: str,
|
import_name: str,
|
||||||
static_folder: t.Optional[t.Union[str, os.PathLike]] = None,
|
static_folder: t.Optional[t.Union[str, os.PathLike]] = None,
|
||||||
static_url_path: t.Optional[str] = None,
|
static_url_path: t.Optional[str] = None,
|
||||||
template_folder: t.Optional[str] = None,
|
template_folder: t.Optional[t.Union[str, os.PathLike]] = None,
|
||||||
url_prefix: t.Optional[str] = None,
|
url_prefix: t.Optional[str] = None,
|
||||||
subdomain: t.Optional[str] = None,
|
subdomain: t.Optional[str] = None,
|
||||||
url_defaults: t.Optional[dict] = None,
|
url_defaults: t.Optional[dict] = None,
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ class Scaffold:
|
||||||
import_name: str,
|
import_name: str,
|
||||||
static_folder: t.Optional[t.Union[str, os.PathLike]] = None,
|
static_folder: t.Optional[t.Union[str, os.PathLike]] = None,
|
||||||
static_url_path: t.Optional[str] = None,
|
static_url_path: t.Optional[str] = None,
|
||||||
template_folder: t.Optional[str] = None,
|
template_folder: t.Optional[t.Union[str, os.PathLike]] = None,
|
||||||
root_path: t.Optional[str] = None,
|
root_path: t.Optional[str] = None,
|
||||||
):
|
):
|
||||||
#: The name of the package or module that this object belongs
|
#: The name of the package or module that this object belongs
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue