Repository: vxgmichel/aiostream (language: python)

Issue:
CI test pipeline doesn't run in Python 3.12: ModuleNotFoundError: No module named 'setuptools'
> Run python setup.py test --addopts "--cov-report xml"
Traceback (most recent call last):
  File "/home/runner/work/aiostream/aiostream/setup.py", line 3, in <module>
    from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'
Error: Process completed with exit code 1.

Solution would be to 
- either drop `setup.py`/`setup.cfg` and switch to `pyproject.toml` and e.g. `hatch`
- or add `setuptools` as dependency for the Python 3.12 build


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9a61bc1..4e61c8c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -20,7 +20,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [ubuntu-latest, macos-latest, windows-latest]
-        python-version: ["3.8", "3.9", "3.10", "3.11", "pypy-3.8"]
+        python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.8"]
 
     env:
       OS: ${{ matrix.os }}
diff --git a/setup.py b/setup.py
index 7b23d87..49f2b11 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,10 @@
     packages=["aiostream", "aiostream.stream"],
     python_requires=">=3.8",
     install_requires=["typing-extensions"],
-    setup_requires=["pytest-runner" if TESTING else ""],
+    setup_requires=[
+        "pytest-runner" if TESTING else "",
+        "setuptools; python_version == '3.12'",
+    ],
     tests_require=["pytest", "pytest-asyncio", "pytest-cov"],
     package_data={
         "aiostream": ["py.typed"],
@@ -29,6 +32,8 @@
         "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
         "Programming Language :: Python :: 3.10",
+        "Programming Language :: Python :: 3.11",
+        "Programming Language :: Python :: 3.12",
     ],
     author="Vincent Michel",
     author_email="vxgmichel@gmail.com",


Test patch:
diff --git a/test-requirements.txt b/test-requirements.txt
index 19f878e..8b5b890 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,3 +1,4 @@
 pytest
 pytest-asyncio
 pytest-cov
+setuptools;python_version >= '3.12'