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