drop support for python 3.7
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by David Lord · parent 9659b11 · Browse files · 14 files·+19 added−40 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
14 files+19 added−40 removed
- tests:+1 added−3 removed
- other:+18 added−37 removed
Provenance
- Commit
2e8fe7b- Tree
d645f6b- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
9659b11
14 files changed+19 added−40 removed
modified:.github/workflows/tests.yaml+1 added-2 removed
29 unmodified lines3031323334343537363738394017 unmodified lines29 unmodified lines - {name: '3.12-dev', python: '3.12-dev', os: ubuntu-latest, tox: py312} - {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310} - {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39} - {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38} - {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37} - {name: 'PyPy', python: 'pypy-3.9', os: ubuntu-latest, tox: pypy39} - {name: 'Minimum Versions', python: '3.11', os: ubuntu-latest, tox: py311-min} - {name: 'Development Versions', python: '3.7', os: ubuntu-latest, tox: py37-dev} - {name: 'Development Versions', python: '3.8', os: ubuntu-latest, tox: py38-dev} - {name: Typing, python: '3.11', os: ubuntu-latest, tox: typing} steps: - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e043517 unmodified linesmodified:docs/extensiondev.rst+2 added-3 removed
291 unmodified lines292 8. The extension's dependencies should not use upper bounds or assume293 any particular version scheme, but should use lower bounds to294 indicate minimum compatibility support. For example,295 ``sqlalchemy>=1.4``.296-9. Indicate the versions of Python supported using297- ``python_requires=">=version"``. Flask itself supports Python >=3.7298- as of December 2021, but this will update over time.296+9. Indicate the versions of Python supported using ``python_requires=">=version"``.297+ Flask itself supports Python >=3.8 as of April 2023, but this will update over time.298 299 .. _PyPI: https://pypi.org/search/?c=Framework+%3A%3A+Flask300 .. _Discord Chat: https://discord.gg/pallets301 .. _GitHub Discussions: https://github.com/pallets/flask/discussions2 unmodified linesmodified:docs/installation.rst+1 added-2 removed
3 unmodified lines4 5 Python Version6 --------------7 8-We recommend using the latest version of Python. Flask supports Python9-3.7 and newer.8+We recommend using the latest version of Python. Flask supports Python 3.8 and newer.9 10 11 Dependencies12 ------------132 unmodified linesmodified:examples/celery/pyproject.toml+1 added-1 removed
12345667891011[project]name = "flask-example-celery"version = "1.0.0"description = "Example Flask application with Celery background tasks."readme = "README.md"requires-python = ">=3.7"requires-python = ">=3.8"dependencies = ["flask>=2.2.2", "celery[redis]>=5.2.7"]
[build-system]requires = ["setuptools"]build-backend = "setuptools.build_meta"modified:requirements/tests.in+1 added-1 removed
1 pytest2 asgiref3 greenlet ; python_version < "3.11"4-python-dotenv>=1; python_version >= "3.8"4+python-dotenvmodified:requirements/tests.txt+2 added-2 removed
1-# SHA1:3c8dde35aba20388b22430b17974af8ef8205b4f1+# SHA1:42d37aff22e2f1fc447e20d483e13d6d4e066b102 #3 # This file is autogenerated by pip-compile-multi4 # To update, run:5 #8 unmodified lines14 pluggy==1.0.015 # via pytest16 pytest==7.3.117 # via -r requirements/tests.in18-python-dotenv==1.0.0 ; python_version >= "3.8"18+python-dotenv==1.0.019 # via -r requirements/tests.inmodified:src/flask/app.py+2 added-17 removed
1 from __future__ import annotations2 3-import functools4-import inspect3 import logging4 import os5 import sys6 import typing as t7 import weakref8 from collections.abc import Iterator as _abc_Iterator9 from datetime import timedelta10+from inspect import iscoroutinefunction11 from itertools import chain12 from types import TracebackType13 from urllib.parse import quote as _url_quote14 53 unmodified lines68 from .wrappers import Request69 from .wrappers import Response70 71 if t.TYPE_CHECKING: # pragma: no cover73- import typing_extensions as te72 from .blueprints import Blueprint73 from .testing import FlaskClient74 from .testing import FlaskCliRunner75 4 unmodified lines80 T_template_filter = t.TypeVar("T_template_filter", bound=ft.TemplateFilterCallable)81 T_template_global = t.TypeVar("T_template_global", bound=ft.TemplateGlobalCallable)82 T_template_test = t.TypeVar("T_template_test", bound=ft.TemplateTestCallable)83 86-if sys.version_info >= (3, 8):87- iscoroutinefunction = inspect.iscoroutinefunction88-else:84 90- def iscoroutinefunction(func: t.Any) -> bool:91- while inspect.ismethod(func):92- func = func.__func__93-94- while isinstance(func, functools.partial):95- func = func.func96-97- return inspect.iscoroutinefunction(func)98-99-85 def _make_timedelta(value: timedelta | int | None) -> timedelta | None:86 if value is None or isinstance(value, timedelta):87 return value88 1325 unmodified lines1414 self.logger.error(1415 f"Exception on {request.path} [{request.method}]", exc_info=exc_info1416 )1417 1433- def raise_routing_exception(self, request: Request) -> te.NoReturn:1418+ def raise_routing_exception(self, request: Request) -> t.NoReturn:1419 """Intercept routing exceptions and possibly do something else.1420 1421 In debug mode, intercept a routing redirect and replace it with1422 an error if the body will be discarded.791 unmodified linesmodified:src/flask/helpers.py+1 added-2 removed
23 unmodified lines24 25 if t.TYPE_CHECKING: # pragma: no cover26 from werkzeug.wrappers import Response as BaseResponse27 from .wrappers import Response28- import typing_extensions as te28 29 30 def get_debug_flag() -> bool:31 """Get whether debug mode should be enabled for the app, indicated by the223 unmodified lines255 256 return _wz_redirect(location, code=code, Response=Response)257 258 260-def abort(code: int | BaseResponse, *args: t.Any, **kwargs: t.Any) -> te.NoReturn:259+def abort(code: int | BaseResponse, *args: t.Any, **kwargs: t.Any) -> t.NoReturn:260 """Raise an :exc:`~werkzeug.exceptions.HTTPException` for the given261 status code.262 263 If :data:`~flask.current_app` is available, it will call its430 unmodified linesmodified:src/flask/sessions.py+1 added-2 removed
11 unmodified lines12 13 from .json.tag import TaggedJSONSerializer14 15 if t.TYPE_CHECKING: # pragma: no cover16- import typing_extensions as te16 from .app import Flask17 from .wrappers import Request, Response18 19 72 unmodified lines92 available. Will still allow read-only access to the empty session93 but fail on setting.94 """95 97- def _fail(self, *args: t.Any, **kwargs: t.Any) -> te.NoReturn:96+ def _fail(self, *args: t.Any, **kwargs: t.Any) -> t.NoReturn:97 raise RuntimeError(98 "The session is unavailable because no secret "99 "key was set. Set the secret_key on the "100 "application to something unique and secret."265 unmodified linesmodified:tests/typing/typing_route.py+1 added-3 removed
1 unmodified line2 3 import typing as t4 from http import HTTPStatus5 6-import typing_extensions as te7-6 from flask import Flask7 from flask import jsonify8 from flask import stream_template9 from flask.templating import render_template27 unmodified lines37 def hello_json_list() -> t.List[t.Any]:38 return [{"message": "Hello"}, {"message": "World"}]39 40 43-class StatusJSON(te.TypedDict):41+class StatusJSON(t.TypedDict):42 status: str43 44 45 @app.route("/typed-dict")67 unmodified linesmodified:.pre-commit-config.yaml+1 added-1 removed
4 unmodified lines5 - repo: https://github.com/asottile/pyupgrade6 rev: v3.3.17 hooks:8 - id: pyupgrade9- args: ["--py37-plus"]9+ args: ["--py38-plus"]10 - repo: https://github.com/asottile/reorder_python_imports11 rev: v3.9.012 hooks:13 - id: reorder-python-imports24 unmodified linesmodified:CHANGES.rst+1 added
1 unmodified line2 -------------3 4 Unreleased5 6+- Drop support for Python 3.7. :pr:`5072`7 - Remove previously deprecated code. :pr:`4995`8 9 - The ``push`` and ``pop`` methods of the deprecated ``_app_ctx_stack`` and10 ``_request_ctx_stack`` objects are removed. ``top`` still exists to give1467 unmodified linesmodified:pyproject.toml+2 added-2 removed
16 unmodified lines17 "Topic :: Internet :: WWW/HTTP :: WSGI",18 "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",19 "Topic :: Software Development :: Libraries :: Application Frameworks",20 ]21-requires-python = ">=3.7"21+requires-python = ">=3.8"22 dependencies = [23 "Werkzeug>=2.2.2",24 "Jinja2>=3.0",25 "itsdangerous>=2.0",40 unmodified lines66 [tool.coverage.paths]67 source = ["src", "*/site-packages"]68 69 [tool.mypy]70-python_version = "3.7"70+python_version = "3.8"71 files = ["src/flask"]72 show_error_codes = true73 pretty = true74 #strict = true23 unmodified linesmodified:tox.ini+2 added-2 removed
1 [tox]2 envlist =3- py3{12,11,10,9,8,7}3+ py3{12,11,10,9,8}4 pypy395 py311-min6- py37-dev6+ py38-dev7 style8 typing9 docs10 skip_missing_interpreters = true40 unmodified lines