Skip to content

Commit

Permalink
build: Add python 3.10 to CI. Remove 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
bdarnell committed Jan 17, 2022
1 parent d1442a3 commit 1f8aab8
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.cibuildwheel]
build = "cp3[789]*"
build = "cp3[789]* cp310*"
test-command = "python -m tornado.test"

[tool.cibuildwheel.macos]
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
license_file = LICENSE

[mypy]
python_version = 3.6
python_version = 3.7
no_implicit_optional = True

[mypy-tornado.*,tornado.platform.*]
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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",
],
Expand Down
14 changes: 7 additions & 7 deletions tornado/test/process_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ def get_url(path):
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()
Expand Down
2 changes: 1 addition & 1 deletion tornado/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 1f8aab8

Please sign in to comment.