Skip to content

Commit

Permalink
Install aiohttp 3.9.0b0 on Python 3.12
Browse files Browse the repository at this point in the history
This partially reverts commit 247fb17.
  • Loading branch information
fantix committed Oct 9, 2023
1 parent 233033b commit dedf200
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
11 changes: 2 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
# pycodestyle is a dependency of flake8, but it must be frozen because
# their combination breaks too often
# (example breakage: https://gitlab.com/pycqa/flake8/issues/427)
'aiohttp>=3.8.1; python_version < "3.12"',
'aiohttp==3.9.0b0; python_version >= "3.12"',
'flake8~=5.0',
'psutil',
'pycodestyle~=2.9.0',
Expand All @@ -36,15 +38,6 @@
CYTHON_DEPENDENCY,
]

if vi < (3, 12):
# XXX Revert this change later.
#
# Python 3.12 is new and there's no aiohttp wheel for it yet.
# And pip helfully fails on building a wheel for it and I've
# no idea how to disable that.
TEST_DEPENDENCIES += ['aiohttp>=3.8.1']


# Dependencies required to build documentation.
DOC_DEPENDENCIES = [
'Sphinx~=4.1.2',
Expand Down
9 changes: 9 additions & 0 deletions tests/test_aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
skip_tests = False

import asyncio
import sys
import unittest
import weakref

Expand Down Expand Up @@ -48,6 +49,14 @@ async def test():
self.loop.run_until_complete(runner.cleanup())

def test_aiohttp_graceful_shutdown(self):
if self.implementation == 'asyncio' and sys.version_info >= (3, 12, 0):
# In Python 3.12.0, asyncio.Server.wait_closed() waits for all
# existing connections to complete, before aiohttp sends
# on_shutdown signals.
# https://github.com/aio-libs/aiohttp/issues/7675#issuecomment-1752143748
# https://github.com/python/cpython/pull/98582
raise unittest.SkipTest('bug in aiohttp: #7675')

async def websocket_handler(request):
ws = aiohttp.web.WebSocketResponse()
await ws.prepare(request)
Expand Down

0 comments on commit dedf200

Please sign in to comment.