Skip to content

Commit ed2a7d3

Browse files
authored
Merge pull request #3189 from python-trio/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents 1c6a6a8 + d3df5c1 commit ed2a7d3

File tree

10 files changed

+47
-35
lines changed

10 files changed

+47
-35
lines changed

.github/workflows/check-newsfragment.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: Check newsfragment
22

3+
permissions: {}
4+
35
on:
46
pull_request:
57
types: [labeled, unlabeled, opened, synchronize]

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: CI
22

3+
permissions: {}
4+
35
on:
46
push:
57
branches-ignore:

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ on:
33
tags:
44
- v*
55

6+
permissions: {}
7+
68
# a lot of code taken from https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml
79
jobs:
810
build:

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ repos:
2424
hooks:
2525
- id: black
2626
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: v0.9.1
27+
rev: v0.9.2
2828
hooks:
2929
- id: ruff
3030
types: [file]
@@ -43,7 +43,7 @@ repos:
4343
hooks:
4444
- id: sphinx-lint
4545
- repo: https://github.com/woodruffw/zizmor-pre-commit
46-
rev: v1.1.1
46+
rev: v1.2.2
4747
hooks:
4848
- id: zizmor
4949
- repo: local
@@ -56,7 +56,7 @@ repos:
5656
additional_dependencies: ["astor", "attrs", "black", "ruff"]
5757
files: ^src\/trio\/_core\/(_run|(_i(o_(common|epoll|kqueue|windows)|nstrumentation)))\.py$
5858
- repo: https://github.com/astral-sh/uv-pre-commit
59-
rev: 0.5.18
59+
rev: 0.5.21
6060
hooks:
6161
# Compile requirements
6262
- id: pip-compile

src/trio/_core/_tests/test_asyncgen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async def example(cause: str) -> AsyncGenerator[int, None]:
4242

