From daa5e3ce55457388fb4b83ee4f5d75247467cfc7 Mon Sep 17 00:00:00 2001 From: Steven Looman Date: Thu, 7 Nov 2024 07:39:22 +0100 Subject: [PATCH] Drop Python 3.8 support (#245) --- .github/workflows/ci-cd.yml | 2 +- async_upnp_client/profiles/profile.py | 10 ++++------ changes/245.feature | 1 + setup.cfg | 5 ++--- tests/profiles/test_dlna_dmr.py | 2 -- tox.ini | 3 +-- 6 files changed, 9 insertions(+), 14 deletions(-) create mode 100644 changes/245.feature diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index d3f6502..e0115a3 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} diff --git a/async_upnp_client/profiles/profile.py b/async_upnp_client/profiles/profile.py index d54ea95..1ad9034 100644 --- a/async_upnp_client/profiles/profile.py +++ b/async_upnp_client/profiles/profile.py @@ -301,12 +301,10 @@ async def _update_resubscriber_task(self) -> None: if self._subscriptions and not self._resubscriber_task: _LOGGER.debug("Creating resubscribe_task") # pylint: disable=fixme - # TODO: Use create_task instead of ensure_future with Python 3.8+ - # self._resubscriber_task = asyncio.create_task( - # self._resubscribe_loop(), - # name=f"UpnpProfileDevice({self.name})._resubscriber_task", - # ) - self._resubscriber_task = asyncio.ensure_future(self._resubscribe_loop()) + self._resubscriber_task = asyncio.create_task( + self._resubscribe_loop(), + name=f"UpnpProfileDevice({self.name})._resubscriber_task", + ) if not self._subscriptions and self._resubscriber_task: _LOGGER.debug("Cancelling resubscribe_task") diff --git a/changes/245.feature b/changes/245.feature new file mode 100644 index 0000000..4308d19 --- /dev/null +++ b/changes/245.feature @@ -0,0 +1 @@ +Drop Python 3.8 support. diff --git a/setup.cfg b/setup.cfg index ae901a2..fbcc90b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,7 +29,6 @@ classifiers = Operating System :: POSIX Operating System :: MacOS :: MacOS X Operating System :: Microsoft :: Windows - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 @@ -42,9 +41,9 @@ keywords = Universal Plug and Play [options] -python_requires = >=3.8 +python_requires = >=3.9 install_requires = - voluptuous >= 0.14.2 + voluptuous >= 0.15.2 aiohttp >3.9.0, <4.0 async-timeout >=3.0, <5.0 python-didl-lite ~= 1.4.0 diff --git a/tests/profiles/test_dlna_dmr.py b/tests/profiles/test_dlna_dmr.py index b844427..9fd9612 100644 --- a/tests/profiles/test_dlna_dmr.py +++ b/tests/profiles/test_dlna_dmr.py @@ -1,7 +1,6 @@ """Unit tests for the DLNA DMR profile.""" import asyncio -import sys import time from typing import List, Sequence from unittest import mock @@ -331,7 +330,6 @@ async def test_wait_for_can_play_timeout() -> None: assert not profile.can_play -@pytest.mark.skipif(sys.version_info < (3, 8), reason="Need Python 3.8 for AsyncMock") @pytest.mark.asyncio async def test_fetch_headers() -> None: """Test _fetch_headers when the server supports HEAD, GET with range, or just GET.""" diff --git a/tox.ini b/tox.ini index df92f92..8d0469e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,8 @@ [tox] -envlist = py38, py39, py310, py311, py312, py313, flake8, pylint, codespell, mypy, black, isort +envlist = py39, py310, py311, py312, py313, flake8, pylint, codespell, mypy, black, isort [gh-actions] python = - 3.8: py38 3.9: py39 3.10: py310 3.11: py311