From: Ben Darnell Date: Fri, 7 Jun 2024 20:20:54 +0000 (-0400) Subject: Add python 3.13 betas to test configs X-Git-Tag: v6.5.0b1~57^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09efc06e2f89f9acf1c8b4503ab62a6b520c9e0b;p=thirdparty%2Ftornado.git Add python 3.13 betas to test configs Belatedly promote 3.12 to non-beta status --- diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 93b87d5e..53d4b4c6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,8 +51,11 @@ jobs: tox_env: py311-full - python: '3.11.0' tox_env: py311-full - - python: '3.12.0-beta.3 - 3.12' + - python: '3.12.0' tox_env: py312-full + - python: '3.13.0-beta.1 - 3.13' + # Some optional dependencies don't seem to work on 3.13 yet + tox_env: py313 - 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/setup.py b/setup.py index 8025ad97..d524bd3f 100644 --- a/setup.py +++ b/setup.py @@ -116,6 +116,7 @@ setuptools.setup( "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "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 ab290085..1e5b391b 100644 --- a/tornado/test/process_test.py +++ b/tornado/test/process_test.py @@ -150,11 +150,19 @@ class SubprocessTest(AsyncTestCase): raise unittest.SkipTest( "Subprocess tests not compatible with " "LayeredTwistedIOLoop" ) + # In Python 3.13.0b1, the new repl logs an error on exit if terminfo + # doesn't exist, the -i flag is used, and stdin is not a tty. This bug may + # have been fixed in beta 2, so for now we disable the new repl in this test + # and the next. Once we've tested with beta 2 we can either remove this env var + # or file a bug upstream if it still exists. + env = dict(os.environ) + env["PYTHON_BASIC_REPL"] = "1" subproc = Subprocess( [sys.executable, "-u", "-i"], stdin=Subprocess.STREAM, stdout=Subprocess.STREAM, stderr=subprocess.STDOUT, + env=env, ) self.addCleanup(lambda: self.term_and_wait(subproc)) self.addCleanup(subproc.stdout.close) @@ -172,11 +180,14 @@ class SubprocessTest(AsyncTestCase): @gen_test def test_close_stdin(self): # Close the parent's stdin handle and see that the child recognizes it. + env = dict(os.environ) + env["PYTHON_BASIC_REPL"] = "1" subproc = Subprocess( [sys.executable, "-u", "-i"], stdin=Subprocess.STREAM, stdout=Subprocess.STREAM, stderr=subprocess.STDOUT, + env=env, ) self.addCleanup(lambda: self.term_and_wait(subproc)) yield subproc.stdout.read_until(b">>> ") diff --git a/tox.ini b/tox.ini index 7eaa5bd8..78ab162b 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ [tox] envlist = # Basic configurations: Run the tests for each python version. - py38-full,py39-full,py310-full,py311-full,pypy3-full + py38-full,py39-full,py310-full,py311-full,py312-full,pypy3-full # Build and test the docs with sphinx. docs @@ -29,6 +29,7 @@ basepython = py310: python3.10 py311: python3.11 py312: python3.12 + py313: python3.13 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 @@ -48,7 +49,7 @@ deps = setenv = # Treat the extension as mandatory in testing (but not on pypy) - {py3,py38,py39,py310,py311,py312}: TORNADO_EXTENSION=1 + {py3,py38,py39,py310,py311,py312,py313}: TORNADO_EXTENSION=1 # CI workers are often overloaded and can cause our tests to exceed # the default timeout of 5s. ASYNC_TEST_TIMEOUT=25 @@ -60,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,py38,py39,py310,py311,pypy3}: PYTHONWARNINGS=error:::tornado + {py3,py38,py39,py310,py311,py312,py313,pypy3}: PYTHONWARNINGS=error:::tornado # Warn if we try to open a file with an unspecified encoding. # (New in python 3.10, becomes obsolete when utf8 becomes the # default in 3.15) @@ -117,5 +118,5 @@ commands = # something new than of depending on something old and deprecated. # But sometimes something we depend on gets removed so we should also # test the newest version. - mypy --platform linux --python-version 3.12 {posargs:tornado} + mypy --platform linux --python-version 3.13 {posargs:tornado} changedir = {toxinidir}