]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Add python 3.13 betas to test configs
authorBen Darnell <ben@bendarnell.com>
Fri, 7 Jun 2024 20:20:54 +0000 (16:20 -0400)
committerBen Darnell <ben@bendarnell.com>
Sat, 8 Jun 2024 01:24:12 +0000 (21:24 -0400)
Belatedly promote 3.12 to non-beta status

.github/workflows/test.yml
setup.py
tornado/test/process_test.py
tox.ini

index 93b87d5ef1367bdeaba2b4808b09cf2270ce135a..53d4b4c6f308acf9d23d855429294bfac33eb6d3 100644 (file)
@@ -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.
index 8025ad972b7d74212673eab5dbff3d0f10042993..d524bd3f8449c8846b3375287404e370c66eb9c1 100644 (file)
--- 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",
     ],
index ab290085b3efa351433d277f4b332f465eebbe90..1e5b391b63272bb32963765293f451ac3fca61bc 100644 (file)
@@ -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 7eaa5bd8385caae89f84d70b3d4bf9a84e0a71b8..78ab162b02a16fecc293965a950364e0bfeaffc3 100644 (file)
--- 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}