Skip to content

Commit

Permalink
Merge branch 'main' into eliminate-unbounded-queue
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolCat467 authored Aug 1, 2024
2 parents be1c144 + 20f9291 commit 3142762
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/autodeps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
run: |
python -m pip install -U pip pre-commit
python -m pip install -r test-requirements.txt
uv pip compile --no-strip-markers --python-version=3.8 --upgrade test-requirements.in -o test-requirements.txt
uv pip compile --no-strip-markers --python-version=3.8 --upgrade docs-requirements.in -o docs-requirements.txt
uv pip compile --universal --python-version=3.8 --upgrade test-requirements.in -o test-requirements.txt
uv pip compile --universal --python-version=3.8 --upgrade docs-requirements.in -o docs-requirements.txt
pre-commit autoupdate --jobs 0
- name: Black
run: |
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.1
rev: v0.5.5
hooks:
- id: ruff
types: [file]
Expand Down
4 changes: 2 additions & 2 deletions check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ fi

# Check pip compile is consistent
echo "::group::Pip Compile - Tests"
uv pip compile --no-strip-markers --python-version=3.8 test-requirements.in -o test-requirements.txt
uv pip compile --universal --python-version=3.8 test-requirements.in -o test-requirements.txt
echo "::endgroup::"
echo "::group::Pip Compile - Docs"
uv pip compile --no-strip-markers --python-version=3.8 docs-requirements.in -o docs-requirements.txt
uv pip compile --universal --python-version=3.8 docs-requirements.in -o docs-requirements.txt
echo "::endgroup::"

if git status --porcelain | grep -q "requirements.txt"; then
Expand Down
14 changes: 10 additions & 4 deletions docs-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file was autogenerated by uv via the following command:
# uv pip compile --no-strip-markers --python-version=3.8 docs-requirements.in -o docs-requirements.txt
# uv pip compile --universal --python-version=3.8 docs-requirements.in -o docs-requirements.txt
alabaster==0.7.13
# via sphinx
attrs==23.2.0
Expand All @@ -12,12 +12,18 @@ beautifulsoup4==4.12.3
# via sphinx-codeautolink
certifi==2024.7.4
# via requests
cffi==1.16.0 ; platform_python_implementation != 'PyPy'
# via cryptography
cffi==1.16.0 ; os_name == 'nt' or platform_python_implementation != 'PyPy'
# via
# -r docs-requirements.in
# cryptography
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via towncrier
colorama==0.4.6 ; platform_system == 'Windows' or sys_platform == 'win32'
# via
# click
# sphinx
cryptography==42.0.8
# via pyopenssl
docutils==0.20.1
Expand Down Expand Up @@ -51,7 +57,7 @@ outcome==1.3.0.post0
# via -r docs-requirements.in
packaging==24.1
# via sphinx
pycparser==2.22 ; platform_python_implementation != 'PyPy'
pycparser==2.22 ; os_name == 'nt' or platform_python_implementation != 'PyPy'
# via cffi
pygments==2.18.0
# via sphinx
Expand Down
1 change: 1 addition & 0 deletions src/trio/_core/_ki.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def decorator(fn: Callable[ArgsT, RetT]) -> Callable[ArgsT, RetT]:
def wrapper(*args: ArgsT.args, **kwargs: ArgsT.kwargs) -> RetT: # type: ignore[misc]
# See the comment for regular generators below
coro = fn(*args, **kwargs)
assert coro.cr_frame is not None, "Coroutine frame should exist"
coro.cr_frame.f_locals[LOCALS_KEY_KI_PROTECTION_ENABLED] = enabled
return coro # type: ignore[return-value]

Expand Down
1 change: 1 addition & 0 deletions src/trio/_core/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -1782,6 +1782,7 @@ async def python_wrapper(orig_coro: Awaitable[RetT]) -> RetT:
return await orig_coro

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

######
Expand Down
2 changes: 1 addition & 1 deletion src/trio/_core/_tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2704,7 +2704,7 @@ async def start_raiser() -> None:
else:
# Check attributes, not identity, because should_be_raiser_exc may be a
# copy of raiser_exc rather than raiser_exc by identity.
assert type(should_be_raiser_exc) == type(raiser_exc)
assert type(should_be_raiser_exc) is type(raiser_exc)
assert should_be_raiser_exc.message == raiser_exc.message
assert should_be_raiser_exc.exceptions == raiser_exc.exceptions

