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

Bump websockets on requirements.txt #2541

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
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"]
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: "actions/checkout@v4"
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dynamic = ["version"]
description = "The lightning-fast ASGI server."
readme = "README.md"
license = "BSD-3-Clause"
requires-python = ">=3.8"
requires-python = ">=3.9"
authors = [
{ name = "Tom Christie", email = "[email protected]" },
{ name = "Marcelo Trylesinski", email = "[email protected]" },
Expand All @@ -20,7 +20,6 @@ classifiers = [
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down Expand Up @@ -93,6 +92,9 @@ filterwarnings = [
"ignore:Uvicorn's native WSGI implementation is deprecated.*:DeprecationWarning",
"ignore: 'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning",
"ignore: remove second argument of ws_handler:DeprecationWarning:websockets",
"ignore: websockets.legacy is deprecated.*:DeprecationWarning:websockets",
"ignore: websockets.server.WebSocketServerProtocol is deprecated.*:DeprecationWarning:websockets",
"ignore: websockets.exceptions.InvalidStatusCode.*:DeprecationWarning",
]

[tool.coverage.run]
Expand Down Expand Up @@ -127,8 +129,6 @@ py-win32 = "sys_platform == 'win32'"
py-not-win32 = "sys_platform != 'win32'"
py-linux = "sys_platform == 'linux'"
py-darwin = "sys_platform == 'darwin'"
py-gte-38 = "sys_version_info >= (3, 8)"
py-lt-38 = "sys_version_info < (3, 8)"
py-gte-39 = "sys_version_info >= (3, 9)"
py-lt-39 = "sys_version_info < (3, 9)"
py-gte-310 = "sys_version_info >= (3, 10)"
Expand Down
8 changes: 3 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ h11 @ git+https://github.com/python-hyper/h11.git@master
# Explicit optionals
a2wsgi==1.10.7
wsproto==1.2.0
websockets==13.1
websockets==14.1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can drop Python 3.8 first, and then move this to 14.1.


# Packaging
build==1.2.2.post1
Expand All @@ -20,11 +20,9 @@ pytest-mock==3.14.0
mypy==1.13.0
types-click==7.1.8
types-pyyaml==6.0.12.20240917
trustme==1.1.0; python_version < '3.9'
trustme==1.2.0; python_version >= '3.9'
trustme==1.2.0
cryptography==44.0.0
coverage==7.6.1; python_version < '3.9'
coverage==7.6.9; python_version >= '3.9'
coverage==7.6.9
coverage-conditional-plugin==0.9.0
httpx==0.28.1

Expand Down
9 changes: 4 additions & 5 deletions tests/middleware/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

import httpx
import pytest
import websockets
import websockets.client
from websockets.asyncio.client import connect

from tests.utils import run_server
from uvicorn import Config
Expand Down Expand Up @@ -104,9 +103,9 @@ async def websocket_app(scope: Scope, receive: ASGIReceiveCallable, send: ASGISe
elif message["type"] == "websocket.disconnect":
break

async def open_connection(url):
async with websockets.client.connect(url) as websocket:
return websocket.open
async def open_connection(url: str):
async with connect(url):
return True

config = Config(
app=websocket_app,
Expand Down
4 changes: 2 additions & 2 deletions tests/middleware/test_proxy_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import httpx
import httpx._transports.asgi
import pytest
import websockets.client
from websockets.asyncio.client import connect

from tests.response import Response
from tests.utils import run_server
Expand Down Expand Up @@ -478,7 +478,7 @@ async def websocket_app(scope: Scope, receive: ASGIReceiveCallable, send: ASGISe
async with run_server(config):
url = f"ws://127.0.0.1:{unused_tcp_port}"
headers = {X_FORWARDED_FOR: "1.2.3.4", X_FORWARDED_PROTO: forwarded_proto}
async with websockets.client.connect(url, extra_headers=headers) as websocket:
async with connect(url, additional_headers=headers) as websocket:
data = await websocket.recv()
assert data == expected

Expand Down
3 changes: 2 additions & 1 deletion tests/middleware/test_wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import io
import sys
from typing import AsyncGenerator, Callable
from collections.abc import AsyncGenerator
from typing import Callable

import a2wsgi
import httpx
Expand Down
Loading
Loading