Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: support CPython 3.12, update CI jobs #2177

Merged
merged 10 commits into from
Nov 5, 2023
5 changes: 4 additions & 1 deletion .github/workflows/create-wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
- "3.11.0-rc - 3.11"
- "3.11"
- "3.12"
architecture:
- x64

Expand Down Expand Up @@ -99,6 +100,7 @@ jobs:
- cp39-cp39
- cp310-cp310
- cp311-cp311
- cp312-cp312
architecture:
- x64

Expand Down Expand Up @@ -230,6 +232,7 @@ jobs:
- cp39-cp39
- cp310-cp310
- cp311-cp311
- cp312-cp312
architecture:
- aarch64
- s390x
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/tests-mailman.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ name: Run tests (GNU Mailman 3)
on:
# Trigger the workflow on master but also allow it to run manually.
workflow_dispatch:
push:
branches:
- master

# NOTE(vytas): Disabled as it is failing as of 2023-09.
# Maybe @maxking just needs to update the Docker image (?)
# push:
# branches:
# - master

jobs:
run_tox:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ jobs:
- python-version: "3.11"
os: ubuntu-latest
toxenv: py311_cython
- python-version: "3.12"
os: ubuntu-latest
toxenv: py312
- python-version: "3.12"
os: ubuntu-latest
toxenv: py312_cython
- python-version: "3.10"
os: macos-latest
toxenv: py310_nocover
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ classifiers =
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Cython
keywords =
asgi
Expand Down
13 changes: 13 additions & 0 deletions tests/asgi/test_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,13 @@ async def on_websocket(self, req, ws):
await resource.data_received.wait()
assert resource.data == sample_data

# NOTE(vytas): When testing the case where the server
# explicitly closes the connection, try to receive some data
# before closing from the client side (and potentially
# winning the async race of which side closes first).
if explicit_close_server:
await ws.receive_data()

if explicit_close_client:
await ws.close(4042)

Expand Down Expand Up @@ -1111,6 +1118,9 @@ async def on_websocket(self, req, ws):
async with conductor as c:
if accept:
async with c.simulate_ws() as ws:
# Make sure the responder has a chance to reach the raise point
for _ in range(3):
await asyncio.sleep(0)
vytas7 marked this conversation as resolved.
Show resolved Hide resolved
assert ws.closed
assert ws.close_code == exp_code
else:
Expand Down Expand Up @@ -1208,6 +1218,9 @@ async def handle_foobar(req, resp, ex, param): # type: ignore
async with conductor as c:
if place == 'ws_after_accept':
async with c.simulate_ws() as ws:
# Make sure the responder has a chance to reach the raise point
for _ in range(3):
await asyncio.sleep(0)
assert ws.closed
assert ws.close_code == exp_code
else:
Expand Down
12 changes: 12 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ commands = python "{toxinidir}/tools/clean.py" "{toxinidir}/falcon"
[with-cython]
deps = -r{toxinidir}/requirements/tests
Cython
# NOTE(vytas): By using --no-build-isolation, we need to manage build
vytas7 marked this conversation as resolved.
Show resolved Hide resolved
# deps ourselves, and on CPython 3.12, it seems even setuptools
# (our PEP 517 backend of choice) is not guaranteed to be there.
setuptools
wheel
setenv =
PIP_CONFIG_FILE={toxinidir}/pip.conf
FALCON_DISABLE_CYTHON=
Expand Down Expand Up @@ -216,6 +221,13 @@ deps = {[with-cython]deps}
setenv = {[with-cython]setenv}
commands = {[with-cython]commands}

[testenv:py312_cython]
basepython = python3.12
install_command = {[with-cython]install_command}
deps = {[with-cython]deps}
setenv = {[with-cython]setenv}
commands = {[with-cython]commands}

# --------------------------------------------------------------------
# WSGI servers (Cythonized Falcon)
# --------------------------------------------------------------------
Expand Down
Loading