Skip to content

Commit 3142762

Browse files
authored
Merge branch 'main' into eliminate-unbounded-queue
2 parents be1c144 + 20f9291 commit 3142762

File tree

11 files changed

+39
-23
lines changed

11 files changed

+39
-23
lines changed

.github/workflows/autodeps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
run: |
2929
python -m pip install -U pip pre-commit
3030
python -m pip install -r test-requirements.txt
31-
uv pip compile --no-strip-markers --python-version=3.8 --upgrade test-requirements.in -o test-requirements.txt
32-
uv pip compile --no-strip-markers --python-version=3.8 --upgrade docs-requirements.in -o docs-requirements.txt
31+
uv pip compile --universal --python-version=3.8 --upgrade test-requirements.in -o test-requirements.txt
32+
uv pip compile --universal --python-version=3.8 --upgrade docs-requirements.in -o docs-requirements.txt
3333
pre-commit autoupdate --jobs 0
3434
- name: Black
3535
run: |

.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.5.1
26+
rev: v0.5.5
2727
hooks:
2828
- id: ruff
2929
types: [file]

check.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ fi
7878

7979
# Check pip compile is consistent
8080
echo "::group::Pip Compile - Tests"
81-
uv pip compile --no-strip-markers --python-version=3.8 test-requirements.in -o test-requirements.txt
81+
uv pip compile --universal --python-version=3.8 test-requirements.in -o test-requirements.txt
8282
echo "::endgroup::"
8383
echo "::group::Pip Compile - Docs"
84-
uv pip compile --no-strip-markers --python-version=3.8 docs-requirements.in -o docs-requirements.txt
84+
uv pip compile --universal --python-version=3.8 docs-requirements.in -o docs-requirements.txt
8585
echo "::endgroup::"
8686

8787
if git status --porcelain | grep -q "requirements.txt"; then

docs-requirements.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file was autogenerated by uv via the following command:
2-
# uv pip compile --no-strip-markers --python-version=3.8 docs-requirements.in -o docs-requirements.txt
2+
# uv pip compile --universal --python-version=3.8 docs-requirements.in -o docs-requirements.txt
33
alabaster==0.7.13
44
# via sphinx
55
attrs==23.2.0
@@ -12,12 +12,18 @@ beautifulsoup4==4.12.3
1212
# via sphinx-codeautolink
1313
certifi==2024.7.4
1414
# via requests
15-
cffi==1.16.0 ; platform_python_implementation != 'PyPy'
16-
# via cryptography
15+
cffi==1.16.0 ; os_name == 'nt' or platform_python_implementation != 'PyPy'
16+
# via
17+
# -r docs-requirements.in
18+
# cryptography
1719
charset-normalizer==3.3.2
1820
# via requests
1921
click==8.1.7
2022
# via towncrier
23+
colorama==0.4.6 ; platform_system == 'Windows' or sys_platform == 'win32'
24+
# via
25+
# click
26+
# sphinx
2127
cryptography==42.0.8
2228
# via pyopenssl
2329
docutils==0.20.1
@@ -51,7 +57,7 @@ outcome==1.3.0.post0
5157
# via -r docs-requirements.in
5258
packaging==24.1
5359
# via sphinx
54-
pycparser==2.22 ; platform_python_implementation != 'PyPy'
60+
pycparser==2.22 ; os_name == 'nt' or platform_python_implementation != 'PyPy'
5561
# via cffi
5662
pygments==2.18.0
5763
# via sphinx

src/trio/_core/_ki.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def decorator(fn: Callable[ArgsT, RetT]) -> Callable[ArgsT, RetT]:
143143
def wrapper(*args: ArgsT.args, **kwargs: ArgsT.kwargs) -> RetT: # type: ignore[misc]
144144
# See the comment for regular generators below
145145
coro = fn(*args, **kwargs)
146+
assert coro.cr_frame is not None, "Coroutine frame should exist"
146147
coro.cr_frame.f_locals[LOCALS_KEY_KI_PROTECTION_ENABLED] = enabled
147148
return coro # type: ignore[return-value]
148149

src/trio/_core/_run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,6 +1782,7 @@ async def python_wrapper(orig_coro: Awaitable[RetT]) -> RetT:
17821782
return await orig_coro
17831783

17841784
coro = python_wrapper(coro)
1785+
assert coro.cr_frame is not None, "Coroutine frame should exist"
17851786
coro.cr_frame.f_locals.setdefault(LOCALS_KEY_KI_PROTECTION_ENABLED, system_task)
17861787

17871788
######

src/trio/_core/_tests/test_run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2704,7 +2704,7 @@ async def start_raiser() -> None:
27042704
else:
27052705
# Check attributes, not identity, because should_be_raiser_exc may be a
27062706
# copy of raiser_exc rather than raiser_exc by identity.
2707-
assert type(should_be_raiser_exc) == type(raiser_exc)
2707+
assert type(should_be_raiser_exc) is type(raiser_exc)
27082708
assert should_be_raiser_exc.message == raiser_exc.message
27092709
assert should_be_raiser_exc.exceptions == raiser_exc.exceptions
27102710

src/trio/_socket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ def __init__(self) -> None:
528528
# make sure this __init__ works with multiple inheritance
529529
super().__init__()
530530
# and only raises error if it's directly constructed
531-
if type(self) == SocketType:
531+
if type(self) is SocketType:
532532
raise TypeError(
533533
"SocketType is an abstract class; use trio.socket.socket if you "
534534
"want to construct a socket object"

src/trio/_tests/test_util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def test_fixup_module_metadata() -> None:
269269
assert mod.SomeClass.method.__module__ == "trio.somemodule" # type: ignore[attr-defined]
270270
assert mod.SomeClass.method.__qualname__ == "SomeClass.method" # type: ignore[attr-defined]
271271
# Make coverage happy.
272-
non_trio_module.some_func() # type: ignore[no-untyped-call]
273-
mod.some_func() # type: ignore[no-untyped-call]
274-
mod._private() # type: ignore[no-untyped-call]
272+
non_trio_module.some_func()
273+
mod.some_func()
274+
mod._private()
275275
mod.SomeClass().method()

test-requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ mypy; implementation_name == "cpython"
1515
types-pyOpenSSL; implementation_name == "cpython" # and annotations
1616
ruff >= 0.4.3
1717
astor # code generation
18-
uv >= 0.2.22
18+
uv >= 0.2.24
1919
codespell
2020

2121
# https://github.com/python-trio/trio/pull/654#issuecomment-420518745

0 commit comments

Comments
 (0)