Drop support for Python 3.7 (#2813)

* Drop Python 3.7 support

* Fix lint

* Changelog
This commit is contained in:
Iurii Pliner 2023-08-09 10:02:28 +01:00 committed by GitHub
parent 76c9cb65f2
commit b40c04dfa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 22 additions and 22 deletions

View File

@ -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"

View File

@ -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"

View File

@ -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)

View File

@ -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

View File

@ -101,7 +101,7 @@ $ pip install httpx
$ pip install httpx[http2]
```
HTTPX 要求 Python 3.7+ 版本。
HTTPX 要求 Python 3.8+ 版本。
## 文档

View File

@ -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

View File

@ -17,7 +17,7 @@ except ImportError: # pragma: no cover
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:

View File

@ -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",

View File

@ -1,6 +1,5 @@
import os
import ssl
import sys
from pathlib import Path
import certifi
@ -176,28 +175,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():