]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Drop EOL Python 3.6 (#2097)
authorOfek Lev <ofekmeister@gmail.com>
Wed, 30 Mar 2022 15:31:05 +0000 (11:31 -0400)
committerGitHub <noreply@github.com>
Wed, 30 Mar 2022 15:31:05 +0000 (17:31 +0200)
Co-authored-by: Florimond Manca <florimond.manca@protonmail.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
.github/workflows/test-suite.yml
README.md
README_chinese.md
docs/index.md
httpx/_client.py
httpx/_compat.py
setup.py

index 86b4a03d4a7eb5e7a0811421c0ac863cf7575e65..7209fc2bf0aaa89391137b8ebaba3c207e8303f4 100644 (file)
@@ -14,7 +14,7 @@ jobs:
 
     strategy:
       matrix:
-        python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
+        python-version: ["3.7", "3.8", "3.9", "3.10"]
 
     steps:
       - uses: "actions/checkout@v2"
index 23866adbbdca66f33a7acb27165bfe588a1b8919..188272a122ec14ccd3f4bbef0bb469719e173ef6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -140,7 +140,6 @@ As well as these optional installs:
 * `rich` - Rich terminal support. *(Optional, with `httpx[cli]`)*
 * `click` - Command line client support. *(Optional, with `httpx[cli]`)*
 * `brotli` or `brotlicffi` - Decoding for "brotli" compressed responses. *(Optional, with `httpx[brotli]`)*
-* `async_generator` - Backport support for `contextlib.asynccontextmanager`. *(Only required for Python 3.6)*
 
 A huge amount of credit is due to `requests` for the API layout that
 much of this work follows, as well as to `urllib3` for plenty of design
index 0daa78c610c403f4190bcd5c0b4f65aa9302610d..f8400a7644513bbabfdb746c866733cc79986e7a 100644 (file)
@@ -86,7 +86,7 @@ HTTPX将并为您提供以下功能:
 * 支持HTTP(S) 代理
 * 支持设定timeout
 * 流式下载
-* 支持 .netrc 
+* 支持 .netrc
 * 接收Chunked编码
 
 ## 安装
@@ -111,7 +111,7 @@ HTTPX 要求 Python 3.6版本或更高.
 
 想学习基础知识?请访问 [快速开始](https://www.python-httpx.org/quickstart/).
 
-想获得进阶帮助? 请访问 [Advanced Usage](https://www.python-httpx.org/advanced/) 来获得答案, 不妨来看看 [异步支持](https://www.python-httpx.org/async/) 或者 [HTTP/2](https://www.python-httpx.org/http2/) 
+想获得进阶帮助? 请访问 [Advanced Usage](https://www.python-httpx.org/advanced/) 来获得答案, 不妨来看看 [异步支持](https://www.python-httpx.org/async/) 或者 [HTTP/2](https://www.python-httpx.org/http2/)
 
 [Developer Interface](https://www.python-httpx.org/api/) 提供了全面的API参考。
 
@@ -136,7 +136,6 @@ HTTPX项目依赖于这些优秀的库:
 * `rich` - Rich terminal support. *(Optional, with `httpx[cli]`)*
 * `click` - Command line client support. *(Optional, with `httpx[cli]`)*
 * `brotli` or `brotlicffi` - Decoding for "brotli" compressed responses. *(Optional, with `httpx[brotli]`)*
-* `async_generator` - Backport support for `contextlib.asynccontextmanager`. *(Only required for Python 3.6)*
 
 A huge amount of credit is due to `requests` for the API layout that
 much of this work follows, as well as to `urllib3` for plenty of design
index 2b3865bb8e064170309c7e37c5a19c4c40141c85..6032f6af0a7fda05490c55ba9c765e387b2a1335 100644 (file)
@@ -121,7 +121,6 @@ As well as these optional installs:
 * `rich` - Rich terminal support. *(Optional, with `httpx[cli]`)*
 * `click` - Command line client support. *(Optional, with `httpx[cli]`)*
 * `brotli` or `brotlicffi` - Decoding for "brotli" compressed responses. *(Optional, with `httpx[brotli]`)*
-* `async_generator` - Backport support for `contextlib.asynccontextmanager`. *(Only required for Python 3.6)*
 
 A huge amount of credit is due to `requests` for the API layout that
 much of this work follows, as well as to `urllib3` for plenty of design
index c57cfb6ea9c03bc302d5be00d10fb561bc527daf..cec0d63589c9040c8709a93ff579a073de74a3f3 100644 (file)
@@ -2,12 +2,11 @@ import datetime
 import enum
 import typing
 import warnings
-from contextlib import contextmanager
+from contextlib import asynccontextmanager, contextmanager
 from types import TracebackType
 
 from .__version__ import __version__
 from ._auth import Auth, BasicAuth, FunctionAuth
-from ._compat import asynccontextmanager
 from ._config import (
     DEFAULT_LIMITS,
     DEFAULT_MAX_REDIRECTS,
index e7680242e537d5d1e94b0c6fab2a784cfd362f10..6d96ad27a1bc74b3c1a7b1d70340aa78b22da401 100644 (file)
@@ -5,13 +5,6 @@ Python environments. It is excluded from the code coverage checks.
 import ssl
 import sys
 
-# `contextlib.asynccontextmanager` exists from Python 3.7 onwards.
-# For 3.6 we require the `async_generator` package for a backported version.
-if sys.version_info >= (3, 7):
-    from contextlib import asynccontextmanager  # type: ignore
-else:
-    from async_generator import asynccontextmanager  # type: ignore # noqa
-
 # Brotli support is optional
 # The C bindings in `brotli` are recommended for CPython.
 # The CFFI bindings in `brotlicffi` are recommended for PyPy and everything else.
index 50aa35960aa0cf00c7521656c0c5ca18e3124967..86a7d976f91a77b78efcaf4a35b402ab45be6a94 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -37,7 +37,7 @@ def get_packages(package):
 
 setup(
     name="httpx",
-    python_requires=">=3.6",
+    python_requires=">=3.7",
     version=get_version("httpx"),
     url="https://github.com/encode/httpx",
     project_urls={