Expand Down
2 changes: 1 addition & 1 deletion src/trio/_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ def __init__(self) -> None:
# make sure this __init__ works with multiple inheritance
super().__init__()
# and only raises error if it's directly constructed
if type(self) == SocketType:
if type(self) is SocketType:
raise TypeError(
"SocketType is an abstract class; use trio.socket.socket if you "
"want to construct a socket object"
Expand Down
6 changes: 3 additions & 3 deletions src/trio/_tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def test_fixup_module_metadata() -> None:
assert mod.SomeClass.method.__module__ == "trio.somemodule" # type: ignore[attr-defined]
assert mod.SomeClass.method.__qualname__ == "SomeClass.method" # type: ignore[attr-defined]
# Make coverage happy.
non_trio_module.some_func() # type: ignore[no-untyped-call]
mod.some_func() # type: ignore[no-untyped-call]
mod._private() # type: ignore[no-untyped-call]
non_trio_module.some_func()
mod.some_func()
mod._private()
mod.SomeClass().method()
2 changes: 1 addition & 1 deletion test-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mypy; implementation_name == "cpython"
types-pyOpenSSL; implementation_name == "cpython" # and annotations
ruff >= 0.4.3
astor # code generation
uv >= 0.2.22
uv >= 0.2.24
codespell

# https://github.com/python-trio/trio/pull/654#issuecomment-420518745
Expand Down
24 changes: 16 additions & 8 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file was autogenerated by uv via the following command:
# uv pip compile --no-strip-markers --python-version=3.8 test-requirements.in -o test-requirements.txt
# uv pip compile --universal --python-version=3.8 test-requirements.in -o test-requirements.txt
alabaster==0.7.13
# via sphinx
astor==0.8.1
Expand All @@ -18,14 +18,22 @@ black==24.4.2 ; implementation_name == 'cpython'
# via -r test-requirements.in
certifi==2024.7.4
# via requests
cffi==1.17.0rc1 ; platform_python_implementation != 'PyPy'
# via cryptography
cffi==1.17.0rc1 ; os_name == 'nt' or platform_python_implementation != 'PyPy'
# via
# -r test-requirements.in
# cryptography
charset-normalizer==3.3.2
# via requests
click==8.1.7 ; implementation_name == 'cpython'
# via black
codespell==2.3.0
# via -r test-requirements.in
colorama==0.4.6 ; sys_platform == 'win32' or (implementation_name == 'cpython' and platform_system == 'Windows')
# via
# click
# pylint
# pytest
# sphinx
coverage==7.5.4
# via -r test-requirements.in
cryptography==42.0.8
Expand All @@ -34,7 +42,7 @@ cryptography==42.0.8
# pyopenssl
# trustme
# types-pyopenssl
dill==0.3.8 ; python_version < '3.11'
dill==0.3.8
# via pylint
docutils==0.20.1
# via sphinx
Expand Down Expand Up @@ -63,7 +71,7 @@ markupsafe==2.1.5
# via jinja2
mccabe==0.7.0
# via pylint
mypy==1.10.1 ; implementation_name == 'cpython'
mypy==1.11.0 ; implementation_name == 'cpython'
# via -r test-requirements.in
mypy-extensions==1.0.0 ; implementation_name == 'cpython'
# via
Expand All @@ -89,7 +97,7 @@ platformdirs==4.2.2
# pylint
pluggy==1.5.0
# via pytest
pycparser==2.22 ; platform_python_implementation != 'PyPy'
pycparser==2.22 ; os_name == 'nt' or platform_python_implementation != 'PyPy'
# via cffi
pygments==2.18.0
# via sphinx
Expand Down Expand Up @@ -127,7 +135,7 @@ sphinxcontrib-qthelp==1.0.3
# via sphinx
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
tomli==2.0.1 ; python_version < '3.11' or (python_version < '3.11' and implementation_name == 'cpython')
tomli==2.0.1 ; python_version < '3.11'
# via
# black
# mypy
Expand Down Expand Up @@ -156,7 +164,7 @@ typing-extensions==4.12.2
# pylint
urllib3==2.2.2
# via requests
uv==0.2.22
uv==0.2.26
# via -r test-requirements.in
zipp==3.19.2 ; python_version < '3.10'
# via importlib-metadata

0 comments on commit 3142762

Please sign in to comment.