Skip to content

Commit

Permalink
Bump ruff from 0.1.6 to 0.1.9 (#2396)
Browse files Browse the repository at this point in the history
* Bump ruff from 0.1.6 to 0.1.9

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.1.6 to 0.1.9.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@v0.1.6...v0.1.9)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix code

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
  • Loading branch information
dependabot[bot] and Kludex committed Jan 8, 2024
1 parent 5f9da0b commit d28d491
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
coverage==7.4.0
importlib-metadata==7.0.1
mypy==1.7.1
ruff==0.1.6
ruff==0.1.9
typing_extensions==4.9.0
types-contextvars==2.4.7.3
types-PyYAML==6.0.12.12
Expand Down
2 changes: 1 addition & 1 deletion starlette/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def requires(
scopes_list = [scopes] if isinstance(scopes, str) else list(scopes)

def decorator(
func: typing.Callable[_P, typing.Any]
func: typing.Callable[_P, typing.Any],
) -> typing.Callable[_P, typing.Any]:
sig = inspect.signature(func)
for idx, parameter in enumerate(sig.parameters.values()):
Expand Down
6 changes: 4 additions & 2 deletions starlette/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ def iscoroutinefunction_or_partial(obj: typing.Any) -> bool: # pragma: no cover


def request_response(
func: typing.Callable[[Request], typing.Union[typing.Awaitable[Response], Response]]
func: typing.Callable[
[Request], typing.Union[typing.Awaitable[Response], Response]
],
) -> ASGIApp:
"""
Takes a function or coroutine `func(request) -> response`,
Expand All @@ -78,7 +80,7 @@ async def app(scope: Scope, receive: Receive, send: Send) -> None:


def websocket_session(
func: typing.Callable[[WebSocket], typing.Awaitable[None]]
func: typing.Callable[[WebSocket], typing.Awaitable[None]],
) -> ASGIApp:
"""
Takes a coroutine `func(session)`, and returns an ASGI application.
Expand Down
18 changes: 9 additions & 9 deletions tests/middleware/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ async def downstream_app(scope, receive, send):


def test_read_request_stream_in_app_after_middleware_calls_stream(
test_client_factory: Callable[[ASGIApp], TestClient]
test_client_factory: Callable[[ASGIApp], TestClient],
) -> None:
async def homepage(request: Request):
expected = [b""]
Expand Down Expand Up @@ -527,7 +527,7 @@ async def dispatch(self, request: Request, call_next: RequestResponseEndpoint):


def test_read_request_stream_in_app_after_middleware_calls_body(
test_client_factory: Callable[[ASGIApp], TestClient]
test_client_factory: Callable[[ASGIApp], TestClient],
) -> None:
async def homepage(request: Request):
expected = [b"a", b""]
Expand All @@ -552,7 +552,7 @@ async def dispatch(self, request: Request, call_next: RequestResponseEndpoint):


def test_read_request_body_in_app_after_middleware_calls_stream(
test_client_factory: Callable[[ASGIApp], TestClient]
test_client_factory: Callable[[ASGIApp], TestClient],
) -> None:
async def homepage(request: Request):
assert await request.body() == b""
Expand All @@ -577,7 +577,7 @@ async def dispatch(self, request: Request, call_next: RequestResponseEndpoint):


def test_read_request_body_in_app_after_middleware_calls_body(
test_client_factory: Callable[[ASGIApp], TestClient]
test_client_factory: Callable[[ASGIApp], TestClient],
) -> None:
async def homepage(request: Request):
assert await request.body() == b"a"
Expand All @@ -599,7 +599,7 @@ async def dispatch(self, request: Request, call_next: RequestResponseEndpoint):


def test_read_request_stream_in_dispatch_after_app_calls_stream(
test_client_factory: Callable[[ASGIApp], TestClient]
test_client_factory: Callable[[ASGIApp], TestClient],
) -> None:
async def homepage(request: Request):
expected = [b"a", b""]
Expand Down Expand Up @@ -627,7 +627,7 @@ async def dispatch(self, request: Request, call_next: RequestResponseEndpoint):


def test_read_request_stream_in_dispatch_after_app_calls_body(
test_client_factory: Callable[[ASGIApp], TestClient]
test_client_factory: Callable[[ASGIApp], TestClient],
) -> None:
async def homepage(request: Request):
assert await request.body() == b"a"
Expand Down Expand Up @@ -705,7 +705,7 @@ async def send(msg: Message) -> None:


def test_read_request_stream_in_dispatch_after_app_calls_body_with_middleware_calling_body_before_call_next( # noqa: E501
test_client_factory: Callable[[ASGIApp], TestClient]
test_client_factory: Callable[[ASGIApp], TestClient],
) -> None:
async def homepage(request: Request):
assert await request.body() == b"a"
Expand Down Expand Up @@ -733,7 +733,7 @@ async def dispatch(self, request: Request, call_next: RequestResponseEndpoint):


def test_read_request_body_in_dispatch_after_app_calls_body_with_middleware_calling_body_before_call_next( # noqa: E501
test_client_factory: Callable[[ASGIApp], TestClient]
test_client_factory: Callable[[ASGIApp], TestClient],
) -> None:
async def homepage(request: Request):
assert await request.body() == b"a"
Expand Down Expand Up @@ -837,7 +837,7 @@ async def send(msg: Message):


def test_downstream_middleware_modifies_receive(
test_client_factory: Callable[[ASGIApp], TestClient]
test_client_factory: Callable[[ASGIApp], TestClient],
) -> None:
"""If a downstream middleware modifies receive() the final ASGI app
should see the modified version.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_background.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async def app(scope, receive, send):


def test_multi_tasks_failure_avoids_next_execution(
test_client_factory: Callable[..., TestClient]
test_client_factory: Callable[..., TestClient],
) -> None:
TASK_COUNTER = 0

Expand Down
2 changes: 1 addition & 1 deletion tests/test_routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ async def modified_send(msg: Message) -> None:


def test_websocket_route_middleware(
test_client_factory: typing.Callable[..., TestClient]
test_client_factory: typing.Callable[..., TestClient],
):
async def websocket_endpoint(session: WebSocket):
await session.accept()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_websockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async def app(scope: Scope, receive: Receive, send: Send) -> None:


def test_websocket_ensure_unicode_on_send_json(
test_client_factory: Callable[..., TestClient]
test_client_factory: Callable[..., TestClient],
):
async def app(scope: Scope, receive: Receive, send: Send) -> None:
websocket = WebSocket(scope, receive=receive, send=send)
Expand Down

0 comments on commit d28d491

Please sign in to comment.