Repository: pika/pika (language: python)

Issue:
Add Python `3.12` to GitHub Actions
Depends on #1469 because `nose2` still uses the `imp` module.


Discussion / hints:
python 3.12 missing in the official support matrix is currently blocking a few package bumps in gentoo linux https://bugs.gentoo.org/929480

I tried to send a mail to the list, but the list is not open to the public.
> I tried to send a mail to the list, but the list is not open to the public.

Yes, this list is open to the public, you must join it first:
https://groups.google.com/g/pika-python

If someone wants to speed up testing with Python 3.12, they can convert the tests to `pytest`. I will get around to it when I have time, but for right now I'm busy working on RabbitMQ issues / support for people who pay for support contracts.

Fix patch:
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index 17b18bd9..2a25f947 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -15,7 +15,7 @@ jobs:
     runs-on: windows-latest
     strategy:
       matrix:
-        python-version: [ 3.8, 3.9, '3.10', '3.11'] # TODO add 3.12
+        python-version: [ 3.8, 3.9, '3.10', '3.11', '3.12' ]
         test-tls: [true, false]
     env:
       PIKA_TEST_TLS: ${{ matrix.test-tls }}
@@ -40,15 +40,14 @@ jobs:
         run: |
           python -m pip install --upgrade pip wheel
           pip install -r test-requirements.txt
-      - name: Test with nose2
-        run: |
-          nose2 -v
+      - name: Test with pynose
+        run: pynose -v
   build:
     name: build/test on ubuntu-latest
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version: [ 3.8, 3.9, '3.10', '3.11'] # TODO add 3.12
+        python-version: [ 3.8, 3.9, '3.10', '3.11', '3.12' ]
     services:
       rabbitmq:
         image: rabbitmq
@@ -67,6 +66,5 @@ jobs:
         run: |
           python -m pip install --upgrade pip wheel
           pip install -r test-requirements.txt
-      - name: Test with nose2
-        run: |
-          nose2 -v
+      - name: Test with pynose
+        run: pynose -v
diff --git a/.github/workflows/publish-pypi.yaml b/.github/workflows/publish-pypi.yaml
index 469f1788..1be527e4 100644
--- a/.github/workflows/publish-pypi.yaml
+++ b/.github/workflows/publish-pypi.yaml
@@ -15,10 +15,10 @@ jobs:
     name: Publish distribution 📦s to PyPI/TestPyPI
     runs-on: ubuntu-latest
     steps:
-        - uses: actions/checkout@v3
-        - uses: actions/setup-python@v4
+        - uses: actions/checkout@v4
+        - uses: actions/setup-python@v5
           with:
-            python-version: '3.11'
+            python-version: '3.12'
         - name: Install pypa/build
           run: python -m pip install build twine --upgrade --user
         - name: Build a binary wheel and a source tarball
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
index 31201e40..bf6f441f 100644
--- a/.readthedocs.yaml
+++ b/.readthedocs.yaml
@@ -9,7 +9,7 @@ version: 2
 build:
   os: ubuntu-22.04
   tools:
-    python: "3.11"
+    python: "3.12"
     # You can also specify other tool versions:
     # nodejs: "19"
     # rust: "1.64"
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 262e1cd4..f25a87d8 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -32,7 +32,7 @@ which on Python 3 might look like this
 
 To run all test suites, use
 
-    nose2
+    pynose
 
 Note that some tests are OS-specific (e.g. epoll on Linux
 or kqueue on MacOS and BSD). Those will be skipped
@@ -56,7 +56,7 @@ If you would like to run TLS/SSL tests, use the following procedure:
 * Run the tests indicating that TLS/SSL connections should be used:
 
     ```
-    PIKA_TEST_TLS=true nose2
+    PIKA_TEST_TLS=true pynose
     ```
 
 
diff --git a/pyproject.toml b/pyproject.toml
index 6148d6bd..2405e5a6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -23,6 +23,7 @@ classifiers = [
     "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 :: Jython",
     "Programming Language :: Python :: Implementation :: PyPy",


Test patch:
diff --git a/test-requirements.txt b/test-requirements.txt
index dd8737ee..5a2254bf 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,8 +1,7 @@
 coverage
 codecov
 gevent
-nose
-nose2
+pynose
 tornado
 twisted
 enum34; python_version == '2.7' or (python_version >= '3.0' and python_version <= '3.4')