Skip to content
Myr

Drop support for Python 3.7 (#2813)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Drop Python 3.7 support * Fix lint * Changelog

authored by Iurii Pliner · committed by GitHub · parent 76c9cb6 · Browse files · 9 files+22 added−22 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

9 files+22 added−22 removed

  • tests:+11 added−14 removed
  • other:+11 added−8 removed

9 files+22 added−22 removed

modified:.github/workflows/publish.yml+1 added-1 removed
modified:.github/workflows/test-suite.yml+1 added-1 removed
modified:docs/index.md+1 added-1 removed
142 unmodified lines
143```shell144$ pip install httpx[brotli]145```146147HTTPX requires Python 3.7+147HTTPX requires Python 3.8+148149[sync-support]: https://github.com/encode/httpx/issues/572
modified:httpx/_compat.py+1 added-1 removed
15 unmodified lines
16 except ImportError:17 brotli = None1819if sys.version_info >= (3, 10) or (20 sys.version_info >= (3, 7) and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0, 7)20 sys.version_info >= (3, 8) and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0, 7)21):2223 def set_minimum_tls_version_1_2(context: ssl.SSLContext) -> None:24 # The OP_NO_SSL* and OP_NO_TLS* become deprecated in favor of
19 unmodified lines
modified:tests/test_config.py+11 added-14 removed
1import os2import ssl3import sys3from pathlib import Path45import certifi6import pytest
167 unmodified lines
174@pytest.mark.skipif(175 not hasattr(ssl.SSLContext, "keylog_filename"),176 reason="requires OpenSSL 1.1.1 or higher",177)179@pytest.mark.skipif(sys.version_info < (3, 8), reason="requires python3.8 or higher")178def test_ssl_config_support_for_keylog_file(tmpdir, monkeypatch): # pragma: no cover181 if sys.version_info > (3, 8):182 with monkeypatch.context() as m:183 m.delenv("SSLKEYLOGFILE", raising=False)179 with monkeypatch.context() as m:180 m.delenv("SSLKEYLOGFILE", raising=False)181185 context = httpx.create_ssl_context(trust_env=True)182 context = httpx.create_ssl_context(trust_env=True)183187 assert context.keylog_filename is None184 assert context.keylog_filename is None185189 filename = str(tmpdir.join("test.log"))186 filename = str(tmpdir.join("test.log"))187191 with monkeypatch.context() as m:192 m.setenv("SSLKEYLOGFILE", filename)188 with monkeypatch.context() as m:189 m.setenv("SSLKEYLOGFILE", filename)190194 context = httpx.create_ssl_context(trust_env=True)191 context = httpx.create_ssl_context(trust_env=True)192196 assert context.keylog_filename == filename193 assert context.keylog_filename == filename194198 context = httpx.create_ssl_context(trust_env=False)195 context = httpx.create_ssl_context(trust_env=False)196200 assert context.keylog_filename is None197 assert context.keylog_filename is None198199200def test_proxy_from_url():201 proxy = httpx.Proxy("https://example.com")
19 unmodified lines
modified:CHANGELOG.md+4 added
4 unmodified lines
5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).67## Unreleased89### Removed1011* Drop support for Python 3.7. (#2813)1213### Added1415* Add `socket_options` argument to `httpx.HTTPTransport` and `httpx.AsyncHTTPTransport` classes. (#2716)16* The `Response.raise_for_status()` method now returns the response instance. For example: `data = httpx.get('...').raise_for_status().json()`. (#2776)
1017 unmodified lines
modified:pyproject.toml+1 added-2 removed
modified:README_chinese.md+1 added-1 removed
99 unmodified lines
100```shell101$ pip install httpx[http2]102```103104HTTPX 要求 Python 3.7+ 版本。104HTTPX 要求 Python 3.8+ 版本。105106## 文档107108项目文档现已就绪,请访问 [https://www.python-httpx.org/](https://www.python-httpx.org/) 来阅读。
36 unmodified lines
modified:README.md+1 added-1 removed
101 unmodified lines
102```shell103$ pip install httpx[http2]104```105106HTTPX requires Python 3.7+.106HTTPX requires Python 3.8+.107108## Documentation109110Project documentation is available at [https://www.python-httpx.org/](https://www.python-httpx.org/).
38 unmodified lines