drop Python 3.6
This commit is contained in:
parent
3c36d043e5
commit
e609dddd60
9 changed files with 11 additions and 33 deletions
1
.github/workflows/tests.yaml
vendored
1
.github/workflows/tests.yaml
vendored
|
|
@ -31,7 +31,6 @@ jobs:
|
||||||
- {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39}
|
- {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39}
|
||||||
- {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}
|
- {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}
|
||||||
- {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37}
|
- {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: 'PyPy', python: 'pypy-3.7', os: ubuntu-latest, tox: pypy37}
|
||||||
- {name: Typing, python: '3.10', os: ubuntu-latest, tox: typing}
|
- {name: Typing, python: '3.10', os: ubuntu-latest, tox: typing}
|
||||||
steps:
|
steps:
|
||||||
|
|
|
||||||
|
|
@ -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. ::
|
context will be active, and the app instance will be imported. ::
|
||||||
|
|
||||||
$ flask shell
|
$ flask shell
|
||||||
Python 3.6.2 (default, Jul 20 2017, 03:52:27)
|
Python 3.10.0 (default, Oct 27 2021, 06:59:51) [GCC 11.1.0] on linux
|
||||||
[GCC 7.1.1 20170630] on linux
|
App: example [production]
|
||||||
App: example
|
Instance: /home/david/Projects/pallets/flask/instance
|
||||||
Instance: /home/user/Projects/hello/instance
|
|
||||||
>>>
|
>>>
|
||||||
|
|
||||||
Use :meth:`~Flask.shell_context_processor` to add other automatic imports.
|
Use :meth:`~Flask.shell_context_processor` to add other automatic imports.
|
||||||
|
|
|
||||||
|
|
@ -322,9 +322,9 @@ ecosystem remain consistent and compatible.
|
||||||
`Official Pallets Themes`_. A link to the documentation or project
|
`Official Pallets Themes`_. A link to the documentation or project
|
||||||
website must be in the PyPI metadata or the readme.
|
website must be in the PyPI metadata or the readme.
|
||||||
7. For maximum compatibility, the extension should support the same
|
7. For maximum compatibility, the extension should support the same
|
||||||
versions of Python that Flask supports. 3.6+ is recommended as of
|
versions of Python that Flask supports. 3.7+ is recommended as of
|
||||||
2020. Use ``python_requires=">= 3.6"`` in ``setup.py`` to indicate
|
December 2021. Use ``python_requires=">= 3.7"`` in ``setup.py`` to
|
||||||
supported versions.
|
indicate supported versions.
|
||||||
|
|
||||||
.. _PyPI: https://pypi.org/search/?c=Framework+%3A%3A+Flask
|
.. _PyPI: https://pypi.org/search/?c=Framework+%3A%3A+Flask
|
||||||
.. _mailinglist: https://mail.python.org/mailman/listinfo/flask
|
.. _mailinglist: https://mail.python.org/mailman/listinfo/flask
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,7 @@ Python Version
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
We recommend using the latest version of Python. Flask supports Python
|
We recommend using the latest version of Python. Flask supports Python
|
||||||
3.6 and newer.
|
3.7 and newer.
|
||||||
|
|
||||||
``async`` support in Flask requires Python 3.7+ for ``contextvars.ContextVar``.
|
|
||||||
|
|
||||||
|
|
||||||
Dependencies
|
Dependencies
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ classifiers =
|
||||||
packages = find:
|
packages = find:
|
||||||
package_dir = = src
|
package_dir = = src
|
||||||
include_package_data = true
|
include_package_data = true
|
||||||
python_requires = >= 3.6
|
python_requires = >= 3.7
|
||||||
# Dependencies are in setup.py for GitHub's dependency graph.
|
# Dependencies are in setup.py for GitHub's dependency graph.
|
||||||
|
|
||||||
[options.packages.find]
|
[options.packages.find]
|
||||||
|
|
@ -88,7 +88,7 @@ per-file-ignores =
|
||||||
|
|
||||||
[mypy]
|
[mypy]
|
||||||
files = src/flask
|
files = src/flask
|
||||||
python_version = 3.6
|
python_version = 3.7
|
||||||
allow_redefinition = True
|
allow_redefinition = True
|
||||||
disallow_subclassing_any = True
|
disallow_subclassing_any = True
|
||||||
# disallow_untyped_calls = True
|
# disallow_untyped_calls = True
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import dataclasses
|
||||||
import decimal
|
import decimal
|
||||||
import io
|
import io
|
||||||
import json as _json
|
import json as _json
|
||||||
|
|
@ -16,12 +17,6 @@ if t.TYPE_CHECKING:
|
||||||
from ..app import Flask
|
from ..app import Flask
|
||||||
from ..wrappers import Response
|
from ..wrappers import Response
|
||||||
|
|
||||||
try:
|
|
||||||
import dataclasses
|
|
||||||
except ImportError:
|
|
||||||
# Python < 3.7
|
|
||||||
dataclasses = None # type: ignore
|
|
||||||
|
|
||||||
|
|
||||||
class JSONEncoder(_json.JSONEncoder):
|
class JSONEncoder(_json.JSONEncoder):
|
||||||
"""The default JSON encoder. Handles extra types compared to the
|
"""The default JSON encoder. Handles extra types compared to the
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
import sys
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
@ -79,7 +78,6 @@ def _async_app():
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(sys.version_info < (3, 7), reason="requires Python >= 3.7")
|
|
||||||
@pytest.mark.parametrize("path", ["/", "/home", "/bp/", "/view", "/methodview"])
|
@pytest.mark.parametrize("path", ["/", "/home", "/bp/", "/view", "/methodview"])
|
||||||
def test_async_route(path, async_app):
|
def test_async_route(path, async_app):
|
||||||
test_client = async_app.test_client()
|
test_client = async_app.test_client()
|
||||||
|
|
@ -89,7 +87,6 @@ def test_async_route(path, async_app):
|
||||||
assert b"POST" in response.get_data()
|
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"])
|
@pytest.mark.parametrize("path", ["/error", "/bp/error"])
|
||||||
def test_async_error_handler(path, async_app):
|
def test_async_error_handler(path, async_app):
|
||||||
test_client = async_app.test_client()
|
test_client = async_app.test_client()
|
||||||
|
|
@ -97,7 +94,6 @@ def test_async_error_handler(path, async_app):
|
||||||
assert response.status_code == 412
|
assert response.status_code == 412
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(sys.version_info < (3, 7), reason="requires Python >= 3.7")
|
|
||||||
def test_async_before_after_request():
|
def test_async_before_after_request():
|
||||||
app_first_called = False
|
app_first_called = False
|
||||||
app_before_called = False
|
app_before_called = False
|
||||||
|
|
@ -154,10 +150,3 @@ def test_async_before_after_request():
|
||||||
test_client.get("/bp/")
|
test_client.get("/bp/")
|
||||||
assert bp_before_called
|
assert bp_before_called
|
||||||
assert bp_after_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)
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import gc
|
import gc
|
||||||
import re
|
import re
|
||||||
import sys
|
|
||||||
import time
|
import time
|
||||||
import uuid
|
import uuid
|
||||||
import weakref
|
import weakref
|
||||||
|
|
@ -1323,7 +1322,6 @@ def test_jsonify_mimetype(app, req_ctx):
|
||||||
assert rv.mimetype == "application/vnd.api+json"
|
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):
|
def test_json_dump_dataclass(app, req_ctx):
|
||||||
from dataclasses import make_dataclass
|
from dataclasses import make_dataclass
|
||||||
|
|
||||||
|
|
|
||||||
2
tox.ini
2
tox.ini
|
|
@ -1,6 +1,6 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist =
|
envlist =
|
||||||
py3{11,10,9,8,7,6},pypy37
|
py3{11,10,9,8,7},pypy3{8,7}
|
||||||
py39-click7
|
py39-click7
|
||||||
style
|
style
|
||||||
typing
|
typing
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue