Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump black from 23.9.1 to 24.4.2 #271

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
"""

from __future__ import annotations

import sys
Expand Down
9 changes: 3 additions & 6 deletions mcproto/packets/packet_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

T = TypeVar("T")

def lru_cache(func: T, /) -> T:
...
def lru_cache(func: T, /) -> T: ...

else:
from functools import lru_cache
Expand Down Expand Up @@ -97,16 +96,14 @@ def _walk_module_packets(module_data: WalkableModuleData) -> Iterator[type[Packe
def generate_packet_map(
direction: Literal[PacketDirection.SERVERBOUND],
state: GameState,
) -> Mapping[int, type[ServerBoundPacket]]:
...
) -> Mapping[int, type[ServerBoundPacket]]: ...


@overload
def generate_packet_map(
direction: Literal[PacketDirection.CLIENTBOUND],
state: GameState,
) -> Mapping[int, type[ClientBoundPacket]]:
...
) -> Mapping[int, type[ClientBoundPacket]]: ...


@lru_cache
Expand Down
48 changes: 16 additions & 32 deletions mcproto/protocol/base_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,16 @@ async def write(self, data: bytes, /) -> None:
"""

@overload
async def write_value(self, fmt: INT_FORMATS_TYPE, value: int, /) -> None:
...
async def write_value(self, fmt: INT_FORMATS_TYPE, value: int, /) -> None: ...

@overload
async def write_value(self, fmt: FLOAT_FORMATS_TYPE, value: float, /) -> None:
...
async def write_value(self, fmt: FLOAT_FORMATS_TYPE, value: float, /) -> None: ...

@overload
async def write_value(self, fmt: Literal[StructFormat.BOOL], value: bool, /) -> None:
...
async def write_value(self, fmt: Literal[StructFormat.BOOL], value: bool, /) -> None: ...

@overload
async def write_value(self, fmt: Literal[StructFormat.CHAR], value: str, /) -> None:
...
async def write_value(self, fmt: Literal[StructFormat.CHAR], value: str, /) -> None: ...

async def write_value(self, fmt: StructFormat, value: object, /) -> None:
"""Write a given ``value`` as given struct format (``fmt``) in big-endian mode."""
Expand Down Expand Up @@ -210,20 +206,16 @@ def write(self, data: bytes, /) -> None:
"""

@overload
def write_value(self, fmt: INT_FORMATS_TYPE, value: int, /) -> None:
...
def write_value(self, fmt: INT_FORMATS_TYPE, value: int, /) -> None: ...

@overload
def write_value(self, fmt: FLOAT_FORMATS_TYPE, value: float, /) -> None:
...
def write_value(self, fmt: FLOAT_FORMATS_TYPE, value: float, /) -> None: ...

@overload
def write_value(self, fmt: Literal[StructFormat.BOOL], value: bool, /) -> None:
...
def write_value(self, fmt: Literal[StructFormat.BOOL], value: bool, /) -> None: ...

@overload
def write_value(self, fmt: Literal[StructFormat.CHAR], value: str, /) -> None:
...
def write_value(self, fmt: Literal[StructFormat.CHAR], value: str, /) -> None: ...

def write_value(self, fmt: StructFormat, value: object, /) -> None:
"""Write a given ``value`` as given struct format (``fmt``) in big-endian mode."""
Expand Down Expand Up @@ -335,20 +327,16 @@ async def read(self, length: int, /) -> bytearray:
"""

@overload
async def read_value(self, fmt: INT_FORMATS_TYPE, /) -> int:
...
async def read_value(self, fmt: INT_FORMATS_TYPE, /) -> int: ...

@overload
async def read_value(self, fmt: FLOAT_FORMATS_TYPE, /) -> float:
...
async def read_value(self, fmt: FLOAT_FORMATS_TYPE, /) -> float: ...

@overload
async def read_value(self, fmt: Literal[StructFormat.BOOL], /) -> bool:
...
async def read_value(self, fmt: Literal[StructFormat.BOOL], /) -> bool: ...

@overload
async def read_value(self, fmt: Literal[StructFormat.CHAR], /) -> str:
...
async def read_value(self, fmt: Literal[StructFormat.CHAR], /) -> str: ...

async def read_value(self, fmt: StructFormat, /) -> object:
"""Read a value as given struct format (``fmt``) in big-endian mode.
Expand Down Expand Up @@ -478,20 +466,16 @@ def read(self, length: int, /) -> bytearray:
"""

@overload
def read_value(self, fmt: INT_FORMATS_TYPE, /) -> int:
...
def read_value(self, fmt: INT_FORMATS_TYPE, /) -> int: ...

@overload
def read_value(self, fmt: FLOAT_FORMATS_TYPE, /) -> float:
...
def read_value(self, fmt: FLOAT_FORMATS_TYPE, /) -> float: ...

@overload
def read_value(self, fmt: Literal[StructFormat.BOOL], /) -> bool:
...
def read_value(self, fmt: Literal[StructFormat.BOOL], /) -> bool: ...

@overload
def read_value(self, fmt: Literal[StructFormat.CHAR], /) -> str:
...
def read_value(self, fmt: Literal[StructFormat.CHAR], /) -> str: ...

def read_value(self, fmt: StructFormat, /) -> object:
"""Read a value into given struct format in big-endian mode.
Expand Down
3 changes: 1 addition & 2 deletions mcproto/utils/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ def deprecation_warn(


class DecoratorFunction(Protocol):
def __call__(self, __x: Callable[P, R]) -> Callable[P, R]:
...
def __call__(self, __x: Callable[P, R]) -> Callable[P, R]: ...


def deprecated(
Expand Down
50 changes: 25 additions & 25 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pytest-httpx = { version = ">=0.23.1,<0.25.0", python = ">=3.9,<4" }

[tool.poetry.group.lint.dependencies]
ruff = ">=0.0.278,<0.1.6"
black = ">=22.3,<24.0"
black = ">=22.3,<25.0"
isort = "^5.10.1"
pyright = "^1.1.313"
slotscheck = ">=0.16.1,<0.18.0"
Expand Down
Loading