From 87ab14315ef867df68861f35b7e2cc3158d65afd Mon Sep 17 00:00:00 2001 From: Bryan Forbes Date: Tue, 15 Aug 2023 18:07:11 -0500 Subject: [PATCH] Drop support for Python 3.7 (#1064) --- .flake8 | 2 +- .github/workflows/tests.yml | 2 +- README.rst | 2 +- docs/index.rst | 2 +- pyproject.toml | 6 +----- setup.py | 4 ++-- tests/test_adversity.py | 6 ++---- tests/test_listeners.py | 6 ++---- 8 files changed, 11 insertions(+), 19 deletions(-) diff --git a/.flake8 b/.flake8 index 3a8b87a8..decf40da 100644 --- a/.flake8 +++ b/.flake8 @@ -1,3 +1,3 @@ [flake8] ignore = E402,E731,W503,W504,E252 -exclude = .git,__pycache__,build,dist,.eggs,.github,.local,.venv +exclude = .git,__pycache__,build,dist,.eggs,.github,.local,.venv,.tox diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a120e9a6..8c069709 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: # job. strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11"] os: [ubuntu-latest, macos-latest, windows-latest] loop: [asyncio, uvloop] exclude: diff --git a/README.rst b/README.rst index 22a086aa..ef2678db 100644 --- a/README.rst +++ b/README.rst @@ -13,7 +13,7 @@ of PostgreSQL server binary protocol for use with Python's ``asyncio`` framework. You can read more about asyncpg in an introductory `blog post `_. -asyncpg requires Python 3.7 or later and is supported for PostgreSQL +asyncpg requires Python 3.8 or later and is supported for PostgreSQL versions 9.5 to 15. Older PostgreSQL versions or other databases implementing the PostgreSQL protocol *may* work, but are not being actively tested. diff --git a/docs/index.rst b/docs/index.rst index 833a7039..dd4768b4 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -15,7 +15,7 @@ PostgreSQL and Python/asyncio. asyncpg is an efficient, clean implementation of PostgreSQL server binary protocol for use with Python's ``asyncio`` framework. -**asyncpg** requires Python 3.7 or later and is supported for PostgreSQL +**asyncpg** requires Python 3.8 or later and is supported for PostgreSQL versions 9.5 to 15. Older PostgreSQL versions or other databases implementing the PostgreSQL protocol *may* work, but are not being actively tested. diff --git a/pyproject.toml b/pyproject.toml index 3010936d..c9e4bdd9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "asyncpg" description = "An asyncio PostgreSQL driver" authors = [{name = "MagicStack Inc", email = "hello@magic.io"}] -requires-python = '>=3.7.0' +requires-python = '>=3.8.0' readme = "README.rst" license = {text = "Apache License, Version 2.0"} dynamic = ["version"] @@ -19,7 +19,6 @@ classifiers = [ "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "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", @@ -27,9 +26,6 @@ classifiers = [ "Programming Language :: Python :: Implementation :: CPython", "Topic :: Database :: Front-Ends", ] -dependencies = [ - 'typing-extensions>=3.7.4.3;python_version<"3.8"', -] [project.urls] github = "https://github.com/MagicStack/asyncpg" diff --git a/setup.py b/setup.py index 269e2fd7..c4d42d82 100644 --- a/setup.py +++ b/setup.py @@ -7,8 +7,8 @@ import sys -if sys.version_info < (3, 7): - raise RuntimeError('asyncpg requires Python 3.7 or greater') +if sys.version_info < (3, 8): + raise RuntimeError('asyncpg requires Python 3.8 or greater') import os import os.path diff --git a/tests/test_adversity.py b/tests/test_adversity.py index fa0f6ab1..71532317 100644 --- a/tests/test_adversity.py +++ b/tests/test_adversity.py @@ -10,16 +10,14 @@ import os import platform import unittest -import sys from asyncpg import _testbase as tb @unittest.skipIf(os.environ.get('PGHOST'), 'using remote cluster for testing') @unittest.skipIf( - platform.system() == 'Windows' and - sys.version_info >= (3, 8), - 'not compatible with ProactorEventLoop which is default in Python 3.8') + platform.system() == 'Windows', + 'not compatible with ProactorEventLoop which is default in Python 3.8+') class TestConnectionLoss(tb.ProxiedClusterTestCase): @tb.with_timeout(30.0) async def test_connection_close_timeout(self): diff --git a/tests/test_listeners.py b/tests/test_listeners.py index 7fdf0312..e398e0f6 100644 --- a/tests/test_listeners.py +++ b/tests/test_listeners.py @@ -8,7 +8,6 @@ import asyncio import os import platform -import sys import unittest from asyncpg import _testbase as tb @@ -314,9 +313,8 @@ def listener1(*args): @unittest.skipIf(os.environ.get('PGHOST'), 'using remote cluster for testing') @unittest.skipIf( - platform.system() == 'Windows' and - sys.version_info >= (3, 8), - 'not compatible with ProactorEventLoop which is default in Python 3.8') + platform.system() == 'Windows', + 'not compatible with ProactorEventLoop which is default in Python 3.8+') class TestConnectionTerminationListener(tb.ProxiedClusterTestCase): async def test_connection_termination_callback_called_on_remote(self):