Skip to content

Commit 73cc29e

Browse files
github-actions[bot]A5rockspre-commit-ci[bot]
authored
Bump dependencies from commit 79218b (#3441)
* Dependency updates * Add a rudimentary pin for Alpine * Try 1 to fix CI * Try 2 to fix CI * Remove 3.12+ import * Try 3 for CI * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Hopefully final fixes? * Oops * Oops * Hopefully last change :/ * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Oops --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: A5rocks <git@helvetica.moe> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent a35d332 commit 73cc29e

11 files changed

Lines changed: 69 additions & 68 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ jobs:
357357
- build
358358

359359
runs-on: ubuntu-latest
360-
container: alpine
360+
container: alpine:3
361361
steps:
362362
- name: Install necessary packages
363363
# can't use setup-python because that python doesn't seem to work;

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ repos:
2020
- id: sort-simple-yaml
2121
files: .pre-commit-config.yaml
2222
- repo: https://github.com/psf/black-pre-commit-mirror
23-
rev: 26.3.1
23+
rev: 26.5.0
2424
hooks:
2525
- id: black
2626
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: v0.15.12
27+
rev: v0.15.13
2828
hooks:
2929
- id: ruff-check
3030
types: [file]
@@ -38,15 +38,15 @@ repos:
3838
# tomli needed on 3.10. tomllib is available in stdlib on 3.11+
3939
- tomli
4040
- repo: https://github.com/adhtruong/mirrors-typos
41-
rev: v1.46.1
41+
rev: v1.46.2
4242
hooks:
4343
- id: typos
4444
- repo: https://github.com/sphinx-contrib/sphinx-lint
4545
rev: v1.0.2
4646
hooks:
4747
- id: sphinx-lint
4848
- repo: https://github.com/woodruffw/zizmor-pre-commit
49-
rev: v1.24.1
49+
rev: v1.25.2
5050
hooks:
5151
- id: zizmor
5252
- repo: local
@@ -73,7 +73,7 @@ repos:
7373
additional_dependencies: ["pyyaml"]
7474
files: ^(test-requirements\.txt)|(\.pre-commit-config\.yaml)$
7575
- repo: https://github.com/astral-sh/uv-pre-commit
76-
rev: 0.11.13
76+
rev: 0.11.14
7777
hooks:
7878
# Compile requirements
7979
- id: pip-compile

docs-requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ cffi==2.0.0 ; os_name == 'nt' or platform_python_implementation != 'PyPy'
1818
# cryptography
1919
charset-normalizer==3.4.7
2020
# via requests
21-
click==8.3.3
21+
click==8.4.0
2222
# via towncrier
2323
colorama==0.4.6 ; sys_platform == 'win32'
2424
# via
2525
# click
2626
# sphinx
27-
cryptography==47.0.0
27+
cryptography==48.0.0
2828
# via pyopenssl
2929
docutils==0.22.4
3030
# via
3131
# sphinx
3232
# sphinx-rtd-theme
3333
exceptiongroup==1.3.1
3434
# via -r docs-requirements.in
35-
idna==3.13
35+
idna==3.15
3636
# via
3737
# -r docs-requirements.in
3838
# requests
@@ -55,9 +55,9 @@ pycparser==3.0 ; (implementation_name != 'PyPy' and os_name == 'nt') or (impleme
5555
# via cffi
5656
pygments==2.20.0
5757
# via sphinx
58-
pyopenssl==26.1.0
58+
pyopenssl==26.2.0
5959
# via -r docs-requirements.in
60-
requests==2.33.1
60+
requests==2.34.2
6161
# via sphinx
6262
roman-numerals==4.1.0
6363
# via sphinx
@@ -112,5 +112,5 @@ typing-extensions==4.15.0
112112
# beautifulsoup4
113113
# exceptiongroup
114114
# pyopenssl
115-
urllib3==2.6.3
115+
urllib3==2.7.0
116116
# via requests

src/trio/_highlevel_generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ async def send_eof(self) -> None:
113113
return await stream.aclose()
114114

115115
# we intentionally accept more types from the caller than we support returning
116-
async def receive_some(self, max_bytes: int | None = None) -> bytes:
116+
async def receive_some(self, max_bytes: int | None = None) -> bytes | bytearray:
117117
"""Calls ``self.receive_stream.receive_some``."""
118118
return await self.receive_stream.receive_some(max_bytes)
119119

src/trio/_tests/test_dtls.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ async def test_server_socket_doesnt_crash_on_garbage(
486486

487487
async with dtls_echo_server(server_ctx=server_ctx) as (_, address):
488488
with trio.socket.socket(type=trio.socket.SOCK_DGRAM) as sock:
489-
for bad_packet in [
489+
bad_packets: list[bytes | bytearray | memoryview[int]] = [
490490
b"",
491491
b"xyz",
492492
client_hello_extended,
@@ -497,7 +497,9 @@ async def test_server_socket_doesnt_crash_on_garbage(
497497
client_hello_trailing_data_in_record,
498498
handshake_empty,
499499
client_hello_truncated_in_cookie,
500-
]:
500+
]
501+
502+
for bad_packet in bad_packets:
501503
await sock.sendto(bad_packet, address)
502504
await trio.sleep(1)
503505

@@ -532,7 +534,7 @@ def route_packet(packet: UDPPacket) -> None:
532534
offset = len(payload) - 1
533535
cscope.cancel()
534536
payload[offset] ^= 0x01
535-
packet = attrs.evolve(packet, payload=payload)
537+
packet = attrs.evolve(packet, payload=bytes(payload))
536538

537539
fn.deliver_packet(packet)
538540

src/trio/_tests/test_exports.py

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -417,18 +417,7 @@ def lookup_symbol(symbol: str) -> dict[str, Any]: # type: ignore[misc, explicit
417417
# using .remove() instead of .delete() to get an error in case they start not
418418
# being missing
419419

420-
if (
421-
tool == "jedi"
422-
and BaseException in class_.__mro__
423-
and sys.version_info >= (3, 11)
424-
):
425-
missing.remove("add_note")
426-
427-
if (
428-
tool == "mypy"
429-
and BaseException in class_.__mro__
430-
and sys.version_info >= (3, 11)
431-
):
420+
if BaseException in class_.__mro__ and sys.version_info >= (3, 11):
432421
extra.remove("__notes__")
433422

434423
if tool == "mypy" and attrs.has(class_):
@@ -443,8 +432,7 @@ def lookup_symbol(symbol: str) -> dict[str, Any]: # type: ignore[misc, explicit
443432

444433
# dir does not see `__signature__` on enums until 3.14
445434
if (
446-
tool == "mypy"
447-
and enum.Enum in class_.__mro__
435+
enum.Enum in class_.__mro__
448436
and sys.version_info >= (3, 12)
449437
and sys.version_info < (3, 14)
450438
):
@@ -508,16 +496,8 @@ def lookup_symbol(symbol: str) -> dict[str, Any]: # type: ignore[misc, explicit
508496
if tool == "jedi" and sys.platform == "win32":
509497
extra -= {"owner", "is_mount", "group"}
510498

511-
# not sure why jedi in particular ignores this (static?) method in 3.13
512-
if (
513-
tool == "jedi"
514-
and sys.version_info[:2] == (3, 13)
515-
and class_ in (trio.Path, trio.WindowsPath, trio.PosixPath)
516-
):
517-
missing.remove("with_segments")
518-
519499
# tuple subclasses are weird
520-
if issubclass(class_, tuple):
500+
if tool == "mypy" and issubclass(class_, tuple):
521501
extra.remove("__reversed__")
522502
missing.remove("__getnewargs__")
523503

@@ -530,6 +510,22 @@ def lookup_symbol(symbol: str) -> dict[str, Any]: # type: ignore[misc, explicit
530510
missing.discard("__annotate_func__")
531511
missing.discard("__annotations_cache__")
532512

513+
if tool == "jedi" and class_ == trio.open_memory_channel:
514+
# something is seriously wrong with jedi's understanding of open_memory_channel...
515+
for attrib in (
516+
"__add__",
517+
"__contains__",
518+
"__getitem__",
519+
"__getnewargs__",
520+
"__iter__",
521+
"__len__",
522+
"__mul__",
523+
"__rmul__",
524+
"count",
525+
"index",
526+
):
527+
missing.remove(attrib)
528+
533529
if missing or extra: # pragma: no cover
534530
errors[f"{module_name}.{class_name}"] = {
535531
"missing": missing,

src/trio/_tests/test_ssl.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,25 +252,26 @@ async def wait_send_all_might_not_block(self) -> None:
252252
await _core.checkpoint()
253253
await self.sleeper("wait_send_all_might_not_block")
254254

255-
async def send_all(self, data: bytes) -> None:
255+
async def send_all(self, data: bytes | bytearray | memoryview[int]) -> None:
256256
print(" --> transport_stream.send_all")
257+
data_ = bytes(data)
257258
with self._send_all_conflict_detector:
258259
await _core.checkpoint()
259260
await _core.checkpoint()
260261
await self.sleeper("send_all")
261-
self._conn.bio_write(data)
262+
self._conn.bio_write(data_)
262263
while True:
263264
await self.sleeper("send_all")
264265
try:
265-
data = self._conn.recv(1)
266+
data_ = self._conn.recv(1)
266267
except SSL.ZeroReturnError:
267268
self._conn.shutdown()
268269
print("renegotiations:", self._conn.total_renegotiations())
269270
break
270271
except SSL.WantReadError:
271272
break
272273
else:
273-
self._pending_cleartext += data
274+
self._pending_cleartext += data_
274275
self._lot.unpark_all()
275276
await self.sleeper("send_all")
276277
print(" <-- transport_stream.send_all finished")

src/trio/_tests/test_testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ def close_hook() -> None:
416416
async def test_MemoryReceiveStream() -> None:
417417
mrs = MemoryReceiveStream()
418418

419-
async def do_receive_some(max_bytes: int | None) -> bytes:
419+
async def do_receive_some(max_bytes: int | None) -> bytes | bytearray:
420420
with assert_checkpoints():
421421
return await mrs.receive_some(max_bytes)
422422

src/trio/_unix_pipes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def __init__(self, fd: int) -> None:
127127
"another task is using this stream for receive",
128128
)
129129

130-
async def send_all(self, data: bytes) -> None:
130+
async def send_all(self, data: bytes | bytearray | memoryview) -> None:
131131
with self._send_conflict_detector:
132132
# have to check up front, because send_all(b"") on a closed pipe
133133
# should raise

src/trio/_windows_pipes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def __init__(self, handle: int) -> None:
5252
"another task is currently using this pipe",
5353
)
5454

55-
async def send_all(self, data: bytes) -> None:
55+
async def send_all(self, data: bytes | bytearray | memoryview[int]) -> None:
5656
with self._conflict_detector:
5757
if self._handle_holder.closed:
5858
raise _core.ClosedResourceError("this pipe is already closed")
@@ -96,7 +96,7 @@ def __init__(self, handle: int) -> None:
9696
"another task is currently using this pipe",
9797
)
9898

99-
async def receive_some(self, max_bytes: int | None = None) -> bytes:
99+
async def receive_some(self, max_bytes: int | None = None) -> bytes | bytearray:
100100
with self._conflict_detector:
101101
if self._handle_holder.closed:
102102
raise _core.ClosedResourceError("this pipe is already closed")

0 commit comments

Comments
 (0)