Skip to content

GH1186 Update versions of pre-commit for ruff, black, isort and codespell #1187

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

Merged
merged 3 commits into from
Apr 14, 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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ dmypy.json
# Pyre type checker
.pyre/
/poetry.lock
.idea/**/*
.idea/**/*
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ ci:
autofix_prs: false
repos:
- repo: https://github.com/python/black
rev: 24.3.0
rev: 25.1.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
rev: 6.0.1
hooks:
- id: isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.11.5
hooks:
- id: ruff
args: [
Expand All @@ -23,7 +23,8 @@ repos:
--fix
]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies: [ tomli ]
args: [-L, "THIRDPARTY"]
8 changes: 4 additions & 4 deletions pandas-stubs/_libs/tslibs/timestamps.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ class Timestamp(datetime, SupportsIndex):
@property
def fold(self) -> int: ...

if sys.version_info < (3, 12):
@classmethod
def fromtimestamp(cls, t: float, tz: _tzinfo | str | None = ...) -> Self: ...
else:
if sys.version_info >= (3, 12):
@classmethod
def fromtimestamp( # pyright: ignore[reportIncompatibleMethodOverride]
cls, t: float, tz: _tzinfo | str | None = ...
) -> Self: ...
else:
@classmethod
def fromtimestamp(cls, t: float, tz: _tzinfo | str | None = ...) -> Self: ...

@classmethod
def utcfromtimestamp(cls, ts: float) -> Self: ...
Expand Down
12 changes: 6 additions & 6 deletions pandas-stubs/_typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -414,15 +414,15 @@ AnyStr_con = TypeVar("AnyStr_con", str, bytes, contravariant=True)
class BaseBuffer(Protocol):
@property
def mode(self) -> str: ...
def seek(self, __offset: int, __whence: int = ...) -> int: ...
def seek(self, offset: int, whence: int = ..., /) -> int: ...
def seekable(self) -> bool: ...
def tell(self) -> int: ...

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

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

class ReadPickleBuffer(ReadBuffer[bytes], Protocol):
Expand Down Expand Up @@ -766,10 +766,10 @@ CSVEngine: TypeAlias = Literal["c", "python", "pyarrow", "python-fwf"]
# QUOTE_STRINGS = 4
# QUOTE_NOTNULL = 5
CSVQuotingCompat: TypeAlias = Literal[0, 1, 2, 3]
if sys.version_info < (3, 12):
CSVQuoting: TypeAlias = CSVQuotingCompat
else:
if sys.version_info >= (3, 12):
CSVQuoting: TypeAlias = CSVQuotingCompat | Literal[4, 5]
else:
CSVQuoting: TypeAlias = CSVQuotingCompat

HDFCompLib: TypeAlias = Literal["zlib", "lzo", "bzip2", "blosc"]
ParquetEngine: TypeAlias = Literal["auto", "pyarrow", "fastparquet"]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ mypy = "1.15.0"
pandas = "2.2.3"
pyarrow = ">=10.0.1"
pytest = ">=7.1.2"
pyright = ">=1.1.396,!=1.1.398"
pyright = "1.1.397"
poethepoet = ">=0.16.5"
loguru = ">=0.6.0"
typing-extensions = ">=4.4.0"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ def gethead(s: pd.Series, y: int) -> pd.Series:
pd.DataFrame,
)
check(
# Note that technicaly it does not make sense
# Note that technically it does not make sense
# to pass a result_type of "broadcast" to a scalar return
assert_type(
df.apply(returns_scalar, axis=1, result_type="broadcast"), pd.DataFrame
Expand Down