Skip to content

Commit

Permalink
Merge pull request #4007 from pallets/release-2.0.0
Browse files Browse the repository at this point in the history
Release 2.0.0
  • Loading branch information
davidism authored May 11, 2021
2 parents 9c1e7f6 + f8e63d3 commit 2f0c62f
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 49 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Version 2.0.0
-------------

Unreleased
Released 2021-05-11

- Drop support for Python 2 and 3.5.
- Bump minimum versions of other Pallets projects: Werkzeug >= 2,
Expand Down
1 change: 1 addition & 0 deletions requirements/dev.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
-r docs.in
-r tests.in
-r typing.in
pip-tools
pre-commit
tox
42 changes: 27 additions & 15 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ appdirs==1.4.4
# via virtualenv
asgiref==3.3.4
# via -r requirements/tests.in
attrs==20.3.0
attrs==21.2.0
# via pytest
babel==2.9.0
babel==2.9.1
# via sphinx
blinker==1.4
# via -r requirements/tests.in
Expand All @@ -22,19 +22,21 @@ cfgv==3.2.0
# via pre-commit
chardet==4.0.0
# via requests
click==7.1.2
click==8.0.0
# via pip-tools
distlib==0.3.1
# via virtualenv
docutils==0.16
# via sphinx
# via
# sphinx
# sphinx-tabs
filelock==3.0.12
# via
# tox
# virtualenv
greenlet==1.0.0
greenlet==1.1.0
# via -r requirements/tests.in
identify==2.2.3
identify==2.2.4
# via pre-commit
idna==2.10
# via requests
Expand All @@ -45,7 +47,13 @@ iniconfig==1.1.1
jinja2==2.11.3
# via sphinx
markupsafe==1.1.1
# via jinja2
# via
# jinja2
# sphinx
mypy-extensions==0.4.3
# via mypy
mypy==0.812
# via -r requirements/typing.in
nodeenv==1.6.0
# via pre-commit
packaging==20.9
Expand All @@ -54,7 +62,7 @@ packaging==20.9
# pytest
# sphinx
# tox
pallets-sphinx-themes==2.0.0rc1
pallets-sphinx-themes==2.0.0
# via -r requirements/docs.in
pep517==0.10.0
# via pip-tools
Expand All @@ -70,13 +78,13 @@ py==1.10.0
# via
# pytest
# tox
pygments==2.8.1
pygments==2.9.0
# via
# sphinx
# sphinx-tabs
pyparsing==2.4.7
# via packaging
pytest==6.2.3
pytest==6.2.4
# via -r requirements/tests.in
python-dotenv==0.17.1
# via -r requirements/tests.in
Expand All @@ -86,17 +94,17 @@ pyyaml==5.4.1
# via pre-commit
requests==2.25.1
# via sphinx
six==1.15.0
six==1.16.0
# via
# tox
# virtualenv
snowballstemmer==2.1.0
# via sphinx
sphinx-issues==1.2.0
# via -r requirements/docs.in
sphinx-tabs==2.1.0
sphinx-tabs==3.0.0
# via -r requirements/docs.in
sphinx==3.5.4
sphinx==4.0.1
# via
# -r requirements/docs.in
# pallets-sphinx-themes
Expand All @@ -123,11 +131,15 @@ toml==0.10.2
# pre-commit
# pytest
# tox
tox==3.23.0
tox==3.23.1
# via -r requirements/dev.in
typed-ast==1.4.3
# via mypy
typing-extensions==3.10.0.0
# via mypy
urllib3==1.26.4
# via requests
virtualenv==20.4.3
virtualenv==20.4.6
# via
# pre-commit
# tox
Expand Down
2 changes: 1 addition & 1 deletion requirements/docs.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pallets-Sphinx-Themes >= 2.0.0rc1
Pallets-Sphinx-Themes
Sphinx
sphinx-issues
sphinxcontrib-log-cabinet
Expand Down
18 changes: 11 additions & 7 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,33 @@
#
alabaster==0.7.12
# via sphinx
babel==2.9.0
babel==2.9.1
# via sphinx
certifi==2020.12.5
# via requests
chardet==4.0.0
# via requests
docutils==0.16
# via sphinx
# via
# sphinx
# sphinx-tabs
idna==2.10
# via requests
imagesize==1.2.0
# via sphinx
jinja2==2.11.3
# via sphinx
markupsafe==1.1.1
# via jinja2
# via
# jinja2
# sphinx
packaging==20.9
# via
# pallets-sphinx-themes
# sphinx
pallets-sphinx-themes==2.0.0rc1
pallets-sphinx-themes==2.0.0
# via -r requirements/docs.in
pygments==2.8.1
pygments==2.9.0
# via
# sphinx
# sphinx-tabs
Expand All @@ -42,9 +46,9 @@ snowballstemmer==2.1.0
# via sphinx
sphinx-issues==1.2.0
# via -r requirements/docs.in
sphinx-tabs==2.1.0
sphinx-tabs==3.0.0
# via -r requirements/docs.in
sphinx==3.5.4
sphinx==4.0.1
# via
# -r requirements/docs.in
# pallets-sphinx-themes
Expand Down
6 changes: 3 additions & 3 deletions requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
#
asgiref==3.3.4
# via -r requirements/tests.in
attrs==20.3.0
attrs==21.2.0
# via pytest
blinker==1.4
# via -r requirements/tests.in
greenlet==1.0.0
greenlet==1.1.0
# via -r requirements/tests.in
iniconfig==1.1.1
# via pytest
Expand All @@ -22,7 +22,7 @@ py==1.10.0
# via pytest
pyparsing==2.4.7
# via packaging
pytest==6.2.3
pytest==6.2.4
# via -r requirements/tests.in
python-dotenv==0.17.1
# via -r requirements/tests.in
Expand Down
2 changes: 1 addition & 1 deletion requirements/typing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ mypy==0.812
# via -r requirements/typing.in
typed-ast==1.4.3
# via mypy
typing-extensions==3.7.4.3
typing-extensions==3.10.0.0
# via mypy
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
setup(
name="Flask",
install_requires=[
"Werkzeug>=2.0.0rc4",
"Jinja2>=3.0.0rc1",
"itsdangerous>=2.0.0rc2",
"Werkzeug>=2.0",
"Jinja2>=3.0",
"itsdangerous>=2.0",
"click>=7.1.2",
],
extras_require={
Expand Down
2 changes: 1 addition & 1 deletion src/flask/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
from .templating import render_template
from .templating import render_template_string

__version__ = "2.0.0rc2"
__version__ = "2.0.0"
2 changes: 1 addition & 1 deletion src/flask/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ def create_jinja_environment(self) -> Environment:
session=session,
g=g,
)
rv.policies["json.dumps_function"] = json.dumps # type: ignore
rv.policies["json.dumps_function"] = json.dumps
return rv

def create_global_jinja_loader(self) -> DispatchingJinjaLoader:
Expand Down
2 changes: 1 addition & 1 deletion src/flask/json/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import warnings
from datetime import date

from jinja2.utils import htmlsafe_json_dumps as _jinja_htmlsafe_dumps # type: ignore
from jinja2.utils import htmlsafe_json_dumps as _jinja_htmlsafe_dumps
from werkzeug.http import http_date

from ..globals import current_app
Expand Down
13 changes: 8 additions & 5 deletions src/flask/templating.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,21 @@ class DispatchingJinjaLoader(BaseLoader):
def __init__(self, app: "Flask") -> None:
self.app = app

def get_source(
def get_source( # type: ignore
self, environment: Environment, template: str
) -> t.Tuple[str, t.Optional[str], t.Callable]:
) -> t.Tuple[str, t.Optional[str], t.Optional[t.Callable]]:
if self.app.config["EXPLAIN_TEMPLATE_LOADING"]:
return self._get_source_explained(environment, template)
return self._get_source_fast(environment, template)

def _get_source_explained(
self, environment: Environment, template: str
) -> t.Tuple[str, t.Optional[str], t.Callable]:
) -> t.Tuple[str, t.Optional[str], t.Optional[t.Callable]]:
attempts = []
trv = None
rv: t.Optional[t.Tuple[str, t.Optional[str], t.Optional[t.Callable[[], bool]]]]
trv: t.Optional[
t.Tuple[str, t.Optional[str], t.Optional[t.Callable[[], bool]]]
] = None

