diff --git a/CHANGES.rst b/CHANGES.rst index 06e4642560..0001bfe35b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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, diff --git a/requirements/dev.in b/requirements/dev.in index c854000e46..2588467c15 100644 --- a/requirements/dev.in +++ b/requirements/dev.in @@ -1,5 +1,6 @@ -r docs.in -r tests.in +-r typing.in pip-tools pre-commit tox diff --git a/requirements/dev.txt b/requirements/dev.txt index 87466f4bd4..cc5355bfbb 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -86,7 +94,7 @@ pyyaml==5.4.1 # via pre-commit requests==2.25.1 # via sphinx -six==1.15.0 +six==1.16.0 # via # tox # virtualenv @@ -94,9 +102,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 @@ -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 diff --git a/requirements/docs.in b/requirements/docs.in index c1898bc7c0..3ee050af0e 100644 --- a/requirements/docs.in +++ b/requirements/docs.in @@ -1,4 +1,4 @@ -Pallets-Sphinx-Themes >= 2.0.0rc1 +Pallets-Sphinx-Themes Sphinx sphinx-issues sphinxcontrib-log-cabinet diff --git a/requirements/docs.txt b/requirements/docs.txt index 556822522f..1c0acaf660 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -6,14 +6,16 @@ # 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 @@ -21,14 +23,16 @@ imagesize==1.2.0 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 @@ -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 diff --git a/requirements/tests.txt b/requirements/tests.txt index 23f5cf496a..deb93d62a2 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -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 @@ -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 diff --git a/requirements/typing.txt b/requirements/typing.txt index 29e12e5e85..0e342aaad8 100644 --- a/requirements/typing.txt +++ b/requirements/typing.txt @@ -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 diff --git a/setup.py b/setup.py index bfd58e94bd..1b7013ae12 100644 --- a/setup.py +++ b/setup.py @@ -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={ diff --git a/src/flask/__init__.py b/src/flask/__init__.py index a2d92cd4fd..2c7bfbe781 100644 --- a/src/flask/__init__.py +++ b/src/flask/__init__.py @@ -43,4 +43,4 @@ from .templating import render_template from .templating import render_template_string -__version__ = "2.0.0rc2" +__version__ = "2.0.0" diff --git a/src/flask/app.py b/src/flask/app.py index 85306d7cb3..f8856a52f0 100644 --- a/src/flask/app.py +++ b/src/flask/app.py @@ -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: diff --git a/src/flask/json/__init__.py b/src/flask/json/__init__.py index 5a6e4942fe..5780e204c9 100644 --- a/src/flask/json/__init__.py +++ b/src/flask/json/__init__.py @@ -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 diff --git a/src/flask/templating.py b/src/flask/templating.py index 1987d9e96e..bb3e7fd5dd 100644 --- a/src/flask/templating.py +++ b/src/flask/templating.py @@ -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: @@ -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) diff --git a/tox.ini b/tox.ini index 9c772d3834..c24ec0ff7c 100644 --- a/tox.ini +++ b/tox.ini @@ -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] @@ -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