Skip to content

Commit 5da94bf

Browse files
github-actions[bot]TeamSpen210pre-commit-ci[bot]CoolCat467
authored
Bump dependencies from commit 80eec9 (#3025)
* Dependency updates * Remove now-unnecessary ruff parameter * Adjust ruff ignores to new error codes * Simplify some comparisons * [pre-commit.ci] auto fixes from pre-commit.com hooks * Fixing remaning new ruff issues * Use cffi 1.17.0rc1 so 3.13 runner doesn't crash --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Spencer Brown <spencerb21@live.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: CoolCat467 <52022020+CoolCat467@users.noreply.github.com>
1 parent 80eec96 commit 5da94bf

16 files changed

+52
-56
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repos:
2323
hooks:
2424
- id: black
2525
- repo: https://github.com/astral-sh/ruff-pre-commit
26-
rev: v0.4.10
26+
rev: v0.5.0
2727
hooks:
2828
- id: ruff
2929
types: [file]

docs-requirements.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ babel==2.15.0
1414
# via sphinx
1515
beautifulsoup4==4.12.3
1616
# via sphinx-codeautolink
17-
certifi==2024.2.2
17+
certifi==2024.6.2
1818
# via requests
1919
cffi==1.16.0
2020
# via cryptography
2121
charset-normalizer==3.3.2
2222
# via requests
2323
click==8.1.7
2424
# via towncrier
25-
cryptography==42.0.7
25+
cryptography==42.0.8
2626
# via pyopenssl
2727
docutils==0.20.1
2828
# via
@@ -38,7 +38,7 @@ imagesize==1.4.1
3838
# via sphinx
3939
immutables==0.20
4040
# via -r docs-requirements.in
41-
importlib-metadata==7.1.0
41+
importlib-metadata==8.0.0
4242
# via sphinx
4343
importlib-resources==6.4.0
4444
# via towncrier
@@ -53,7 +53,7 @@ markupsafe==2.1.5
5353
# via jinja2
5454
outcome==1.3.0.post0
5555
# via -r docs-requirements.in
56-
packaging==24.0
56+
packaging==24.1
5757
# via sphinx
5858
pycparser==2.22
5959
# via cffi
@@ -81,7 +81,7 @@ sphinx==7.1.2
8181
# sphinx-rtd-theme
8282
# sphinxcontrib-jquery
8383
# sphinxcontrib-trio
84-
sphinx-codeautolink==0.15.1
84+
sphinx-codeautolink==0.15.2
8585
# via -r docs-requirements.in
8686
sphinx-hoverxref==1.4.0
8787
# via -r docs-requirements.in
@@ -110,9 +110,9 @@ tomli==2.0.1
110110
# via towncrier
111111
towncrier==23.11.0
112112
# via -r docs-requirements.in
113-
urllib3==2.2.1
113+
urllib3==2.2.2
114114
# via requests
115-
zipp==3.19.1
115+
zipp==3.19.2
116116
# via
117117
# importlib-metadata
118118
# importlib-resources

notes-to-self/blocking-read-hack.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ class BlockingReadTimeoutError(Exception):
1111
pass
1212

1313

14-
async def blocking_read_with_timeout(fd, count, timeout):
14+
async def blocking_read_with_timeout(
15+
fd, count, timeout # noqa: ASYNC109 # manual timeout
16+
):
1517
print("reading from fd", fd)
1618
cancel_requested = False
1719

notes-to-self/loopy.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
async def loopy():
77
try:
88
while True:
9-
time.sleep( # noqa: ASYNC101 # synchronous sleep to avoid maxing out CPU
10-
0.01
11-
)
12-
await trio.sleep(0)
9+
# synchronous sleep to avoid maxing out CPU
10+
time.sleep(0.01) # noqa: ASYNC251
11+
await trio.lowlevel.checkpoint()
1312
except KeyboardInterrupt:
1413
print("KI!")
1514

notes-to-self/schedule-timing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ async def reschedule_loop(depth):
1111
global LOOPS
1212
while RUNNING:
1313
LOOPS += 1
14-
await trio.sleep(0)
14+
await trio.lowlevel.checkpoint()
1515
# await trio.lowlevel.cancel_shielded_checkpoint()
1616
else:
1717
await reschedule_loop(depth - 1)

src/trio/_core/_tests/test_guest_mode.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def done_callback(outcome: Outcome[T]) -> None:
111111

112112
def test_guest_trivial() -> None:
113113
async def trio_return(in_host: InHost) -> str:
114-
await trio.sleep(0)
114+
await trio.lowlevel.checkpoint()
115115
return "ok"
116116

117117
assert trivial_guest_run(trio_return) == "ok"
@@ -149,7 +149,7 @@ def test_guest_is_initialized_when_start_returns() -> None:
149149

150150
async def trio_main(in_host: InHost) -> str:
151151
record.append("main task ran")
152-
await trio.sleep(0)
152+
await trio.lowlevel.checkpoint()
153153
assert trio.lowlevel.current_trio_token() is trio_token
154154
return "ok"
155155

@@ -164,7 +164,7 @@ def after_start() -> None:
164164
@trio.lowlevel.spawn_system_task
165165
async def early_task() -> None:
166166
record.append("system task ran")
167-
await trio.sleep(0)
167+
await trio.lowlevel.checkpoint()
168168

169169
res = trivial_guest_run(trio_main, in_host_after_start=after_start)
170170
assert res == "ok"
@@ -396,7 +396,7 @@ def do_abandoned_guest_run() -> None:
396396
async def abandoned_main(in_host: InHost) -> None:
397397
in_host(lambda: 1 / 0)
398398
while True:
399-
await trio.sleep(0)
399+
await trio.lowlevel.checkpoint()
400400

401401
with pytest.raises(ZeroDivisionError):
402402
trivial_guest_run(abandoned_main)
@@ -472,7 +472,7 @@ async def trio_main() -> str:
472472

473473
# Make sure we have at least one tick where we don't need to go into
474474
# the thread
475-
await trio.sleep(0)
475+
await trio.lowlevel.checkpoint()
476476

477477
from_trio.put_nowait(0)
478478

@@ -540,7 +540,7 @@ async def crash_in_run_loop(in_host: InHost) -> None:
540540

541541
async def crash_in_io(in_host: InHost) -> None:
542542
m.setattr("trio._core._run.TheIOManager.get_events", None)
543-
await trio.sleep(0)
543+
await trio.lowlevel.checkpoint()
544544

545545
with pytest.raises(trio.TrioInternalError):
546546
trivial_guest_run(crash_in_io)

src/trio/_core/_tests/test_run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ async def test_current_time() -> None:
259259
t1 = _core.current_time()
260260
# Windows clock is pretty low-resolution -- appveyor tests fail unless we
261261
# sleep for a bit here.
262-
time.sleep(time.get_clock_info("perf_counter").resolution) # noqa: ASYNC101
262+
time.sleep(time.get_clock_info("perf_counter").resolution) # noqa: ASYNC251
263263
t2 = _core.current_time()
264264
assert t1 < t2
265265

src/trio/_core/_tests/test_windows.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ async def test_readinto_overlapped() -> None:
116116

117117
with tempfile.TemporaryDirectory() as tdir:
118118
tfile = os.path.join(tdir, "numbers.txt")
119-
with open( # noqa: ASYNC101 # This is a test, synchronous is ok
119+
with open( # noqa: ASYNC230 # This is a test, synchronous is ok
120120
tfile, "wb"
121121
) as fp:
122122
fp.write(data)
@@ -224,7 +224,7 @@ async def test_too_late_to_cancel() -> None:
224224
# Note: not trio.sleep! We're making sure the OS level
225225
# ReadFile completes, before Trio has a chance to execute
226226
# another checkpoint and notice it completed.
227-
time.sleep(1) # noqa: ASYNC101
227+
time.sleep(1) # noqa: ASYNC251
228228
nursery.cancel_scope.cancel()
229229
assert target[:6] == b"test1\n"
230230

src/trio/_tests/test_exports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def lookup_symbol(symbol: str) -> dict[str, str]:
346346
"__deepcopy__",
347347
}
348348

349-
if type(class_) == type:
349+
if type(class_) is type:
350350
# C extension classes don't have these dunders, but Python classes do
351351
ignore_names.add("__firstlineno__")
352352
ignore_names.add("__static_attributes__")

src/trio/_tests/test_file_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ async def test_detach_rewraps_asynciobase(tmp_path: pathlib.Path) -> None:
251251
tmp_file = tmp_path / "filename"
252252
tmp_file.touch()
253253
# flake8-async does not like opening files in async mode
254-
with open(tmp_file, mode="rb", buffering=0) as raw: # noqa: ASYNC101
254+
with open(tmp_file, mode="rb", buffering=0) as raw: # noqa: ASYNC230
255255
buffered = io.BufferedReader(raw)
256256

257257
async_file = trio.wrap_file(buffered)

0 commit comments

Comments
 (0)