Skip to content

Commit

Permalink
Bump the python-packages group with 6 updates (#2569)
Browse files Browse the repository at this point in the history
* Bump the python-packages group with 6 updates

Bumps the python-packages group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [websockets](https://github.com/python-websockets/websockets) | `13.1` | `14.2` |
| [a2wsgi](https://github.com/abersheeran/a2wsgi) | `1.10.7` | `1.10.8` |
| [twine](https://github.com/pypa/twine) | `6.0.1` | `6.1.0` |
| [ruff](https://github.com/astral-sh/ruff) | `0.8.4` | `0.9.4` |
| [trustme](https://github.com/python-trio/trustme) | `1.2.0` | `1.2.1` |
| [mkdocs-material](https://github.com/squidfunk/mkdocs-material) | `9.5.49` | `9.6.1` |


Updates `websockets` from 13.1 to 14.2
- [Release notes](https://github.com/python-websockets/websockets/releases)
- [Commits](python-websockets/websockets@13.1...14.2)

Updates `a2wsgi` from 1.10.7 to 1.10.8
- [Commits](abersheeran/a2wsgi@v1.10.7...v1.10.8)

Updates `twine` from 6.0.1 to 6.1.0
- [Release notes](https://github.com/pypa/twine/releases)
- [Changelog](https://github.com/pypa/twine/blob/main/docs/changelog.rst)
- [Commits](pypa/twine@6.0.1...6.1.0)

Updates `ruff` from 0.8.4 to 0.9.4
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.8.4...0.9.4)

Updates `trustme` from 1.2.0 to 1.2.1
- [Release notes](https://github.com/python-trio/trustme/releases)
- [Commits](python-trio/trustme@v1.2.0...v1.2.1)

Updates `mkdocs-material` from 9.5.49 to 9.6.1
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](squidfunk/mkdocs-material@9.5.49...9.6.1)

---
updated-dependencies:
- dependency-name: websockets
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: python-packages
- dependency-name: a2wsgi
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-packages
- dependency-name: twine
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-packages
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-packages
- dependency-name: trustme
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-packages
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-packages
...

Signed-off-by: dependabot[bot] <[email protected]>

* lint the whole thing

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marcelo Trylesinski <[email protected]>
  • Loading branch information
dependabot[bot] and Kludex authored Feb 9, 2025
1 parent 3695737 commit 3014765
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 37 deletions.
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@
h11 @ git+https://github.com/python-hyper/h11.git@master

# Explicit optionals
a2wsgi==1.10.7
a2wsgi==1.10.8
wsproto==1.2.0
websockets==13.1

# Packaging
build==1.2.2.post1
twine==6.0.1
twine==6.1.0

# Testing
ruff==0.8.4
ruff==0.9.4
pytest==8.3.4
pytest-mock==3.14.0
mypy==1.14.1
types-click==7.1.8
types-pyyaml==6.0.12.20241230
trustme==1.2.0
trustme==1.2.1
cryptography==44.0.0
coverage==7.6.10
coverage-conditional-plugin==0.9.0
httpx==0.28.1

# Documentation
mkdocs==1.6.1
mkdocs-material==9.5.49
mkdocs-material==9.6.1
2 changes: 1 addition & 1 deletion tests/protocols/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ def receive_all(sock: socket.socket):
def send_fragmented_req(path: str):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("127.0.0.1", unused_tcp_port))
d = (f"GET {path} HTTP/1.1\r\n" "Host: localhost\r\n" "Connection: close\r\n\r\n").encode()
d = (f"GET {path} HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n").encode()
split = len(path) // 2
sock.sendall(d[:split])
time.sleep(0.01)
Expand Down
21 changes: 9 additions & 12 deletions tests/protocols/test_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,14 @@ def app(scope: Scope):
pass # ok, wsproto 0.13
else:
assert response.status_code == 400
assert (
response.text.lower().strip().rstrip(".")
in [
"missing sec-websocket-key header",
"missing sec-websocket-version header", # websockets
"missing or empty sec-websocket-key header", # wsproto
"failed to open a websocket connection: missing " "sec-websocket-key header",
"failed to open a websocket connection: missing or empty " "sec-websocket-key header",
"failed to open a websocket connection: missing sec-websocket-key header; 'sec-websocket-key'",
]
)
assert response.text.lower().strip().rstrip(".") in [
"missing sec-websocket-key header",
"missing sec-websocket-version header", # websockets
"missing or empty sec-websocket-key header", # wsproto
"failed to open a websocket connection: missing sec-websocket-key header",
"failed to open a websocket connection: missing or empty sec-websocket-key header",
"failed to open a websocket connection: missing sec-websocket-key header; 'sec-websocket-key'",
]


async def test_accept_connection(ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int):
Expand Down Expand Up @@ -1020,7 +1017,7 @@ async def websocket_session(url: str):
await websocket_session(f"ws://127.0.0.1:{unused_tcp_port}")

assert exception_message == (
"Expected ASGI message 'websocket.http.response.body' but got " "'websocket.http.response.start'."
"Expected ASGI message 'websocket.http.response.body' but got 'websocket.http.response.start'."
)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def test_cli_incomplete_app_parameter() -> None:
result = runner.invoke(cli, ["tests.test_cli"])

assert (
'Error loading ASGI app. Import string "tests.test_cli" ' 'must be in format "<module>:<attribute>".'
'Error loading ASGI app. Import string "tests.test_cli" must be in format "<module>:<attribute>".'
) in result.output
assert result.exit_code == 1

Expand Down
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def test_env_file(
Test that one can load environment variables using an env file.
"""
fp = tmp_path / ".env"
content = f"WEB_CONCURRENCY={web_concurrency}\n" f"FORWARDED_ALLOW_IPS={forwarded_allow_ips}\n"
content = f"WEB_CONCURRENCY={web_concurrency}\nFORWARDED_ALLOW_IPS={forwarded_allow_ips}\n"
fp.write_text(content)
with caplog.at_level(logging.INFO):
config = Config(app=asgi_app, env_file=fp)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_run_invalid_app_config_combination(caplog: pytest.LogCaptureFixture) ->
assert caplog.records[-1].name == "uvicorn.error"
assert caplog.records[-1].levelno == WARNING
assert caplog.records[-1].message == (
"You must pass the application as an import string to enable " "'reload' or 'workers'."
"You must pass the application as an import string to enable 'reload' or 'workers'."
)


Expand Down
4 changes: 2 additions & 2 deletions uvicorn/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def __init__(

if (reload_dirs or reload_includes or reload_excludes) and not self.should_reload:
logger.warning(
"Current configuration will not reload as not all conditions are met, " "please refer to documentation."
"Current configuration will not reload as not all conditions are met, please refer to documentation."
)

if self.should_reload:
Expand Down Expand Up @@ -446,7 +446,7 @@ def load(self) -> None:
else:
if not self.factory:
logger.warning(
"ASGI app factory detected. Using it, " "but please consider setting the --factory flag explicitly."
"ASGI app factory detected. Using it, but please consider setting the --factory flag explicitly."
)

if self.interface == "auto":
Expand Down
10 changes: 5 additions & 5 deletions uvicorn/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def print_version(ctx: click.Context, param: click.Parameter, value: bool) -> No
"--reload-dir",
"reload_dirs",
multiple=True,
help="Set reload directories explicitly, instead of using the current working" " directory.",
help="Set reload directories explicitly, instead of using the current working directory.",
type=click.Path(exists=True),
)
@click.option(
Expand All @@ -106,7 +106,7 @@ def print_version(ctx: click.Context, param: click.Parameter, value: bool) -> No
type=float,
default=0.25,
show_default=True,
help="Delay between previous and next check if application needs to be." " Defaults to 0.25s.",
help="Delay between previous and next check if application needs to be. Defaults to 0.25s.",
)
@click.option(
"--workers",
Expand Down Expand Up @@ -222,7 +222,7 @@ def print_version(ctx: click.Context, param: click.Parameter, value: bool) -> No
"--proxy-headers/--no-proxy-headers",
is_flag=True,
default=True,
help="Enable/Disable X-Forwarded-Proto, X-Forwarded-For, X-Forwarded-Port to " "populate remote address info.",
help="Enable/Disable X-Forwarded-Proto, X-Forwarded-For, X-Forwarded-Port to populate remote address info.",
)
@click.option(
"--server-header/--no-server-header",
Expand Down Expand Up @@ -255,7 +255,7 @@ def print_version(ctx: click.Context, param: click.Parameter, value: bool) -> No
"--limit-concurrency",
type=int,
default=None,
help="Maximum number of concurrent connections or tasks to allow, before issuing" " HTTP 503 responses.",
help="Maximum number of concurrent connections or tasks to allow, before issuing HTTP 503 responses.",
)
@click.option(
"--backlog",
Expand Down Expand Up @@ -565,7 +565,7 @@ def run(

if (config.reload or config.workers > 1) and not isinstance(app, str):
logger = logging.getLogger("uvicorn.error")
logger.warning("You must pass the application as an import string to enable 'reload' or " "'workers'.")
logger.warning("You must pass the application as an import string to enable 'reload' or 'workers'.")
sys.exit(1)

try:
Expand Down
3 changes: 1 addition & 2 deletions uvicorn/middleware/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ def build_environ(scope: HTTPScope, message: ASGIReceiveEvent, body: io.BytesIO)
class _WSGIMiddleware:
def __init__(self, app: WSGIApp, workers: int = 10):
warnings.warn(
"Uvicorn's native WSGI implementation is deprecated, you "
"should switch to a2wsgi (`pip install a2wsgi`).",
"Uvicorn's native WSGI implementation is deprecated, you should switch to a2wsgi (`pip install a2wsgi`).",
DeprecationWarning,
)
self.app = app
Expand Down
8 changes: 4 additions & 4 deletions uvicorn/protocols/websockets/websockets_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def process_subprotocol(
def send_500_response(self) -> None:
msg = b"Internal Server Error"
content = [
b"HTTP/1.1 500 Internal Server Error\r\n" b"content-type: text/plain; charset=utf-8\r\n",
b"HTTP/1.1 500 Internal Server Error\r\ncontent-type: text/plain; charset=utf-8\r\n",
b"content-length: " + str(len(msg)).encode("ascii") + b"\r\n",
b"connection: close\r\n",
b"\r\n",
Expand Down Expand Up @@ -338,7 +338,7 @@ async def asgi_send(self, message: ASGISendEvent) -> None:
self.closed_event.set()

else:
msg = "Expected ASGI message 'websocket.send' or 'websocket.close'," " but got '%s'."
msg = "Expected ASGI message 'websocket.send' or 'websocket.close', but got '%s'."
raise RuntimeError(msg % message_type)
except ConnectionClosed as exc:
raise ClientDisconnected from exc
Expand All @@ -351,11 +351,11 @@ async def asgi_send(self, message: ASGISendEvent) -> None:
if not message.get("more_body", False):
self.closed_event.set()
else:
msg = "Expected ASGI message 'websocket.http.response.body' " "but got '%s'."
msg = "Expected ASGI message 'websocket.http.response.body' but got '%s'."
raise RuntimeError(msg % message_type)

else:
msg = "Unexpected ASGI message '%s', after sending 'websocket.close' " "or response already completed."
msg = "Unexpected ASGI message '%s', after sending 'websocket.close' or response already completed."
raise RuntimeError(msg % message_type)

async def asgi_receive(self) -> WebSocketDisconnectEvent | WebSocketConnectEvent | WebSocketReceiveEvent:
Expand Down
4 changes: 2 additions & 2 deletions uvicorn/protocols/websockets/wsproto_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ async def send(self, message: ASGISendEvent) -> None:
self.transport.close()

else:
msg = "Expected ASGI message 'websocket.send' or 'websocket.close'," " but got '%s'."
msg = "Expected ASGI message 'websocket.send' or 'websocket.close', but got '%s'."
raise RuntimeError(msg % message_type)
except LocalProtocolError as exc:
raise ClientDisconnected from exc
Expand All @@ -362,7 +362,7 @@ async def send(self, message: ASGISendEvent) -> None:
self.transport.close()

else:
msg = "Expected ASGI message 'websocket.http.response.body' " "but got '%s'."
msg = "Expected ASGI message 'websocket.http.response.body' but got '%s'."
raise RuntimeError(msg % message_type)

else:
Expand Down
2 changes: 1 addition & 1 deletion uvicorn/supervisors/statreload.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(
self.mtimes: dict[Path, float] = {}

if config.reload_excludes or config.reload_includes:
logger.warning("--reload-include and --reload-exclude have no effect unless " "watchfiles is installed.")
logger.warning("--reload-include and --reload-exclude have no effect unless watchfiles is installed.")

def should_restart(self) -> list[Path] | None:
self.pause()
Expand Down

0 comments on commit 3014765

Please sign in to comment.