From a5f1ecb9f8406dc38a6e4252c8ef1fcc764b0a7f Mon Sep 17 00:00:00 2001 From: MarcoGorelli Date: Sat, 1 Apr 2023 07:04:40 +0000 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20UPGRADE:=20Autoupdate=20pr?= =?UTF-8?q?e-commit=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 10 +++---- pandas/_libs/indexing.pyi | 9 ++---- pandas/_libs/interval.pyi | 7 ++--- pandas/_libs/lib.pyi | 6 ++-- pandas/_libs/ops.pyi | 6 ++-- pandas/_libs/properties.pyi | 2 +- pandas/_libs/tslibs/nattype.pyi | 10 ++----- pandas/_libs/tslibs/offsets.pyi | 19 ++++++------ pandas/_libs/tslibs/timedeltas.pyi | 48 ++---------------------------- pandas/_libs/tslibs/timestamps.pyi | 3 +- typings/numba.pyi | 4 +-- 11 files changed, 32 insertions(+), 92 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index de36bf2d441c5..32abb1291d56a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: types_or: [python, pyi] additional_dependencies: [black==23.1.0] - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.259 + rev: v0.0.260 hooks: - id: ruff args: [--exit-non-zero-on-fix] @@ -40,13 +40,13 @@ repos: pass_filenames: true require_serial: false - repo: https://github.com/codespell-project/codespell - rev: v2.2.2 + rev: v2.2.4 hooks: - id: codespell types_or: [python, rst, markdown, cython, c] additional_dependencies: [tomli] - repo: https://github.com/MarcoGorelli/cython-lint - rev: v0.12.5 + rev: v0.14.0 hooks: - id: cython-lint - id: double-quote-cython-strings @@ -79,12 +79,12 @@ repos: '--filter=-readability/casting,-runtime/int,-build/include_subdir,-readability/fn_size' ] - repo: https://github.com/pycqa/pylint - rev: v2.16.2 + rev: v2.17.1 hooks: - id: pylint stages: [manual] - repo: https://github.com/pycqa/pylint - rev: v2.16.2 + rev: v2.17.1 hooks: - id: pylint alias: redefined-outer-name diff --git a/pandas/_libs/indexing.pyi b/pandas/_libs/indexing.pyi index 3ae5c5044a2f7..1067bc39ab1c7 100644 --- a/pandas/_libs/indexing.pyi +++ b/pandas/_libs/indexing.pyi @@ -1,11 +1,6 @@ -from typing import ( - Generic, - TypeVar, -) +from typing import Generic -from pandas.core.indexing import IndexingMixin - -_IndexingMixinT = TypeVar("_IndexingMixinT", bound=IndexingMixin) +_IndexingMixinT = ... class NDFrameIndexerBase(Generic[_IndexingMixinT]): name: str diff --git a/pandas/_libs/interval.pyi b/pandas/_libs/interval.pyi index 4c36246e04d23..791f3725a9d9d 100644 --- a/pandas/_libs/interval.pyi +++ b/pandas/_libs/interval.pyi @@ -1,7 +1,6 @@ from typing import ( Any, Generic, - TypeVar, overload, ) @@ -16,9 +15,9 @@ from pandas._typing import ( VALID_CLOSED: frozenset[str] -_OrderableScalarT = TypeVar("_OrderableScalarT", int, float) -_OrderableTimesT = TypeVar("_OrderableTimesT", Timestamp, Timedelta) -_OrderableT = TypeVar("_OrderableT", int, float, Timestamp, Timedelta) +_OrderableScalarT = ... +_OrderableTimesT = ... +_OrderableT = ... class _LengthDescriptor: @overload diff --git a/pandas/_libs/lib.pyi b/pandas/_libs/lib.pyi index 2e425f5797c62..b3cabe0be19f2 100644 --- a/pandas/_libs/lib.pyi +++ b/pandas/_libs/lib.pyi @@ -23,15 +23,15 @@ from pandas._typing import ( ) # placeholder until we can specify np.ndarray[object, ndim=2] -ndarray_obj_2d = np.ndarray +ndarray_obj_2d = ... from enum import Enum class _NoDefault(Enum): no_default = ... -no_default: Final = _NoDefault.no_default -NoDefault = Literal[_NoDefault.no_default] +no_default: Final = ... +NoDefault = ... i8max: int u8max: int diff --git a/pandas/_libs/ops.pyi b/pandas/_libs/ops.pyi index 74a6ad87cd279..a2ca0d71dd2b0 100644 --- a/pandas/_libs/ops.pyi +++ b/pandas/_libs/ops.pyi @@ -1,6 +1,4 @@ from typing import ( - Any, - Callable, Iterable, Literal, overload, @@ -10,8 +8,8 @@ import numpy as np from pandas._typing import npt -_BinOp = Callable[[Any, Any], Any] -_BoolOp = Callable[[Any, Any], bool] +_BinOp = ... +_BoolOp = ... def scalar_compare( values: np.ndarray, # object[:] diff --git a/pandas/_libs/properties.pyi b/pandas/_libs/properties.pyi index aaa44a0cf47bf..046f9a47d4eb7 100644 --- a/pandas/_libs/properties.pyi +++ b/pandas/_libs/properties.pyi @@ -13,7 +13,7 @@ from pandas._typing import ( # note: this is a lie to make type checkers happy (they special # case property). cache_readonly uses attribute names similar to # property (fget) but it does not provide fset and fdel. -cache_readonly = property +cache_readonly = ... class AxisProperty: axis: int diff --git a/pandas/_libs/tslibs/nattype.pyi b/pandas/_libs/tslibs/nattype.pyi index 04f8943710416..9c20670433e80 100644 --- a/pandas/_libs/tslibs/nattype.pyi +++ b/pandas/_libs/tslibs/nattype.pyi @@ -1,18 +1,12 @@ -from datetime import ( - datetime, - timedelta, - tzinfo as _tzinfo, -) +from datetime import tzinfo as _tzinfo import numpy as np -from pandas._libs.tslibs.period import Period - NaT: NaTType iNaT: int nat_strings: set[str] -_NaTComparisonTypes = datetime | timedelta | Period | np.datetime64 | np.timedelta64 +_NaTComparisonTypes = ... class _NatComparison: def __call__(self, other: _NaTComparisonTypes) -> bool: ... diff --git a/pandas/_libs/tslibs/offsets.pyi b/pandas/_libs/tslibs/offsets.pyi index c29a057e99ff5..d7b2642a059f8 100644 --- a/pandas/_libs/tslibs/offsets.pyi +++ b/pandas/_libs/tslibs/offsets.pyi @@ -6,7 +6,6 @@ from typing import ( Any, Collection, Literal, - TypeVar, overload, ) @@ -20,9 +19,9 @@ from pandas._typing import ( from .timedeltas import Timedelta -_BaseOffsetT = TypeVar("_BaseOffsetT", bound=BaseOffset) -_DatetimeT = TypeVar("_DatetimeT", bound=datetime) -_TimedeltaT = TypeVar("_TimedeltaT", bound=timedelta) +_BaseOffsetT = ... +_DatetimeT = ... +_TimedeltaT = ... _relativedelta_kwds: set[str] prefix_mapping: dict[str, type] @@ -262,12 +261,12 @@ class CustomBusinessMonthBegin(_CustomBusinessMonth): ... class OffsetMeta(type): ... class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta): ... -BDay = BusinessDay -BMonthEnd = BusinessMonthEnd -BMonthBegin = BusinessMonthBegin -CBMonthEnd = CustomBusinessMonthEnd -CBMonthBegin = CustomBusinessMonthBegin -CDay = CustomBusinessDay +BDay = ... +BMonthEnd = ... +BMonthBegin = ... +CBMonthEnd = ... +CBMonthBegin = ... +CDay = ... def roll_qtrday( other: datetime, n: int, month: int, day_opt: str, modby: int diff --git a/pandas/_libs/tslibs/timedeltas.pyi b/pandas/_libs/tslibs/timedeltas.pyi index 0d5afbfe963f1..813b07ff4220e 100644 --- a/pandas/_libs/tslibs/timedeltas.pyi +++ b/pandas/_libs/tslibs/timedeltas.pyi @@ -1,8 +1,6 @@ from datetime import timedelta from typing import ( ClassVar, - Literal, - TypeVar, overload, ) @@ -19,50 +17,8 @@ from pandas._typing import ( # This should be kept consistent with the keys in the dict timedelta_abbrevs # in pandas/_libs/tslibs/timedeltas.pyx -UnitChoices = Literal[ - "Y", - "y", - "M", - "W", - "w", - "D", - "d", - "days", - "day", - "hours", - "hour", - "hr", - "h", - "m", - "minute", - "min", - "minutes", - "t", - "s", - "seconds", - "sec", - "second", - "ms", - "milliseconds", - "millisecond", - "milli", - "millis", - "l", - "us", - "microseconds", - "microsecond", - "µs", - "micro", - "micros", - "u", - "ns", - "nanoseconds", - "nano", - "nanos", - "nanosecond", - "n", -] -_S = TypeVar("_S", bound=timedelta) +UnitChoices = ... +_S = ... def ints_to_pytimedelta( arr: npt.NDArray[np.timedelta64], diff --git a/pandas/_libs/tslibs/timestamps.pyi b/pandas/_libs/tslibs/timestamps.pyi index d8112dbaf4b48..39912f687866c 100644 --- a/pandas/_libs/tslibs/timestamps.pyi +++ b/pandas/_libs/tslibs/timestamps.pyi @@ -8,7 +8,6 @@ from datetime import ( from time import struct_time from typing import ( ClassVar, - TypeVar, overload, ) @@ -23,7 +22,7 @@ from pandas._libs.tslibs import ( ) from pandas._typing import Self -_DatetimeT = TypeVar("_DatetimeT", bound=datetime) +_DatetimeT = ... def integer_op_not_supported(obj: object) -> TypeError: ... diff --git a/typings/numba.pyi b/typings/numba.pyi index 0d9184af19a0f..6c4f0280f89cb 100644 --- a/typings/numba.pyi +++ b/typings/numba.pyi @@ -39,5 +39,5 @@ def jit( parallel: bool = ..., ) -> Callable[[F], F]: ... -njit = jit -generated_jit = jit +njit = ... +generated_jit = ...