Repository: mitogen-hq/mitogen (language: python)

Issue:
Python 3.13 support



Discussion / hints:
Affected by https://github.com/python/cpython/issues/115911, may be a blocker or require caveats on functionality

Fix patch:
diff --git a/README.md b/README.md
index e29546720..c3cd9a87d 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
 # Mitogen
 
+[![PyPI - Version](https://img.shields.io/pypi/v/mitogen)](https://pypi.org/project/mitogen/)
+[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mitogen)](https://pypi.org/project/mitogen/)
 [![Build Status](https://img.shields.io/github/actions/workflow/status/mitogen-hq/mitogen/tests.yml?branch=master)](https://github.com/mitogen-hq/mitogen/actions?query=branch%3Amaster)
 
 <a href="https://mitogen.networkgenomics.com/">Please see the documentation</a>.
diff --git a/docs/ansible_detailed.rst b/docs/ansible_detailed.rst
index 0d7966912..73ebba4dd 100644
--- a/docs/ansible_detailed.rst
+++ b/docs/ansible_detailed.rst
@@ -132,13 +132,13 @@ Noteworthy Differences
   | 5               | 3.8 - 3.11      |
   +-----------------+-----------------+
   | 6               |                 |
-  +-----------------+ 3.8 - 3.12      |
+  +-----------------+ 3.8 - 3.13      |
   | 7               |                 |
   +-----------------+-----------------+
-  | 8               | 3.9 - 3.12      |
+  | 8               | 3.9 - 3.13      |
   +-----------------+-----------------+
   | 9               |                 |
-  +-----------------+ 3.10 - 3.12     |
+  +-----------------+ 3.10 - 3.13     |
   | 10              |                 |
   +-----------------+-----------------+
 
diff --git a/docs/changelog.rst b/docs/changelog.rst
index 4f545615c..f00de0712 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -26,6 +26,7 @@ In Progress (unreleased)
 * :gh:issue:`1116` :mod:`ansible_mitogen`: Support for templated variable
   `ansible_ssh_user`.
 * :gh:issue:`978` :mod:`ansible_mitogen`: Support templated Ansible SSH port.
+* :gh:issue:`1073` Python 3.13 support
 
 
 v0.3.11 (2024-10-07)
diff --git a/setup.py b/setup.py
index b17dab9dd..9cb304272 100644
--- a/setup.py
+++ b/setup.py
@@ -79,6 +79,7 @@ def long_description():
         'Programming Language :: Python :: 3.10',
         'Programming Language :: Python :: 3.11',
         'Programming Language :: Python :: 3.12',
+        'Programming Language :: Python :: 3.13',
         'Programming Language :: Python :: Implementation :: CPython',
         'Topic :: System :: Distributed Computing',
         'Topic :: System :: Systems Administration',
diff --git a/tox.ini b/tox.ini
index 7677ed27d..6a0eb1806 100644
--- a/tox.ini
+++ b/tox.ini
@@ -55,10 +55,10 @@ envlist =
     init,
     py{27,36}-mode_ansible-ansible{2.10,3,4},
     py{311}-mode_ansible-ansible{2.10,3,4,5},
-    py{312}-mode_ansible-ansible{6,7,8,9,10},
-    py{27,36,312}-mode_mitogen-distro_centos{6,7,8},
-    py{27,36,312}-mode_mitogen-distro_debian{9,10,11},
-    py{27,36,312}-mode_mitogen-distro_ubuntu{1604,1804,2004},
+    py{313}-mode_ansible-ansible{6,7,8,9,10},
+    py{27,36,313}-mode_mitogen-distro_centos{6,7,8},
+    py{27,36,313}-mode_mitogen-distro_debian{9,10,11},
+    py{27,36,313}-mode_mitogen-distro_ubuntu{1604,1804,2004},
     report,
 
 [testenv]
@@ -73,6 +73,7 @@ basepython =
     py310: python3.10
     py311: python3.11
     py312: python3.12
+    py313: python3.13
 deps =
     -r{toxinidir}/tests/requirements.txt
     mode_ansible: -r{toxinidir}/tests/ansible/requirements.txt


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 2c819e7d9..f3f31d82f 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -48,24 +48,24 @@ jobs:
           - name: Ans_311_5
             python_version: '3.11'
             tox_env: py311-mode_ansible-ansible5
-          - name: Ans_312_6
-            python_version: '3.12'
-            tox_env: py312-mode_ansible-ansible6
-          - name: Ans_312_7
-            python_version: '3.12'
-            tox_env: py312-mode_ansible-ansible7
-          - name: Ans_312_8
-            python_version: '3.12'
-            tox_env: py312-mode_ansible-ansible8
-          - name: Ans_312_9
-            python_version: '3.12'
-            tox_env: py312-mode_ansible-ansible9
-          - name: Ans_312_10
-            python_version: '3.12'
-            tox_env: py312-mode_ansible-ansible10
-          - name: Van_312_10
-            python_version: '3.12'
-            tox_env: py312-mode_ansible-ansible10-strategy_linear
+          - name: Ans_313_6
+            python_version: '3.13'
+            tox_env: py313-mode_ansible-ansible6
+          - name: Ans_313_7
+            python_version: '3.13'
+            tox_env: py313-mode_ansible-ansible7
+          - name: Ans_313_8
+            python_version: '3.13'
+            tox_env: py313-mode_ansible-ansible8
+          - name: Ans_313_9
+            python_version: '3.13'
+            tox_env: py313-mode_ansible-ansible9
+          - name: Ans_313_10
+            python_version: '3.13'
+            tox_env: py313-mode_ansible-ansible10
+          - name: Van_313_10
+            python_version: '3.13'
+            tox_env: py313-mode_ansible-ansible10-strategy_linear
 
           - name: Mito_27_centos6
             tox_env: py27-mode_mitogen-distro_centos6
@@ -114,33 +114,33 @@ jobs:
             python_version: '3.6'
             tox_env: py36-mode_mitogen-distro_ubuntu2004
 
-          - name: Mito_312_centos6
-            python_version: '3.12'
-            tox_env: py312-mode_mitogen-distro_centos6
-          - name: Mito_312_centos7
-            python_version: '3.12'
-            tox_env: py312-mode_mitogen-distro_centos7
-          - name: Mito_312_centos8
-            python_version: '3.12'
-            tox_env: py312-mode_mitogen-distro_centos8
-          - name: Mito_312_debian9
-            python_version: '3.12'
-            tox_env: py312-mode_mitogen-distro_debian9
-          - name: Mito_312_debian10
-            python_version: '3.12'
-            tox_env: py312-mode_mitogen-distro_debian10
-          - name: Mito_312_debian11
-            python_version: '3.12'
-            tox_env: py312-mode_mitogen-distro_debian11
-          - name: Mito_312_ubuntu1604
-            python_version: '3.12'
-            tox_env: py312-mode_mitogen-distro_ubuntu1604
-          - name: Mito_312_ubuntu1804
-            python_version: '3.12'
-            tox_env: py312-mode_mitogen-distro_ubuntu1804
-          - name: Mito_312_ubuntu2004
-            python_version: '3.12'
-            tox_env: py312-mode_mitogen-distro_ubuntu2004
+          - name: Mito_313_centos6
+            python_version: '3.13'
+            tox_env: py313-mode_mitogen-distro_centos6
+          - name: Mito_313_centos7
+            python_version: '3.13'
+            tox_env: py313-mode_mitogen-distro_centos7
+          - name: Mito_313_centos8
+            python_version: '3.13'
+            tox_env: py313-mode_mitogen-distro_centos8
+          - name: Mito_313_debian9
+            python_version: '3.13'
+            tox_env: py313-mode_mitogen-distro_debian9
+          - name: Mito_313_debian10
+            python_version: '3.13'
+            tox_env: py313-mode_mitogen-distro_debian10
+          - name: Mito_313_debian11
+            python_version: '3.13'
+            tox_env: py313-mode_mitogen-distro_debian11
+          - name: Mito_313_ubuntu1604
+            python_version: '3.13'
+            tox_env: py313-mode_mitogen-distro_ubuntu1604
+          - name: Mito_313_ubuntu1804
+            python_version: '3.13'
+            tox_env: py313-mode_mitogen-distro_ubuntu1804
+          - name: Mito_313_ubuntu2004
+            python_version: '3.13'
+            tox_env: py313-mode_mitogen-distro_ubuntu2004
 
     steps:
       - uses: actions/checkout@v4
@@ -232,18 +232,21 @@ jobs:
         include:
           - name: Mito_27
             tox_env: py27-mode_mitogen
-          - name: Mito_312
-            tox_env: py312-mode_mitogen
+          - name: Mito_313
+            python_version: '3.13'
+            tox_env: py313-mode_mitogen
 
           - name: Loc_27_210
             tox_env: py27-mode_localhost-ansible2.10
-          - name: Loc_312_10
-            tox_env: py312-mode_localhost-ansible10
+          - name: Loc_313_10
+            python_version: '3.13'
+            tox_env: py313-mode_localhost-ansible10
 
           - name: Van_27_210
             tox_env: py27-mode_localhost-ansible2.10-strategy_linear
-          - name: Van_312_10
-            tox_env: py312-mode_localhost-ansible10-strategy_linear
+          - name: Van_313_10
+            python_version: '3.13'
+            tox_env: py313-mode_localhost-ansible10-strategy_linear
 
     steps:
       - uses: actions/checkout@v4
diff --git a/tests/requirements.txt b/tests/requirements.txt
index d64d8b873..c5671b37e 100644
--- a/tests/requirements.txt
+++ b/tests/requirements.txt
@@ -1,5 +1,5 @@
 cffi==1.15.1;               python_version < '3.8'
-cffi==1.16;                 python_version >= '3.8'
+cffi==1.17.1;               python_version >= '3.8'
 
 coverage==5.5;              python_version == '2.7'
 coverage==6.2;              python_version == '3.6'