Skip to content

Commit 8434bde

Browse files
GH1186 Update versions of pre-commit for ruff, black, isort and codespell (#1187)
* GH1186 Update versions of pre-commit for ruff, black, isort and codespell * GH1186 Lock in pyright version waiting for further review * GH1186 PR feedback
1 parent 602401a commit 8434bde

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,4 @@ dmypy.json
134134
# Pyre type checker
135135
.pyre/
136136
/poetry.lock
137-
.idea/**/*
137+
.idea/**/*

.pre-commit-config.yaml

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ ci:
33
autofix_prs: false
44
repos:
55
- repo: https://github.com/python/black
6-
rev: 24.3.0
6+
rev: 25.1.0
77
hooks:
88
- id: black
99
- repo: https://github.com/PyCQA/isort
10-
rev: 5.13.2
10+
rev: 6.0.1
1111
hooks:
1212
- id: isort
1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.3.5
14+
rev: v0.11.5
1515
hooks:
1616
- id: ruff
1717
args: [
@@ -23,7 +23,8 @@ repos:
2323
--fix
2424
]
2525
- repo: https://github.com/codespell-project/codespell
26-
rev: v2.2.6
26+
rev: v2.4.1
2727
hooks:
2828
- id: codespell
2929
additional_dependencies: [ tomli ]
30+
args: [-L, "THIRDPARTY"]

pandas-stubs/_libs/tslibs/timestamps.pyi

+4-4
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ class Timestamp(datetime, SupportsIndex):
104104
@property
105105
def fold(self) -> int: ...
106106

107-
if sys.version_info < (3, 12):
108-
@classmethod
109-
def fromtimestamp(cls, t: float, tz: _tzinfo | str | None = ...) -> Self: ...
110-
else:
107+
if sys.version_info >= (3, 12):
111108
@classmethod
112109
def fromtimestamp( # pyright: ignore[reportIncompatibleMethodOverride]
113110
cls, t: float, tz: _tzinfo | str | None = ...
114111
) -> Self: ...
112+
else:
113+
@classmethod
114+
def fromtimestamp(cls, t: float, tz: _tzinfo | str | None = ...) -> Self: ...
115115

116116
@classmethod
117117
def utcfromtimestamp(cls, ts: float) -> Self: ...

pandas-stubs/_typing.pyi

+6-6
Original file line numberDiff line numberDiff line change
@@ -414,15 +414,15 @@ AnyStr_con = TypeVar("AnyStr_con", str, bytes, contravariant=True)
414414
class BaseBuffer(Protocol):
415415
@property
416416
def mode(self) -> str: ...
417-
def seek(self, __offset: int, __whence: int = ...) -> int: ...
417+
def seek(self, offset: int, whence: int = ..., /) -> int: ...
418418
def seekable(self) -> bool: ...
419419
def tell(self) -> int: ...
420420

421421
class ReadBuffer(BaseBuffer, Protocol[AnyStr_cov]):
422-
def read(self, __n: int = ...) -> AnyStr_cov: ...
422+
def read(self, n: int = ..., /) -> AnyStr_cov: ...
423423

424424
class WriteBuffer(BaseBuffer, Protocol[AnyStr_con]):
425-
def write(self, __b: AnyStr_con) -> Any: ...
425+
def write(self, b: AnyStr_con, /) -> Any: ...
426426
def flush(self) -> Any: ...
427427

428428
class ReadPickleBuffer(ReadBuffer[bytes], Protocol):
@@ -766,10 +766,10 @@ CSVEngine: TypeAlias = Literal["c", "python", "pyarrow", "python-fwf"]
766766
# QUOTE_STRINGS = 4
767767
# QUOTE_NOTNULL = 5
768768
CSVQuotingCompat: TypeAlias = Literal[0, 1, 2, 3]
769-
if sys.version_info < (3, 12):
770-
CSVQuoting: TypeAlias = CSVQuotingCompat
771-
else:
769+
if sys.version_info >= (3, 12):
772770
CSVQuoting: TypeAlias = CSVQuotingCompat | Literal[4, 5]
771+
else:
772+
CSVQuoting: TypeAlias = CSVQuotingCompat
773773

774774
HDFCompLib: TypeAlias = Literal["zlib", "lzo", "bzip2", "blosc"]
775775
ParquetEngine: TypeAlias = Literal["auto", "pyarrow", "fastparquet"]

tests/test_frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ def gethead(s: pd.Series, y: int) -> pd.Series:
899899
pd.DataFrame,
900900
)
901901
check(
902-
# Note that technicaly it does not make sense
902+
# Note that technically it does not make sense
903903
# to pass a result_type of "broadcast" to a scalar return
904904
assert_type(
905905
df.apply(returns_scalar, axis=1, result_type="broadcast"), pd.DataFrame

0 commit comments

Comments
 (0)