From d52613f0725a28017ce39b66b173b1bd668dec79 Mon Sep 17 00:00:00 2001 From: Iurii Pliner Date: Thu, 15 Jun 2023 20:13:28 +0100 Subject: [PATCH 1/3] Drop Python 3.7 support --- .github/workflows/publish.yml | 2 +- .github/workflows/test-suite.yml | 2 +- README.md | 2 +- README_chinese.md | 2 +- docs/index.md | 2 +- httpx/_compat.py | 2 +- pyproject.toml | 3 +-- tests/test_config.py | 24 +++++++++++------------- 8 files changed, 18 insertions(+), 21 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 053ad289cc..3cbd4a8a2d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,7 +17,7 @@ jobs: - uses: "actions/checkout@v3" - uses: "actions/setup-python@v4" with: - python-version: 3.7 + python-version: 3.8 - name: "Install dependencies" run: "scripts/install" - name: "Build package & docs" diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index f5ad75a4e2..eb1cc7e22e 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: "actions/checkout@v3" diff --git a/README.md b/README.md index 4d25491a6a..62fb295d17 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ Or, to include the optional HTTP/2 support, use: $ pip install httpx[http2] ``` -HTTPX requires Python 3.7+. +HTTPX requires Python 3.8+. ## Documentation diff --git a/README_chinese.md b/README_chinese.md index 0248768323..ad20c5a1bf 100644 --- a/README_chinese.md +++ b/README_chinese.md @@ -101,7 +101,7 @@ $ pip install httpx $ pip install httpx[http2] ``` -HTTPX 要求 Python 3.7+ 版本。 +HTTPX 要求 Python 3.8+ 版本。 ## 文档 diff --git a/docs/index.md b/docs/index.md index cd25ee6ca5..ec9746697d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -144,6 +144,6 @@ To include the optional brotli decoder support, use: $ pip install httpx[brotli] ``` -HTTPX requires Python 3.7+ +HTTPX requires Python 3.8+ [sync-support]: https://github.com/encode/httpx/issues/572 diff --git a/httpx/_compat.py b/httpx/_compat.py index a9b9c63072..a271c6b800 100644 --- a/httpx/_compat.py +++ b/httpx/_compat.py @@ -17,7 +17,7 @@ brotli = None if sys.version_info >= (3, 10) or ( - sys.version_info >= (3, 7) and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0, 7) + sys.version_info >= (3, 8) and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0, 7) ): def set_minimum_tls_version_1_2(context: ssl.SSLContext) -> None: diff --git a/pyproject.toml b/pyproject.toml index 30228c120e..acd41baf3a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" name = "httpx" description = "The next generation HTTP client." license = "BSD-3-Clause" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "Tom Christie", email = "tom@tomchristie.com" }, ] @@ -20,7 +20,6 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/tests/test_config.py b/tests/test_config.py index d496cd4a0e..efc2540940 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -176,28 +176,26 @@ def test_timeout_repr(): not hasattr(ssl.SSLContext, "keylog_filename"), reason="requires OpenSSL 1.1.1 or higher", ) -@pytest.mark.skipif(sys.version_info < (3, 8), reason="requires python3.8 or higher") def test_ssl_config_support_for_keylog_file(tmpdir, monkeypatch): # pragma: no cover - if sys.version_info > (3, 8): - with monkeypatch.context() as m: - m.delenv("SSLKEYLOGFILE", raising=False) + with monkeypatch.context() as m: + m.delenv("SSLKEYLOGFILE", raising=False) - context = httpx.create_ssl_context(trust_env=True) + context = httpx.create_ssl_context(trust_env=True) - assert context.keylog_filename is None + assert context.keylog_filename is None - filename = str(tmpdir.join("test.log")) + filename = str(tmpdir.join("test.log")) - with monkeypatch.context() as m: - m.setenv("SSLKEYLOGFILE", filename) + with monkeypatch.context() as m: + m.setenv("SSLKEYLOGFILE", filename) - context = httpx.create_ssl_context(trust_env=True) + context = httpx.create_ssl_context(trust_env=True) - assert context.keylog_filename == filename + assert context.keylog_filename == filename - context = httpx.create_ssl_context(trust_env=False) + context = httpx.create_ssl_context(trust_env=False) - assert context.keylog_filename is None + assert context.keylog_filename is None def test_proxy_from_url(): From 722b86f11c9f991063e742ead488bc0e2aababec Mon Sep 17 00:00:00 2001 From: Iurii Pliner Date: Thu, 15 Jun 2023 20:19:34 +0100 Subject: [PATCH 2/3] Fix lint --- tests/test_config.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_config.py b/tests/test_config.py index efc2540940..00913b2c17 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,6 +1,5 @@ import os import ssl -import sys from pathlib import Path import certifi From 1510a44d36ead5afd26fe7f1697ef603a530d33f Mon Sep 17 00:00:00 2001 From: Iurii Pliner Date: Thu, 3 Aug 2023 12:53:54 +0100 Subject: [PATCH 3/3] Changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d5ea6d2fe..a4f49c45d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## Unreleased +### Removed + +* Drop support for Python 3.7. (#2813) + ### Added * Add `socket_options` argument to `httpx.HTTPTransport` and `httpx.AsyncHTTPTransport` classes. (#2716)