build: Add python 3.10 to CI. Remove 3.6

This commit is contained in:
Ben Darnell 2022-01-16 20:37:54 -05:00
parent d1442a388b
commit 1f8aab8ba7
8 changed files with 19 additions and 17 deletions

View File

@ -42,6 +42,8 @@ jobs:
tox_env: py38-full
- python: '3.9'
tox_env: py39-full
- python: '3.10'
tox_env: py310-full
- python: 'pypy-3.8'
# Pypy is a lot slower due to jit warmup costs, so don't run the
# "full" test config there.

View File

@ -96,7 +96,7 @@ installed in this way, so you may wish to download a copy of the
source tarball or clone the `git repository
<https://github.com/tornadoweb/tornado>`_ as well.
**Prerequisites**: Tornado 6.0 requires Python 3.6 or newer (See
**Prerequisites**: Tornado 6.0 requires Python 3.7 or newer (See
`Tornado 5.1 <https://www.tornadoweb.org/en/branch5.1/>`_ if
compatibility with Python 2.7 is required). The following optional
packages may be useful:

View File

@ -1,5 +1,5 @@
[tool.cibuildwheel]
build = "cp3[789]*"
build = "cp3[789]* cp310*"
test-command = "python -m tornado.test"
[tool.cibuildwheel.macos]

View File

@ -2,7 +2,7 @@
license_file = LICENSE
[mypy]
python_version = 3.6
python_version = 3.7
no_implicit_optional = True
[mypy-tornado.*,tornado.platform.*]

View File

@ -138,7 +138,7 @@ if (
if setuptools is not None:
python_requires = ">= 3.6"
python_requires = ">= 3.7"
kwargs["python_requires"] = python_requires
setup(
@ -180,10 +180,10 @@ setup(
classifiers=[
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],

View File

@ -76,15 +76,15 @@ class ProcessTest(unittest.TestCase):
sock.close()
return
try:
if asyncio is not None:
# Reset the global asyncio event loop, which was put into
# a broken state by the fork.
asyncio.set_event_loop(asyncio.new_event_loop())
if id in (0, 1):
self.assertEqual(id, task_id())
server = HTTPServer(self.get_app())
server.add_sockets([sock])
IOLoop.current().start()
async def f():
server = HTTPServer(self.get_app())
server.add_sockets([sock])
await asyncio.Event().wait()
asyncio.run(f())
elif id == 2:
self.assertEqual(id, task_id())
sock.close()

View File

@ -248,7 +248,7 @@ class AsyncTestCase(unittest.TestCase):
tasks = asyncio.Task.all_tasks(asyncio_loop)
# Tasks that are done may still appear here and may contain
# non-cancellation exceptions, so filter them out.
tasks = [t for t in tasks if not t.done()]
tasks = [t for t in tasks if not t.done()] # type: ignore
for t in tasks:
t.cancel()
# Allow the tasks to run and finalize themselves (which means

View File

@ -13,7 +13,7 @@
[tox]
envlist =
# Basic configurations: Run the tests for each python version.
py36-full,py37-full,py38-full,py39-full,pypy3-full
py37-full,py38-full,py39-full,py310-full,pypy3-full
# Build and test the docs with sphinx.
docs
@ -27,10 +27,10 @@ whitelist_externals = /bin/sh
[testenv]
basepython =
py3: python3
py36: python3.6
py37: python3.7
py38: python3.8
py39: python3.9
py310: python3.10
pypy3: pypy3
# In theory, it doesn't matter which python version is used here.
# In practice, things like changes to the ast module can alter
@ -49,7 +49,7 @@ deps =
setenv =
# Treat the extension as mandatory in testing (but not on pypy)
{py3,py36,py37,py38,py39}: TORNADO_EXTENSION=1
{py3,py37,py38,py39,py310}: TORNADO_EXTENSION=1
# CI workers are often overloaded and can cause our tests to exceed
# the default timeout of 5s.
ASYNC_TEST_TIMEOUT=25
@ -61,7 +61,7 @@ setenv =
# during sdist installation (and it doesn't seem to be
# possible to set environment variables during that phase of
# tox).
{py3,py36,py37,py38,py39,pypy3}: PYTHONWARNINGS=error:::tornado
{py3,py37,py38,py39,py310,pypy3}: PYTHONWARNINGS=error:::tornado
# All non-comment lines but the last must end in a backslash.