for srcobj, loader in self._iter_loaders(template):
try:
Expand All @@ -83,7 +86,7 @@ def _get_source_explained(

def _get_source_fast(
self, environment: Environment, template: str
) -> t.Tuple[str, t.Optional[str], t.Callable]:
) -> t.Tuple[str, t.Optional[str], t.Optional[t.Callable]]:
for _srcobj, loader in self._iter_loaders(template):
try:
return loader.get_source(environment, template)
Expand Down
11 changes: 1 addition & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ skip_missing_interpreters = true
deps =
-r requirements/tests.txt

https://github.com/pallets/werkzeug/archive/master.tar.gz
https://github.com/pallets/markupsafe/archive/master.tar.gz
https://github.com/pallets/jinja/archive/master.tar.gz
https://github.com/pallets/itsdangerous/archive/master.tar.gz

!click7: https://github.com/pallets/click/archive/master.tar.gz
click7: click<8

examples/tutorial[test]
Expand All @@ -33,8 +27,5 @@ deps = -r requirements/typing.txt
commands = mypy

[testenv:docs]
deps =
-r requirements/docs.txt

https://github.com/pallets/werkzeug/archive/master.tar.gz
deps = -r requirements/docs.txt
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html

0 comments on commit 2f0c62f

Please sign in to comment.