From c6d40f54e187989d9d34295dbcef504625b6054a Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 7 Oct 2024 21:15:18 +0100 Subject: [PATCH] Drop Python 3.8 support Now EOL: https://discuss.python.org/t/python-3-8-is-now-officially-eol/66983 . --- .github/workflows/main.yml | 1 - .pre-commit-config.yaml | 2 +- CHANGELOG.rst | 2 + README.rst | 2 +- pyproject.toml | 6 +- src/apig_wsgi/__init__.py | 10 ++- src/apig_wsgi/compat.py | 11 ++-- tests/requirements/compile.py | 1 - tests/requirements/py38.txt | 116 ---------------------------------- tests/test_apig_wsgi.py | 4 +- 10 files changed, 15 insertions(+), 140 deletions(-) delete mode 100644 tests/requirements/py38.txt diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e29d48f..4194bdb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,6 @@ jobs: strategy: matrix: python-version: - - 3.8 - 3.9 - '3.10' - '3.11' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2c187af..8996ca5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: rev: v3.17.0 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] - repo: https://github.com/psf/black-pre-commit-mirror rev: 24.8.0 hooks: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0c7b1ec..ad93412 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,8 @@ Changelog * Support Python 3.13. +* Drop Python 3.8 support. + 2.18.0 (2023-07-03) ------------------- diff --git a/README.rst b/README.rst index 149c8da..d9aff60 100644 --- a/README.rst +++ b/README.rst @@ -47,7 +47,7 @@ Use **pip**: python -m pip install apig-wsgi -Python 3.8 to 3.13 supported. +Python 3.9 to 3.13 supported. Usage ===== diff --git a/pyproject.toml b/pyproject.toml index 51483db..a06ef21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ keywords = [ authors = [ { name = "Adam Johnson", email = "me@adamj.eu" }, ] -requires-python = ">=3.8" +requires-python = ">=3.9" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", @@ -26,7 +26,6 @@ classifiers = [ "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -34,9 +33,6 @@ classifiers = [ "Programming Language :: Python :: 3.13", "Typing :: Typed", ] -dependencies = [ - "typing-extensions; python_version<'3.8'", -] urls.Changelog = "https://github.com/adamchainz/apig-wsgi/blob/main/CHANGELOG.rst" urls.Funding = "https://adamj.eu/books/" urls.Repository = "https://github.com/adamchainz/apig-wsgi" diff --git a/src/apig_wsgi/__init__.py b/src/apig_wsgi/__init__.py index e62c247..b5d63ca 100644 --- a/src/apig_wsgi/__init__.py +++ b/src/apig_wsgi/__init__.py @@ -5,14 +5,12 @@ from base64 import b64decode from base64 import b64encode from collections import defaultdict +from collections.abc import Iterable +from collections.abc import Sequence from io import BytesIO from types import TracebackType from typing import Any from typing import Callable -from typing import Iterable -from typing import Sequence -from typing import Tuple -from typing import Type from typing import Union from urllib.parse import urlencode @@ -29,8 +27,8 @@ RESERVED_URI_CHARACTERS = r"!#$&'()*+,/:;=?@[]%" _ExcInfoType = Union[ - Tuple[Type[BaseException], BaseException, TracebackType], - Tuple[None, None, None], + tuple[type[BaseException], BaseException, TracebackType], + tuple[None, None, None], None, ] diff --git a/src/apig_wsgi/compat.py b/src/apig_wsgi/compat.py index 9fc911c..5146623 100644 --- a/src/apig_wsgi/compat.py +++ b/src/apig_wsgi/compat.py @@ -8,18 +8,15 @@ from wsgiref.types import WSGIApplication else: # Partial backport of wsgiref.types + from collections.abc import Iterable from types import TracebackType from typing import Any from typing import Callable - from typing import Dict - from typing import Iterable from typing import Protocol - from typing import Tuple - from typing import Type from typing import Union - _ExcInfo = Tuple[Type[BaseException], BaseException, TracebackType] - _OptExcInfo = Union[_ExcInfo, Tuple[None, None, None]] + _ExcInfo = tuple[type[BaseException], BaseException, TracebackType] + _OptExcInfo = Union[_ExcInfo, tuple[None, None, None]] class StartResponse(Protocol): """start_response() callable as defined in PEP 3333""" @@ -32,5 +29,5 @@ def __call__( # /, ) -> Callable[[bytes], object]: ... # pragma: no cover - WSGIEnvironment = Dict[str, Any] + WSGIEnvironment = dict[str, Any] WSGIApplication = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]] diff --git a/tests/requirements/compile.py b/tests/requirements/compile.py index 87e7d51..e0a55d9 100755 --- a/tests/requirements/compile.py +++ b/tests/requirements/compile.py @@ -19,7 +19,6 @@ *sys.argv[1:], ] run = partial(subprocess.run, check=True) - run([*common_args, "--python", "3.8", "--output-file", "py38.txt"]) run([*common_args, "--python", "3.9", "--output-file", "py39.txt"]) run([*common_args, "--python", "3.10", "--output-file", "py310.txt"]) run([*common_args, "--python", "3.11", "--output-file", "py311.txt"]) diff --git a/tests/requirements/py38.txt b/tests/requirements/py38.txt deleted file mode 100644 index 5b371ed..0000000 --- a/tests/requirements/py38.txt +++ /dev/null @@ -1,116 +0,0 @@ -# This file was autogenerated by uv via the following command: -# uv pip compile --generate-hashes requirements.in --python 3.8 --output-file py38.txt -coverage==7.6.1 \ - --hash=sha256:06a737c882bd26d0d6ee7269b20b12f14a8704807a01056c80bb881a4b2ce6ca \ - --hash=sha256:07e2ca0ad381b91350c0ed49d52699b625aab2b44b65e1b4e02fa9df0e92ad2d \ - --hash=sha256:0c0420b573964c760df9e9e86d1a9a622d0d27f417e1a949a8a66dd7bcee7bc6 \ - --hash=sha256:0dbde0f4aa9a16fa4d754356a8f2e36296ff4d83994b2c9d8398aa32f222f989 \ - --hash=sha256:1125ca0e5fd475cbbba3bb67ae20bd2c23a98fac4e32412883f9bcbaa81c314c \ - --hash=sha256:13b0a73a0896988f053e4fbb7de6d93388e6dd292b0d87ee51d106f2c11b465b \ - --hash=sha256:166811d20dfea725e2e4baa71fffd6c968a958577848d2131f39b60043400223 \ - --hash=sha256:170d444ab405852903b7d04ea9ae9b98f98ab6d7e63e1115e82620807519797f \ - --hash=sha256:1f4aa8219db826ce6be7099d559f8ec311549bfc4046f7f9fe9b5cea5c581c56 \ - --hash=sha256:225667980479a17db1048cb2bf8bfb39b8e5be8f164b8f6628b64f78a72cf9d3 \ - --hash=sha256:260933720fdcd75340e7dbe9060655aff3af1f0c5d20f46b57f262ab6c86a5e8 \ - --hash=sha256:2bdb062ea438f22d99cba0d7829c2ef0af1d768d1e4a4f528087224c90b132cb \ - --hash=sha256:2c09f4ce52cb99dd7505cd0fc8e0e37c77b87f46bc9c1eb03fe3bc9991085388 \ - --hash=sha256:3115a95daa9bdba70aea750db7b96b37259a81a709223c8448fa97727d546fe0 \ - --hash=sha256:3e0cadcf6733c09154b461f1ca72d5416635e5e4ec4e536192180d34ec160f8a \ - --hash=sha256:3f1156e3e8f2872197af3840d8ad307a9dd18e615dc64d9ee41696f287c57ad8 \ - --hash=sha256:4421712dbfc5562150f7554f13dde997a2e932a6b5f352edcce948a815efee6f \ - --hash=sha256:44df346d5215a8c0e360307d46ffaabe0f5d3502c8a1cefd700b34baf31d411a \ - --hash=sha256:502753043567491d3ff6d08629270127e0c31d4184c4c8d98f92c26f65019962 \ - --hash=sha256:547f45fa1a93154bd82050a7f3cddbc1a7a4dd2a9bf5cb7d06f4ae29fe94eaf8 \ - --hash=sha256:5621a9175cf9d0b0c84c2ef2b12e9f5f5071357c4d2ea6ca1cf01814f45d2391 \ - --hash=sha256:609b06f178fe8e9f89ef676532760ec0b4deea15e9969bf754b37f7c40326dbc \ - --hash=sha256:645786266c8f18a931b65bfcefdbf6952dd0dea98feee39bd188607a9d307ed2 \ - --hash=sha256:6878ef48d4227aace338d88c48738a4258213cd7b74fd9a3d4d7582bb1d8a155 \ - --hash=sha256:6a89ecca80709d4076b95f89f308544ec8f7b4727e8a547913a35f16717856cb \ - --hash=sha256:6db04803b6c7291985a761004e9060b2bca08da6d04f26a7f2294b8623a0c1a0 \ - --hash=sha256:6e2cd258d7d927d09493c8df1ce9174ad01b381d4729a9d8d4e38670ca24774c \ - --hash=sha256:6e81d7a3e58882450ec4186ca59a3f20a5d4440f25b1cff6f0902ad890e6748a \ - --hash=sha256:702855feff378050ae4f741045e19a32d57d19f3e0676d589df0575008ea5004 \ - --hash=sha256:78b260de9790fd81e69401c2dc8b17da47c8038176a79092a89cb2b7d945d060 \ - --hash=sha256:7bb65125fcbef8d989fa1dd0e8a060999497629ca5b0efbca209588a73356232 \ - --hash=sha256:7dea0889685db8550f839fa202744652e87c60015029ce3f60e006f8c4462c93 \ - --hash=sha256:8284cf8c0dd272a247bc154eb6c95548722dce90d098c17a883ed36e67cdb129 \ - --hash=sha256:877abb17e6339d96bf08e7a622d05095e72b71f8afd8a9fefc82cf30ed944163 \ - --hash=sha256:8929543a7192c13d177b770008bc4e8119f2e1f881d563fc6b6305d2d0ebe9de \ - --hash=sha256:8ae539519c4c040c5ffd0632784e21b2f03fc1340752af711f33e5be83a9d6c6 \ - --hash=sha256:8f59d57baca39b32db42b83b2a7ba6f47ad9c394ec2076b084c3f029b7afca23 \ - --hash=sha256:9054a0754de38d9dbd01a46621636689124d666bad1936d76c0341f7d71bf569 \ - --hash=sha256:953510dfb7b12ab69d20135a0662397f077c59b1e6379a768e97c59d852ee51d \ - --hash=sha256:95cae0efeb032af8458fc27d191f85d1717b1d4e49f7cb226cf526ff28179778 \ - --hash=sha256:9bc572be474cafb617672c43fe989d6e48d3c83af02ce8de73fff1c6bb3c198d \ - --hash=sha256:9c56863d44bd1c4fe2abb8a4d6f5371d197f1ac0ebdee542f07f35895fc07f36 \ - --hash=sha256:9e0b2df163b8ed01d515807af24f63de04bebcecbd6c3bfeff88385789fdf75a \ - --hash=sha256:a09ece4a69cf399510c8ab25e0950d9cf2b42f7b3cb0374f95d2e2ff594478a6 \ - --hash=sha256:a1ac0ae2b8bd743b88ed0502544847c3053d7171a3cff9228af618a068ed9c34 \ - --hash=sha256:a318d68e92e80af8b00fa99609796fdbcdfef3629c77c6283566c6f02c6d6704 \ - --hash=sha256:a4acd025ecc06185ba2b801f2de85546e0b8ac787cf9d3b06e7e2a69f925b106 \ - --hash=sha256:a6d3adcf24b624a7b778533480e32434a39ad8fa30c315208f6d3e5542aeb6e9 \ - --hash=sha256:a78d169acd38300060b28d600344a803628c3fd585c912cacc9ea8790fe96862 \ - --hash=sha256:a95324a9de9650a729239daea117df21f4b9868ce32e63f8b650ebe6cef5595b \ - --hash=sha256:abd5fd0db5f4dc9289408aaf34908072f805ff7792632250dcb36dc591d24255 \ - --hash=sha256:b06079abebbc0e89e6163b8e8f0e16270124c154dc6e4a47b413dd538859af16 \ - --hash=sha256:b43c03669dc4618ec25270b06ecd3ee4fa94c7f9b3c14bae6571ca00ef98b0d3 \ - --hash=sha256:b48f312cca9621272ae49008c7f613337c53fadca647d6384cc129d2996d1133 \ - --hash=sha256:b5d7b556859dd85f3a541db6a4e0167b86e7273e1cdc973e5b175166bb634fdb \ - --hash=sha256:b9f222de8cded79c49bf184bdbc06630d4c58eec9459b939b4a690c82ed05657 \ - --hash=sha256:c3c02d12f837d9683e5ab2f3d9844dc57655b92c74e286c262e0fc54213c216d \ - --hash=sha256:c44fee9975f04b33331cb8eb272827111efc8930cfd582e0320613263ca849ca \ - --hash=sha256:cf4b19715bccd7ee27b6b120e7e9dd56037b9c0681dcc1adc9ba9db3d417fa36 \ - --hash=sha256:d0c212c49b6c10e6951362f7c6df3329f04c2b1c28499563d4035d964ab8e08c \ - --hash=sha256:d3296782ca4eab572a1a4eca686d8bfb00226300dcefdf43faa25b5242ab8a3e \ - --hash=sha256:d85f5e9a5f8b73e2350097c3756ef7e785f55bd71205defa0bfdaf96c31616ff \ - --hash=sha256:da511e6ad4f7323ee5702e6633085fb76c2f893aaf8ce4c51a0ba4fc07580ea7 \ - --hash=sha256:e05882b70b87a18d937ca6768ff33cc3f72847cbc4de4491c8e73880766718e5 \ - --hash=sha256:e61c0abb4c85b095a784ef23fdd4aede7a2628478e7baba7c5e3deba61070a02 \ - --hash=sha256:e6a08c0be454c3b3beb105c0596ebdc2371fab6bb90c0c0297f4e58fd7e1012c \ - --hash=sha256:e9a6e0eb86070e8ccaedfbd9d38fec54864f3125ab95419970575b42af7541df \ - --hash=sha256:ed37bd3c3b063412f7620464a9ac1314d33100329f39799255fb8d3027da50d3 \ - --hash=sha256:f1adfc8ac319e1a348af294106bc6a8458a0f1633cc62a1446aebc30c5fa186a \ - --hash=sha256:f5796e664fe802da4f57a168c85359a8fbf3eab5e55cd4e4569fbacecc903959 \ - --hash=sha256:fc5a77d0c516700ebad189b587de289a20a78324bc54baee03dd486f0855d234 \ - --hash=sha256:fd21f6ae3f08b41004dfb433fa895d858f3f5979e7762d052b12aef444e29afc - # via -r requirements.in -exceptiongroup==1.2.2 \ - --hash=sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b \ - --hash=sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc - # via pytest -importlib-metadata==8.4.0 \ - --hash=sha256:66f342cc6ac9818fc6ff340576acd24d65ba0b3efabb2b4ac08b598965a4a2f1 \ - --hash=sha256:9a547d3bc3608b025f93d403fdd1aae741c24fbb8314df4b155675742ce303c5 - # via pytest-randomly -iniconfig==2.0.0 \ - --hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \ - --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 - # via pytest -packaging==24.1 \ - --hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \ - --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 - # via pytest -pluggy==1.5.0 \ - --hash=sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1 \ - --hash=sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669 - # via pytest -pytest==8.3.2 \ - --hash=sha256:4ba08f9ae7dcf84ded419494d229b48d0903ea6407b030eaec46df5e6a73bba5 \ - --hash=sha256:c132345d12ce551242c87269de812483f5bcc87cdbb4722e48487ba194f9fdce - # via - # -r requirements.in - # pytest-randomly -pytest-randomly==3.15.0 \ - --hash=sha256:0516f4344b29f4e9cdae8bce31c4aeebf59d0b9ef05927c33354ff3859eeeca6 \ - --hash=sha256:b908529648667ba5e54723088edd6f82252f540cc340d748d1fa985539687047 - # via -r requirements.in -tomli==2.0.1 \ - --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ - --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f - # via - # coverage - # pytest -zipp==3.20.1 \ - --hash=sha256:9960cd8967c8f85a56f920d5d507274e74f9ff813a0ab8889a5b5be2daf44064 \ - --hash=sha256:c22b14cc4763c5a5b04134207736c107db42e9d3ef2d9779d465f5f1bcba572b - # via importlib-metadata diff --git a/tests/test_apig_wsgi.py b/tests/test_apig_wsgi.py index 9c451b5..fd2626d 100644 --- a/tests/test_apig_wsgi.py +++ b/tests/test_apig_wsgi.py @@ -2,11 +2,11 @@ import sys from base64 import b64encode +from collections.abc import Generator +from collections.abc import Iterable from io import BytesIO from typing import Any from typing import Callable -from typing import Generator -from typing import Iterable import pytest