drop Python 3.6

This commit is contained in:
David Lord 2021-11-11 16:11:43 -08:00
parent 3c36d043e5
commit e609dddd60
No known key found for this signature in database
GPG Key ID: 7A1C87E3F5BC42A8
9 changed files with 11 additions and 33 deletions

View File

@ -31,7 +31,6 @@ jobs:
- {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: '3.6', python: '3.6', os: ubuntu-latest, tox: py36}
- {name: 'PyPy', python: 'pypy-3.7', os: ubuntu-latest, tox: pypy37}
- {name: Typing, python: '3.10', os: ubuntu-latest, tox: typing}
steps:

View File

@ -112,10 +112,9 @@ shell with the :func:`shell <cli.shell_command>` command. An application
context will be active, and the app instance will be imported. ::
$ flask shell
Python 3.6.2 (default, Jul 20 2017, 03:52:27)
[GCC 7.1.1 20170630] on linux
App: example
Instance: /home/user/Projects/hello/instance
Python 3.10.0 (default, Oct 27 2021, 06:59:51) [GCC 11.1.0] on linux
App: example [production]
Instance: /home/david/Projects/pallets/flask/instance
>>>
Use :meth:`~Flask.shell_context_processor` to add other automatic imports.

View File

@ -322,9 +322,9 @@ ecosystem remain consistent and compatible.
`Official Pallets Themes`_. A link to the documentation or project
website must be in the PyPI metadata or the readme.
7. For maximum compatibility, the extension should support the same
versions of Python that Flask supports. 3.6+ is recommended as of
2020. Use ``python_requires=">= 3.6"`` in ``setup.py`` to indicate
supported versions.
versions of Python that Flask supports. 3.7+ is recommended as of
December 2021. Use ``python_requires=">= 3.7"`` in ``setup.py`` to
indicate supported versions.
.. _PyPI: https://pypi.org/search/?c=Framework+%3A%3A+Flask
.. _mailinglist: https://mail.python.org/mailman/listinfo/flask

View File

@ -6,9 +6,7 @@ Python Version
--------------
We recommend using the latest version of Python. Flask supports Python
3.6 and newer.
``async`` support in Flask requires Python 3.7+ for ``contextvars.ContextVar``.
3.7 and newer.
Dependencies

View File

@ -35,7 +35,7 @@ classifiers =
packages = find:
package_dir = = src
include_package_data = true
python_requires = >= 3.6
python_requires = >= 3.7
# Dependencies are in setup.py for GitHub's dependency graph.
[options.packages.find]
@ -88,7 +88,7 @@ per-file-ignores =
[mypy]
files = src/flask
python_version = 3.6
python_version = 3.7
allow_redefinition = True
disallow_subclassing_any = True
# disallow_untyped_calls = True

View File

@ -1,3 +1,4 @@
import dataclasses
import decimal
import io
import json as _json
@ -16,12 +17,6 @@ if t.TYPE_CHECKING:
from ..app import Flask
from ..wrappers import Response
try:
import dataclasses
except ImportError:
# Python < 3.7
dataclasses = None # type: ignore
class JSONEncoder(_json.JSONEncoder):
"""The default JSON encoder. Handles extra types compared to the

View File

@ -1,5 +1,4 @@
import asyncio
import sys
import pytest
@ -79,7 +78,6 @@ def _async_app():
return app
@pytest.mark.skipif(sys.version_info < (3, 7), reason="requires Python >= 3.7")
@pytest.mark.parametrize("path", ["/", "/home", "/bp/", "/view", "/methodview"])
def test_async_route(path, async_app):
test_client = async_app.test_client()
@ -89,7 +87,6 @@ def test_async_route(path, async_app):
assert b"POST" in response.get_data()
@pytest.mark.skipif(sys.version_info < (3, 7), reason="requires Python >= 3.7")
@pytest.mark.parametrize("path", ["/error", "/bp/error"])
def test_async_error_handler(path, async_app):
test_client = async_app.test_client()
@ -97,7 +94,6 @@ def test_async_error_handler(path, async_app):
assert response.status_code == 412
@pytest.mark.skipif(sys.version_info < (3, 7), reason="requires Python >= 3.7")
def test_async_before_after_request():
app_first_called = False
app_before_called = False
@ -154,10 +150,3 @@ def test_async_before_after_request():
test_client.get("/bp/")
assert bp_before_called
assert bp_after_called
@pytest.mark.skipif(sys.version_info >= (3, 7), reason="should only raise Python < 3.7")
def test_async_runtime_error():
app = Flask(__name__)
with pytest.raises(RuntimeError):
app.async_to_sync(None)

View File

@ -1,6 +1,5 @@
import gc
import re
import sys
import time
import uuid
import weakref
@ -1323,7 +1322,6 @@ def test_jsonify_mimetype(app, req_ctx):
assert rv.mimetype == "application/vnd.api+json"
@pytest.mark.skipif(sys.version_info < (3, 7), reason="requires Python >= 3.7")
def test_json_dump_dataclass(app, req_ctx):
from dataclasses import make_dataclass

View File

@ -1,6 +1,6 @@
[tox]
envlist =
py3{11,10,9,8,7,6},pypy37
py3{11,10,9,8,7},pypy3{8,7}
py39-click7
style
typing