diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e65b5470..b5b53ef7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,6 +55,7 @@ jobs: - '3.9' - '3.10' - '3.11' + - '3.12' steps: - name: Checkout uses: actions/checkout@v2 diff --git a/CHANGES.rst b/CHANGES.rst index 6f613512..1494f4c4 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,8 @@ Changes for croud Unreleased ========== +- Added support for Python 3.12 + 1.12.0 - 2024/08/30 =================== diff --git a/setup.py b/setup.py index 618f2c9b..a44d8a21 100644 --- a/setup.py +++ b/setup.py @@ -87,5 +87,6 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ], ) diff --git a/tests/util/fake_cloud.py b/tests/util/fake_cloud.py index 3081f218..d133def7 100644 --- a/tests/util/fake_cloud.py +++ b/tests/util/fake_cloud.py @@ -51,10 +51,15 @@ def __init__(self, *args, **kwargs): here = pathlib.Path(__file__) self.ssl_cert = here.parent / "server.crt" ssl_key = here.parent / "server.key" - self.socket = ssl.wrap_socket( # type: ignore[attr-defined] + + # Instances of SSLSocket must be created using the SSLContext.wrap_socket() method. + # https://docs.python.org/3.12/library/ssl.html#socket-creation + context = ssl.create_default_context() + context.check_hostname = False + context.load_cert_chain(certfile=str(self.ssl_cert), keyfile=str(ssl_key)) + + self.socket = context.wrap_socket( # type: ignore[attr-defined] self.socket, - keyfile=str(ssl_key), - certfile=str(self.ssl_cert), server_side=True, ) diff --git a/tox.ini b/tox.ini index 1a93b55d..e2a7bb13 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38,py39,py310,py311 +envlist = py38,py39,py310,py311,py312 [testenv] deps = -e{toxinidir}[testing]