From 73612fb4187a41307625cfae6f306897d4c351cd Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sun, 16 Jan 2022 20:37:54 -0500 Subject: [PATCH] build: Add python 3.10 to CI. Remove 3.6 --- .github/workflows/test.yml | 2 ++ docs/index.rst | 2 +- pyproject.toml | 2 +- setup.cfg | 2 +- setup.py | 4 ++-- tornado/test/process_test.py | 9 ++++++--- tornado/testing.py | 2 +- tox.ini | 8 ++++---- 8 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8cbd8629d7..f41494303f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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. diff --git a/docs/index.rst b/docs/index.rst index 6f59bd7085..7877be8c3b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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 `_ 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 `_ if compatibility with Python 2.7 is required). The following optional packages may be useful: diff --git a/pyproject.toml b/pyproject.toml index 73200f4f44..29e9dab68a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.cibuildwheel] -build = "cp3[789]*" +build = "cp3[789]* cp310*" test-command = "python -m tornado.test" [tool.cibuildwheel.macos] diff --git a/setup.cfg b/setup.cfg index a365d2c33c..e8bf80679f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,7 +2,7 @@ license_file = LICENSE [mypy] -python_version = 3.6 +python_version = 3.7 no_implicit_optional = True [mypy-tornado.*,tornado.platform.*] diff --git a/setup.py b/setup.py index 7c9b35c5af..3f82314d04 100644 --- a/setup.py +++ b/setup.py @@ -138,7 +138,7 @@ def build_extension(self, ext): if setuptools is not None: - python_requires = ">= 3.6" + python_requires = ">= 3.7" kwargs["python_requires"] = python_requires setup( @@ -180,10 +180,10 @@ def build_extension(self, ext): 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", ], diff --git a/tornado/test/process_test.py b/tornado/test/process_test.py index 6ff8efde7b..4e80dc8459 100644 --- a/tornado/test/process_test.py +++ b/tornado/test/process_test.py @@ -82,9 +82,12 @@ def get_url(path): 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]) + + asyncio.run(f()) elif id == 2: self.assertEqual(id, task_id()) sock.close() diff --git a/tornado/testing.py b/tornado/testing.py index 45e72c8b31..088530cb76 100644 --- a/tornado/testing.py +++ b/tornado/testing.py @@ -248,7 +248,7 @@ def tearDown(self) -> None: 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 diff --git a/tox.ini b/tox.ini index 6c267598d3..56e01a810e 100644 --- a/tox.ini +++ b/tox.ini @@ -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.