Skip to content

Commit

Permalink
Dependency updates (#2995)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed May 1, 2024
1 parent d39f186 commit 1bb98ae
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 34 deletions.
4 changes: 2 additions & 2 deletions docs-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ docutils==0.20.1
# via
# sphinx
# sphinx-rtd-theme
exceptiongroup==1.2.0
exceptiongroup==1.2.1
# via -r docs-requirements.in
idna==3.6
idna==3.7
# via
# -r docs-requirements.in
# requests
Expand Down
9 changes: 5 additions & 4 deletions src/trio/_core/_ki.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,15 @@ def _ki_protection_decorator(
) -> Callable[[Callable[ArgsT, RetT]], Callable[ArgsT, RetT]]:
# The "ignore[return-value]" below is because the inspect functions cast away the
# original return type of fn, making it just CoroutineType[Any, Any, Any] etc.
# ignore[misc] is because @wraps() is passed a callable with Any in the return type.
def decorator(fn: Callable[ArgsT, RetT]) -> Callable[ArgsT, RetT]:
# In some version of Python, isgeneratorfunction returns true for
# coroutine functions, so we have to check for coroutine functions
# first.
if inspect.iscoroutinefunction(fn):

@wraps(fn)
def wrapper(*args: ArgsT.args, **kwargs: ArgsT.kwargs) -> RetT:
def wrapper(*args: ArgsT.args, **kwargs: ArgsT.kwargs) -> RetT: # type: ignore[misc]
# See the comment for regular generators below
coro = fn(*args, **kwargs)
coro.cr_frame.f_locals[LOCALS_KEY_KI_PROTECTION_ENABLED] = enabled
Expand All @@ -149,7 +150,7 @@ def wrapper(*args: ArgsT.args, **kwargs: ArgsT.kwargs) -> RetT:
elif inspect.isgeneratorfunction(fn):

@wraps(fn)
def wrapper(*args: ArgsT.args, **kwargs: ArgsT.kwargs) -> RetT:
def wrapper(*args: ArgsT.args, **kwargs: ArgsT.kwargs) -> RetT: # type: ignore[misc]
# It's important that we inject this directly into the
# generator's locals, as opposed to setting it here and then
# doing 'yield from'. The reason is, if a generator is
Expand All @@ -165,8 +166,8 @@ def wrapper(*args: ArgsT.args, **kwargs: ArgsT.kwargs) -> RetT:
return wrapper
elif inspect.isasyncgenfunction(fn) or legacy_isasyncgenfunction(fn):

@wraps(fn)
def wrapper(*args: ArgsT.args, **kwargs: ArgsT.kwargs) -> RetT:
@wraps(fn) # type: ignore[arg-type]
def wrapper(*args: ArgsT.args, **kwargs: ArgsT.kwargs) -> RetT: # type: ignore[misc]
# See the comment for regular generators above
agen = fn(*args, **kwargs)
agen.ag_frame.f_locals[LOCALS_KEY_KI_PROTECTION_ENABLED] = enabled
Expand Down
12 changes: 2 additions & 10 deletions src/trio/_tests/type_tests/raisesgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ def check_inheritance_and_assignments() -> None:

a: BaseExceptionGroup[BaseExceptionGroup[ValueError]]
a = RaisesGroup(RaisesGroup(ValueError))
# pyright-ignore due to bug in exceptiongroup
# https://github.com/agronholm/exceptiongroup/pull/101
# once fixed we'll get errors for unnecessary-pyright-ignore and can clean up
a = BaseExceptionGroup(
"", (BaseExceptionGroup("", (ValueError(),)),) # pyright: ignore
)
a = BaseExceptionGroup("", (BaseExceptionGroup("", (ValueError(),)),))
assert a


Expand Down Expand Up @@ -125,11 +120,8 @@ def check_nested_raisesgroups_contextmanager() -> None:

def check_nested_raisesgroups_matches() -> None:
"""Check nested RaisesGroups with .matches"""
# pyright-ignore due to bug in exceptiongroup
# https://github.com/agronholm/exceptiongroup/pull/101
# once fixed we'll get errors for unnecessary-pyright-ignore and can clean up
exc: ExceptionGroup[ExceptionGroup[ValueError]] = ExceptionGroup(
"", (ExceptionGroup("", (ValueError(),)),) # pyright: ignore
"", (ExceptionGroup("", (ValueError(),)),)
)
# has the same problems as check_nested_raisesgroups_contextmanager
if RaisesGroup(RaisesGroup(ValueError)).matches(exc):
Expand Down
37 changes: 19 additions & 18 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ attrs==23.2.0
# outcome
babel==2.14.0
# via sphinx
black==24.3.0 ; implementation_name == "cpython"
black==24.4.2 ; implementation_name == "cpython"
# via -r test-requirements.in
build==1.2.1
# via pip-tools
Expand All @@ -34,7 +34,7 @@ click==8.1.7
# pip-tools
codespell==2.2.6
# via -r test-requirements.in
coverage==7.4.4
coverage==7.5.0
# via -r test-requirements.in
cryptography==42.0.5
# via
Expand All @@ -46,11 +46,11 @@ dill==0.3.8
# via pylint
docutils==0.20.1
# via sphinx
exceptiongroup==1.2.0 ; python_version < "3.11"
exceptiongroup==1.2.1 ; python_version < "3.11"
# via
# -r test-requirements.in
# pytest
idna==3.6
idna==3.7
# via
# -r test-requirements.in
# requests
Expand All @@ -73,7 +73,7 @@ markupsafe==2.1.5
# via jinja2
mccabe==0.7.0
# via pylint
mypy==1.9.0 ; implementation_name == "cpython"
mypy==1.10.0 ; implementation_name == "cpython"
# via -r test-requirements.in
mypy-extensions==1.0.0 ; implementation_name == "cpython"
# via
Expand All @@ -90,17 +90,17 @@ packaging==24.0
# build
# pytest
# sphinx
parso==0.8.3
parso==0.8.4
# via jedi
pathspec==0.12.1
# via black
pip-tools==7.4.1
# via -r test-requirements.in
platformdirs==4.2.0
platformdirs==4.2.1
# via
# black
# pylint
pluggy==1.4.0
pluggy==1.5.0
# via pytest
pycparser==2.22
# via cffi
Expand All @@ -110,19 +110,19 @@ pylint==3.1.0
# via -r test-requirements.in
pyopenssl==24.1.0
# via -r test-requirements.in
pyproject-hooks==1.0.0
pyproject-hooks==1.1.0
# via
# build
# pip-tools
pyright==1.1.356
pyright==1.1.360
# via -r test-requirements.in
pytest==8.1.1
pytest==8.2.0
# via -r test-requirements.in
pytz==2024.1
# via babel
requests==2.31.0
# via sphinx
ruff==0.3.4
ruff==0.4.2
# via -r test-requirements.in
sniffio==1.3.1
# via -r test-requirements.in
Expand Down Expand Up @@ -151,21 +151,22 @@ tomli==2.0.1
# mypy
# pip-tools
# pylint
# pyproject-hooks
# pytest
tomlkit==0.12.4
# via pylint
trustme==1.1.0
# via -r test-requirements.in
types-cffi==1.16.0.20240331 ; implementation_name == "cpython"
# via
# -r test-requirements.in
# types-pyopenssl
types-docutils==0.21.0.20240423
# via -r test-requirements.in
types-docutils==0.20.0.20240331
# via -r test-requirements.in
types-pyopenssl==24.0.0.20240311 ; implementation_name == "cpython"
types-pyopenssl==24.1.0.20240425 ; implementation_name == "cpython"
# via -r test-requirements.in
types-setuptools==69.2.0.20240317
types-setuptools==69.5.0.20240423
# via types-cffi
typing-extensions==4.10.0
typing-extensions==4.11.0
# via
# -r test-requirements.in
# astroid
Expand Down

0 comments on commit 1bb98ae

Please sign in to comment.