diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 39c1f2b3a6c85..7bd662308afa8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ ci: autofix_prs: false repos: - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.215 + rev: v0.0.244 hooks: - id: ruff - repo: https://github.com/MarcoGorelli/absolufy-imports @@ -25,7 +25,7 @@ repos: - id: absolufy-imports files: ^pandas/ - repo: https://github.com/jendrikseipp/vulture - rev: 'v2.6' + rev: 'v2.7' hooks: - id: vulture entry: python scripts/run_vulture.py @@ -38,7 +38,7 @@ repos: types_or: [python, rst, markdown] additional_dependencies: [tomli] - repo: https://github.com/MarcoGorelli/cython-lint - rev: v0.10.1 + rev: v0.12.4 hooks: - id: cython-lint - id: double-quote-cython-strings @@ -71,12 +71,12 @@ repos: '--filter=-readability/casting,-runtime/int,-build/include_subdir,-readability/fn_size' ] - repo: https://github.com/pycqa/pylint - rev: v2.15.9 + rev: v2.16.1 hooks: - id: pylint stages: [manual] - repo: https://github.com/pycqa/pylint - rev: v2.15.9 + rev: v2.16.1 hooks: - id: pylint alias: redefined-outer-name @@ -101,7 +101,7 @@ repos: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.9.0 + rev: v1.10.0 hooks: - id: rst-backticks - id: rst-directive-colons diff --git a/pandas/_libs/index.pyi b/pandas/_libs/index.pyi index 4b4c4d65d1ea4..e08faaaa03139 100644 --- a/pandas/_libs/index.pyi +++ b/pandas/_libs/index.pyi @@ -52,7 +52,6 @@ class DatetimeEngine(Int64Engine): ... class TimedeltaEngine(DatetimeEngine): ... class PeriodEngine(Int64Engine): ... class BoolEngine(UInt8Engine): ... -class MaskedBoolEngine(MaskedUInt8Engine): ... class MaskedFloat64Engine(MaskedIndexEngine): ... class MaskedFloat32Engine(MaskedIndexEngine): ... class MaskedComplex128Engine(MaskedIndexEngine): ... @@ -65,6 +64,7 @@ class MaskedUInt64Engine(MaskedIndexEngine): ... class MaskedUInt32Engine(MaskedIndexEngine): ... class MaskedUInt16Engine(MaskedIndexEngine): ... class MaskedUInt8Engine(MaskedIndexEngine): ... +class MaskedBoolEngine(MaskedUInt8Engine): ... class BaseMultiIndexCodesEngine: levels: list[np.ndarray] diff --git a/pandas/_libs/tslibs/np_datetime.pxd b/pandas/_libs/tslibs/np_datetime.pxd index fa560cd0853f6..3faef6ed5d46e 100644 --- a/pandas/_libs/tslibs/np_datetime.pxd +++ b/pandas/_libs/tslibs/np_datetime.pxd @@ -108,7 +108,10 @@ cpdef cnp.ndarray astype_overflowsafe( bint round_ok=*, bint is_coerce=*, ) -cdef int64_t get_conversion_factor(NPY_DATETIMEUNIT from_unit, NPY_DATETIMEUNIT to_unit) except? -1 +cdef int64_t get_conversion_factor( + NPY_DATETIMEUNIT from_unit, + NPY_DATETIMEUNIT to_unit, +) except? -1 cdef bint cmp_dtstructs(npy_datetimestruct* left, npy_datetimestruct* right, int op) cdef get_implementation_bounds( diff --git a/pyproject.toml b/pyproject.toml index f4998fbe82722..56c16de0b06b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -246,10 +246,20 @@ ignore = [ "B023", # Functions defined inside a loop must not use variables redefined in the loop # "B301", # not yet implemented + # Too many arguments to function call + "PLR0913", + # Too many returns + "PLR0911", + # Too many branches + "PLR0912", + # Too many statements + "PLR0915", # Additional checks that don't pass yet # Within an except clause, raise exceptions with ... "B904", + # Magic number + "PLR2004", ] exclude = [ @@ -266,6 +276,7 @@ exclude = [ max-line-length = 88 disable = [ # intentionally turned off + "bad-mcs-classmethod-argument", "broad-except", "c-extension-no-member", "comparison-with-itself", @@ -301,6 +312,7 @@ disable = [ "unsupported-assignment-operation", "unsupported-membership-test", "unused-import", + "use-dict-literal", "use-implicit-booleaness-not-comparison", "use-implicit-booleaness-not-len", "wrong-import-order", @@ -311,11 +323,13 @@ disable = [ "no-value-for-parameter", "undefined-variable", "unpacking-non-sequence", + "used-before-assignment", # pylint type "C": convention, for programming standard violation "missing-class-docstring", "missing-function-docstring", "missing-module-docstring", + "superfluous-parens", "too-many-lines", "unidiomatic-typecheck", "unnecessary-dunder-call", @@ -335,6 +349,7 @@ disable = [ "arguments-out-of-order", "arguments-renamed", "attribute-defined-outside-init", + "broad-exception-raised", "comparison-with-callable", "dangerous-default-value", "deprecated-module",