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

Upgrade Black and Ruff #13443

Merged
merged 2 commits into from
Jan 29, 2025
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
args: [--fix=lf]
- id: check-case-conflict
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6 # must match requirements-tests.txt
rev: v0.9.3 # must match requirements-tests.txt
hooks:
- id: ruff
name: Run ruff on stubs, tests and scripts
Expand All @@ -27,7 +27,7 @@ repos:
- "--unsafe-fixes"
files: '.*test_cases/.+\.py$'
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
rev: 25.1.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
Expand Down
2 changes: 1 addition & 1 deletion requirements-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ packaging==24.2
pathspec>=0.11.1
pre-commit
# Required by create_baseline_stubs.py. Must match .pre-commit-config.yaml.
ruff==0.8.5
ruff==0.9.3
stubdefaulter==0.1.0
termcolor>=2.3
tomli==2.2.1
Expand Down
2 changes: 1 addition & 1 deletion stdlib/importlib/resources/_common.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if sys.version_info >= (3, 11):
Anchor: TypeAlias = Package

def package_to_anchor(
func: Callable[[Anchor | None], Traversable]
func: Callable[[Anchor | None], Traversable],
) -> Callable[[Anchor | None, Anchor | None], Traversable]: ...
@overload
def files(anchor: Anchor | None = None) -> Traversable: ...
Expand Down
6 changes: 3 additions & 3 deletions stdlib/inspect.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ if sys.version_info >= (3, 12):
AGEN_CLOSED: Final = "AGEN_CLOSED"

def getasyncgenstate(
agen: AsyncGenerator[Any, Any]
agen: AsyncGenerator[Any, Any],
) -> Literal["AGEN_CREATED", "AGEN_RUNNING", "AGEN_SUSPENDED", "AGEN_CLOSED"]: ...
def getasyncgenlocals(agen: AsyncGeneratorType[Any, Any]) -> dict[str, Any]: ...

Expand Down Expand Up @@ -590,7 +590,7 @@ GEN_SUSPENDED: Final = "GEN_SUSPENDED"
GEN_CLOSED: Final = "GEN_CLOSED"

def getgeneratorstate(
generator: Generator[Any, Any, Any]
generator: Generator[Any, Any, Any],
) -> Literal["GEN_CREATED", "GEN_RUNNING", "GEN_SUSPENDED", "GEN_CLOSED"]: ...

CORO_CREATED: Final = "CORO_CREATED"
Expand All @@ -599,7 +599,7 @@ CORO_SUSPENDED: Final = "CORO_SUSPENDED"
CORO_CLOSED: Final = "CORO_CLOSED"

def getcoroutinestate(
coroutine: Coroutine[Any, Any, Any]
coroutine: Coroutine[Any, Any, Any],
) -> Literal["CORO_CREATED", "CORO_RUNNING", "CORO_SUSPENDED", "CORO_CLOSED"]: ...
def getgeneratorlocals(generator: Generator[Any, Any, Any]) -> dict[str, Any]: ...
def getcoroutinelocals(coroutine: Coroutine[Any, Any, Any]) -> dict[str, Any]: ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/ipaddress.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def ip_network(
address: _RawIPAddress | _RawNetworkPart | tuple[_RawIPAddress] | tuple[_RawIPAddress, int], strict: bool = True
) -> IPv4Network | IPv6Network: ...
def ip_interface(
address: _RawIPAddress | _RawNetworkPart | tuple[_RawIPAddress] | tuple[_RawIPAddress, int]
address: _RawIPAddress | _RawNetworkPart | tuple[_RawIPAddress] | tuple[_RawIPAddress, int],
) -> IPv4Interface | IPv6Interface: ...

class _IPAddressBase:
Expand Down
2 changes: 1 addition & 1 deletion stubs/pyinstaller/pyi_splash/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def update_text(msg: str) -> None: ...
def close() -> None: ...

CLOSE_CONNECTION: Final = b"\x04"
FLUSH_CHARACTER: Final = b"\x0D"
FLUSH_CHARACTER: Final = b"\x0d"
2 changes: 1 addition & 1 deletion stubs/pyserial/serial/threaded/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ from typing_extensions import Self

from serial import Serial

_P = TypeVar("_P", bound=Protocol, default="Protocol") # noqa: Y020
_P = TypeVar("_P", bound=Protocol, default=Protocol)

class Protocol:
def connection_made(self, transport: ReaderThread[Self]) -> None: ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/reportlab/reportlab/lib/colors.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def HexColor(val: str | int, htmlOnly: bool = False, hasAlpha: bool = False) ->
def linearlyInterpolatedColor(c0: _ColorT, c1: _ColorT, x0: float, x1: float, x: float) -> _ColorT: ...
@overload
def obj_R_G_B(
c: Color | list[float] | tuple[float, float, float, float] | tuple[float, float, float]
c: Color | list[float] | tuple[float, float, float, float] | tuple[float, float, float],
) -> tuple[float, float, float]: ...
@overload
def obj_R_G_B(c: None) -> None: ...
Expand Down