4343
async def async_main() -> None:
4444
# GC'ed before exhausted
45-
with pytest.warns(
45+
with pytest.warns( # noqa: PT031
4646
ResourceWarning,
4747
match="Async generator.*collected before.*exhausted",
4848
):

src/trio/_core/_tests/test_guest_mode.py

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -418,31 +418,34 @@ async def abandoned_main(in_host: InHost) -> None:
418418
with pytest.raises(ZeroDivisionError):
419419
trivial_guest_run(abandoned_main)
420420

421-
with pytest.warns(RuntimeWarning, match="Trio guest run got abandoned"):
421+
with pytest.warns( # noqa: PT031
422+
RuntimeWarning,
423+
match="Trio guest run got abandoned",
424+
):
422425
do_abandoned_guest_run()
423426
gc_collect_harder()
424427

425-
# If you have problems some day figuring out what's holding onto a
426-
# reference to the unrolled_run generator and making this test fail,
427-
# then this might be useful to help track it down. (It assumes you
428-
# also hack start_guest_run so that it does 'global W; W =
429-
# weakref(unrolled_run_gen)'.)
430-
#
431-
# import gc
432-
# print(trio._core._run.W)
433-
# targets = [trio._core._run.W()]
434-
# for i in range(15):
435-
# new_targets = []
436-
# for target in targets:
437-
# new_targets += gc.get_referrers(target)
438-
# new_targets.remove(targets)
439-
# print("#####################")
440-
# print(f"depth {i}: {len(new_targets)}")
441-
# print(new_targets)
442-
# targets = new_targets
443-
444-
with pytest.raises(RuntimeError):
445-
trio.current_time()
428+
# If you have problems some day figuring out what's holding onto a
429+
# reference to the unrolled_run generator and making this test fail,
430+
# then this might be useful to help track it down. (It assumes you
431+
# also hack start_guest_run so that it does 'global W; W =
432+
# weakref(unrolled_run_gen)'.)
433+
#
434+
# import gc
435+
# print(trio._core._run.W)
436+
# targets = [trio._core._run.W()]
437+
# for i in range(15):
438+
# new_targets = []
439+
# for target in targets:
440+
# new_targets += gc.get_referrers(target)
441+
# new_targets.remove(targets)
442+
# print("#####################")
443+
# print(f"depth {i}: {len(new_targets)}")
444+
# print(new_targets)
445+
# targets = new_targets
446+
447+
with pytest.raises(RuntimeError):
448+
trio.current_time()
446449

447450

448451
def aiotrio_run(

src/trio/_tests/test_deprecate.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,10 @@ def test_warning_class() -> None:
270270
warn_deprecated("foo", "bar", issue=None, instead=None)
271271

272272
# essentially the same as the above check
273-
with pytest.warns(DeprecationWarning):
273+
with pytest.warns(
274+
DeprecationWarning,
275+
match="^foo is deprecated since Trio bar with no replacement$",
276+
):
274277
warn_deprecated("foo", "bar", issue=None, instead=None)
275278

276279
with pytest.warns(TrioDeprecationWarning):

src/trio/_tests/test_dtls.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ async def start_and_forget_endpoint() -> int:
749749
during_tasks = trio.lowlevel.current_statistics().tasks_living
750750
return during_tasks
751751

752-
with pytest.warns(ResourceWarning):
752+
with pytest.warns(ResourceWarning): # noqa: PT031
753753
during_tasks = await start_and_forget_endpoint()
754754
await trio.testing.wait_all_tasks_blocked()
755755
gc_collect_harder()
@@ -765,7 +765,7 @@ async def start_and_forget_endpoint() -> int:
765765
async def test_gc_before_system_task_starts() -> None:
766766
e = endpoint()
767767

768-
with pytest.warns(ResourceWarning):
768+
with pytest.warns(ResourceWarning): # noqa: PT031
769769
del e
770770
gc_collect_harder()
771771

@@ -788,7 +788,7 @@ async def test_gc_as_packet_received() -> None:
788788
# At this point, the endpoint's receive loop has been marked runnable because it
789789
# just received a packet; closing the endpoint socket won't interrupt that. But by
790790
# the time it wakes up to process the packet, the endpoint will be gone.
791-
with pytest.warns(ResourceWarning):
791+
with pytest.warns(ResourceWarning): # noqa: PT031
792792
del e
793793
gc_collect_harder()
794794

@@ -805,7 +805,7 @@ async def main() -> DTLSEndpoint:
805805
return endpoint()
806806

807807
e = trio.run(main)
808-
with pytest.warns(ResourceWarning):
808+
with pytest.warns(ResourceWarning): # noqa: PT031
809809
del e
810810
gc_collect_harder()
811811

src/trio/_tests/test_subprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ def broken_terminate(self: Process) -> NoReturn:
676676

677677
monkeypatch.setattr(Process, "terminate", broken_terminate)
678678

679-
with pytest.warns(RuntimeWarning, match=".*whoops.*"):
679+
with pytest.warns(RuntimeWarning, match=".*whoops.*"): # noqa: PT031
680680
async with _core.open_nursery() as nursery:
681681
nursery.start_soon(run_process, SLEEP(9999))
682682
await wait_all_tasks_blocked()
@@ -690,7 +690,7 @@ async def test_warn_on_cancel_SIGKILL_escalation(
690690
) -> None:
691691
monkeypatch.setattr(Process, "terminate", lambda *args: None)
692692

693-
with pytest.warns(RuntimeWarning, match=".*ignored SIGTERM.*"):
693+
with pytest.warns(RuntimeWarning, match=".*ignored SIGTERM.*"): # noqa: PT031
694694
async with _core.open_nursery() as nursery:
695695
nursery.start_soon(run_process, SLEEP(9999))
696696
await wait_all_tasks_blocked()

test-requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ pyyaml==6.0.2
128128
# via pre-commit
129129
requests==2.32.3
130130
# via sphinx
131-
ruff==0.9.1
131+
ruff==0.9.2
132132
# via -r test-requirements.in
133133
sniffio==1.3.1
134134
# via -r test-requirements.in
@@ -181,7 +181,7 @@ typing-extensions==4.12.2
181181
# pyright
182182
urllib3==2.3.0
183183
# via requests
184-
uv==0.5.18
184+
uv==0.5.21
185185
# via -r test-requirements.in
186186
virtualenv==20.28.0
187187
# via pre-commit

0 commit comments

Comments
 (0)