diff --git a/.gitignore b/.gitignore index f47c62c6..932deb9a 100644 --- a/.gitignore +++ b/.gitignore @@ -134,4 +134,4 @@ dmypy.json # Pyre type checker .pyre/ /poetry.lock -.idea/**/* \ No newline at end of file +.idea/**/* diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7b6ae84d..60814145 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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: [ @@ -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"] diff --git a/pandas-stubs/_libs/tslibs/timestamps.pyi b/pandas-stubs/_libs/tslibs/timestamps.pyi index 8cae60fe..76416b7d 100644 --- a/pandas-stubs/_libs/tslibs/timestamps.pyi +++ b/pandas-stubs/_libs/tslibs/timestamps.pyi @@ -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: ... diff --git a/pandas-stubs/_typing.pyi b/pandas-stubs/_typing.pyi index 2655f09f..b567bea3 100644 --- a/pandas-stubs/_typing.pyi +++ b/pandas-stubs/_typing.pyi @@ -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): @@ -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"] diff --git a/pyproject.toml b/pyproject.toml index c22fd5b6..c1477adf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/tests/test_frame.py b/tests/test_frame.py index 99f11b3c..32532a29 100644 --- a/tests/test_frame.py +++ b/tests/test_frame.py @@ -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