diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2422278..4622631 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,6 @@ jobs: fail-fast: false matrix: python-version: - - "3.8" - "3.9" - "3.10" - "3.11" diff --git a/README.rst b/README.rst index 33dcc13..1673349 100644 --- a/README.rst +++ b/README.rst @@ -19,7 +19,7 @@ There are two available implementations: Both layers support a single-server and sharded configurations. -`channels_redis` is tested against Python 3.8 to 3.13, `redis-py` versions 4.6, +`channels_redis` is tested against Python 3.9 to 3.13, `redis-py` versions 4.6, 5.0, and the development branch, and Channels versions 3, 4 and the development branch there. diff --git a/setup.py b/setup.py index a368709..bf272f7 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ zip_safe=False, packages=find_packages(exclude=["tests"]), include_package_data=True, - python_requires=">=3.8", + python_requires=">=3.9", install_requires=[ "redis>=4.6", "msgpack~=1.0", diff --git a/tests/test_pubsub.py b/tests/test_pubsub.py index 3c00dd6..07ecca8 100644 --- a/tests/test_pubsub.py +++ b/tests/test_pubsub.py @@ -61,7 +61,8 @@ async def test_send_receive(channel_layer): assert message["text"] == "Ahoy-hoy!" -def test_send_receive_sync(channel_layer, event_loop): +def test_send_receive_sync(channel_layer): + event_loop = asyncio.new_event_loop() _await = event_loop.run_until_complete channel = _await(channel_layer.new_channel()) async_to_sync(channel_layer.send, force_new_loop=True)( @@ -70,6 +71,7 @@ def test_send_receive_sync(channel_layer, event_loop): message = _await(channel_layer.receive(channel)) assert message["type"] == "test.message" assert message["text"] == "Ahoy-hoy!" + event_loop.close() @pytest.mark.asyncio @@ -86,7 +88,8 @@ async def test_multi_send_receive(channel_layer): assert (await channel_layer.receive(channel))["type"] == "message.3" -def test_multi_send_receive_sync(channel_layer, event_loop): +def test_multi_send_receive_sync(channel_layer): + event_loop = asyncio.new_event_loop() _await = event_loop.run_until_complete channel = _await(channel_layer.new_channel()) send = async_to_sync(channel_layer.send) @@ -96,6 +99,7 @@ def test_multi_send_receive_sync(channel_layer, event_loop): assert _await(channel_layer.receive(channel))["type"] == "message.1" assert _await(channel_layer.receive(channel))["type"] == "message.2" assert _await(channel_layer.receive(channel))["type"] == "message.3" + event_loop.close() @pytest.mark.asyncio diff --git a/tests/test_pubsub_sentinel.py b/tests/test_pubsub_sentinel.py index 41b7de2..b4cbfb1 100644 --- a/tests/test_pubsub_sentinel.py +++ b/tests/test_pubsub_sentinel.py @@ -42,7 +42,8 @@ async def test_send_receive(channel_layer): assert message["text"] == "Ahoy-hoy!" -def test_send_receive_sync(channel_layer, event_loop): +def test_send_receive_sync(channel_layer): + event_loop = asyncio.new_event_loop() _await = event_loop.run_until_complete channel = _await(channel_layer.new_channel()) async_to_sync(channel_layer.send, force_new_loop=True)( @@ -51,6 +52,7 @@ def test_send_receive_sync(channel_layer, event_loop): message = _await(channel_layer.receive(channel)) assert message["type"] == "test.message" assert message["text"] == "Ahoy-hoy!" + event_loop.close() @pytest.mark.asyncio @@ -67,7 +69,8 @@ async def test_multi_send_receive(channel_layer): assert (await channel_layer.receive(channel))["type"] == "message.3" -def test_multi_send_receive_sync(channel_layer, event_loop): +def test_multi_send_receive_sync(channel_layer): + event_loop = asyncio.new_event_loop() _await = event_loop.run_until_complete channel = _await(channel_layer.new_channel()) send = async_to_sync(channel_layer.send) @@ -77,6 +80,7 @@ def test_multi_send_receive_sync(channel_layer, event_loop): assert _await(channel_layer.receive(channel))["type"] == "message.1" assert _await(channel_layer.receive(channel))["type"] == "message.2" assert _await(channel_layer.receive(channel))["type"] == "message.3" + event_loop.close() @pytest.mark.asyncio diff --git a/tox.ini b/tox.ini index 7417992..af89536 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{38,39,310,311,312,313}-ch{30,40,main}-redis50 + py{39,310,311,312,313}-ch{30,40,main}-redis50 py311-chmain-redis{45,46,50,main} qa