Skip to content

Commit

Permalink
Drop support for Python 3.7 (#2813)
Browse files Browse the repository at this point in the history
* Drop Python 3.7 support

* Fix lint

* Changelog
  • Loading branch information
Pliner committed Aug 9, 2023
1 parent 76c9cb6 commit b40c04d
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion README_chinese.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ $ pip install httpx
$ pip install httpx[http2]
```

HTTPX 要求 Python 3.7+ 版本。
HTTPX 要求 Python 3.8+ 版本。

## 文档

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion httpx/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
]
Expand All @@ -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",
Expand Down
25 changes: 11 additions & 14 deletions tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import ssl
import sys
from pathlib import Path

import certifi
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit b40c04d

Please sign in to comment.