]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Add support for Python 3.12 (#2854)
authorHugo van Kemenade <hugovk@users.noreply.github.com>
Thu, 21 Sep 2023 14:35:56 +0000 (08:35 -0600)
committerGitHub <noreply@github.com>
Thu, 21 Sep 2023 14:35:56 +0000 (15:35 +0100)
* Add support for Python 3.12

* Bump GitHub Actions

* Remove redundant version checks

* Add CHANGELOG entry

.github/workflows/publish.yml
.github/workflows/test-suite.yml
CHANGELOG.md
httpx/_compat.py
httpx/_config.py
pyproject.toml

index 3cbd4a8a2dc327cce2f67853582803f5f2c06286..4ceb8c69e04017299f88b840938c967daf93981a 100644 (file)
@@ -14,7 +14,7 @@ jobs:
        name: deploy
 
     steps:
-      - uses: "actions/checkout@v3"
+      - uses: "actions/checkout@v4"
       - uses: "actions/setup-python@v4"
         with:
           python-version: 3.8
index eb1cc7e22e16dea33d875079c5166102ef5542ae..c3ad08f14544d976a2520a74578ed41feb6fda71 100644 (file)
@@ -14,13 +14,14 @@ jobs:
 
     strategy:
       matrix:
-        python-version: ["3.8", "3.9", "3.10", "3.11"]
+        python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
 
     steps:
-      - uses: "actions/checkout@v3"
+      - uses: "actions/checkout@v4"
       - uses: "actions/setup-python@v4"
         with:
           python-version: "${{ matrix.python-version }}"
+          allow-prereleases: true
       - name: "Install dependencies"
         run: "scripts/install"
       - name: "Run linting checks"
index 4842dfff8247592c80246840315f7ca02f6e10ff..73b99c6b17228bdd2f5338f88794b8325e0081ce 100644 (file)
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
 
 ## Unreleased
 
+### Added
+
+* Add support for Python 3.12. (#2854)
+
 ### Fixed
 
 * Raise `ValueError` on `Response.encoding` being set after `Response.text` has been accessed. (#2852)
index a271c6b800893183d20cdf688a31774077472f87..493e6210873f325422e0b2087827bd8c95e70e56 100644 (file)
@@ -16,9 +16,7 @@ except ImportError:  # pragma: no cover
     except ImportError:
         brotli = None
 
-if sys.version_info >= (3, 10) or (
-    sys.version_info >= (3, 8) and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0, 7)
-):
+if sys.version_info >= (3, 10) or ssl.OPENSSL_VERSION_INFO >= (1, 1, 0, 7):
 
     def set_minimum_tls_version_1_2(context: ssl.SSLContext) -> None:
         # The OP_NO_SSL* and OP_NO_TLS* become deprecated in favor of
index 39d81a20a02ee5bdbcc923f4f168e77b23175d37..45ed29ed70520bce8898317c9cf7a1795adf59c8 100644 (file)
@@ -1,7 +1,6 @@
 import logging
 import os
 import ssl
-import sys
 import typing
 from pathlib import Path
 
@@ -128,11 +127,10 @@ class SSLConfig:
 
         # Signal to server support for PHA in TLS 1.3. Raises an
         # AttributeError if only read-only access is implemented.
-        if sys.version_info >= (3, 8):  # pragma: no cover
-            try:
-                context.post_handshake_auth = True
-            except AttributeError:  # pragma: no cover
-                pass
+        try:
+            context.post_handshake_auth = True
+        except AttributeError:  # pragma: no cover
+            pass
 
         # Disable using 'commonName' for SSLContext.check_hostname
         # when the 'subjectAltName' extension isn't available.
@@ -168,10 +166,9 @@ class SSLConfig:
             alpn_idents = ["http/1.1", "h2"] if self.http2 else ["http/1.1"]
             context.set_alpn_protocols(alpn_idents)
 
-        if sys.version_info >= (3, 8):  # pragma: no cover
-            keylogfile = os.environ.get("SSLKEYLOGFILE")
-            if keylogfile and self.trust_env:
-                context.keylog_filename = keylogfile
+        keylogfile = os.environ.get("SSLKEYLOGFILE")
+        if keylogfile and self.trust_env:
+            context.keylog_filename = keylogfile
 
         return context
 
index 753e671ebc37f32579ebeb510a083cd52dee4a60..baa92e9a433f3a66c98c8ca5f14705023ee4e425 100644 (file)
@@ -24,6 +24,7 @@ classifiers = [
     "Programming Language :: Python :: 3.9",
     "Programming Language :: Python :: 3.10",
     "Programming Language :: Python :: 3.11",
+    "Programming Language :: Python :: 3.12",
     "Topic :: Internet :: WWW/HTTP",
 ]
 dependencies = [