From fd91826c338747a5adfea185e356b97422b3c18a Mon Sep 17 00:00:00 2001 From: David Zaslavsky Date: Tue, 14 May 2024 23:58:35 -0700 Subject: [PATCH 1/5] Remove Python 3.5 from CI Our CI jobs have stopped working with Python 3.5 since pip is no longer able to upgrade itself. Perhaps there was a recent change in PyPI's SSL certificate that makes it unable to be verified on Python 3.5, at least within GitHub Actions. Since Python 3.5 is long past EOL, we don't think it's worth putting in any work to get that job working again, so this commit drops it from the CI test configuration. --- .github/workflows/tests.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index aa10369..eababa6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,12 +21,6 @@ jobs: # The forced pytest versions correspond with the lower bounds in tox.ini pytest-version: ['', '--force-dep pytest==4', '--force-dep pytest==6.2.4'] include: - - os: 'ubuntu-20.04' - python-version: '3.5' - pytest-version: '' - - os: 'ubuntu-20.04' - python-version: '3.5' - pytest-version: '--force-dep pytest==4' - os: 'ubuntu-20.04' python-version: '3.6' exclude: From c5d9f04cad6b142d429775f5329791073a26037d Mon Sep 17 00:00:00 2001 From: David Zaslavsky Date: Wed, 15 May 2024 00:01:32 -0700 Subject: [PATCH 2/5] Remove tox environments for Python 3.5 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 263b570..cf9b349 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{35,36,37,38,39,310,311,312,py3}{,-smtp},lint +envlist = py{36,37,38,39,310,311,312,py3}{,-smtp},lint recreate = True isolated_build = True From f07ca3e8e1eb888e2c36bcd5d53543ac8e257c3d Mon Sep 17 00:00:00 2001 From: David Zaslavsky Date: Wed, 15 May 2024 00:02:00 -0700 Subject: [PATCH 3/5] Update target Python version for black to 3.6 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6eb8170..6c4b23b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,5 +6,5 @@ build-backend = "setuptools.build_meta" write_to = "pytest_localserver/_version.py" [tool.black] -target-version = ['py35'] +target-version = ['py36'] line-length = 120 From 5ead723a21e9cc49af7a3341a099fec885711b7a Mon Sep 17 00:00:00 2001 From: David Zaslavsky Date: Tue, 14 May 2024 23:55:38 -0700 Subject: [PATCH 4/5] Remove project metadata indicating support for Python 3.5 This officially drops Python 3.5 support from the project. --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 438c4a3..d3b0d31 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ def run(self): long_description=read("README.rst"), url="https://github.com/pytest-dev/pytest-localserver", packages=["pytest_localserver"], - python_requires=">=3.5", + python_requires=">=3.6", install_requires=["werkzeug>=0.10"], extras_require={ "smtp": [ @@ -59,7 +59,6 @@ def run(self): "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", From 0f88e678941b0bd3f2540df6bfdc861fe1671c72 Mon Sep 17 00:00:00 2001 From: David Zaslavsky Date: Wed, 15 May 2024 00:03:21 -0700 Subject: [PATCH 5/5] Remove Python 3.5 compatibiltiy code Our SMTP Server implementation normally calls asyncio.base_events.Server.is_serving() to test whether the server is active, but that method only exists in Python 3.6 and up. For Python 3.5 it had to fall back to asyncio.base_events.BaseEventLoop.is_running(). Now that we no longer support Python 3.5, that fallback is no longer necessary, so I'm removing it. --- pytest_localserver/smtp.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pytest_localserver/smtp.py b/pytest_localserver/smtp.py index 532d80a..0b285eb 100644 --- a/pytest_localserver/smtp.py +++ b/pytest_localserver/smtp.py @@ -95,16 +95,7 @@ def is_alive(self): @property def accepting(self): - try: - return self.server.is_serving() - except AttributeError: - # asyncio.base_events.Server.is_serving() only exists in Python 3.6 - # and up. For Python 3.5, asyncio.base_events.BaseEventLoop.is_running() - # is a close approximation; it should mostly return the same value - # except for brief periods when the server is starting up or shutting - # down. Once we drop support for Python 3.5, this branch becomes - # unnecessary. - return self.loop.is_running() + return self.server.is_serving() # for aiosmtpd <1.4 if not hasattr(aiosmtpd.controller.Controller, "_trigger_server"):