From 75ea9c4d7659c2535da6c1fe70954545062d200b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 00:35:22 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v4.6.0) - [github.com/psf/black-pre-commit-mirror: 24.1.1 → 24.4.2](https://github.com/psf/black-pre-commit-mirror/compare/24.1.1...24.4.2) - [github.com/astral-sh/ruff-pre-commit: v0.2.0 → v0.5.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.2.0...v0.5.0) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a7ff48051aad..6f07e47fe200 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,17 +1,17 @@ exclude: '^(mypyc/external/)|(mypy/typeshed/)|misc/typeshed_patches' # Exclude all vendored code from lints repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 # must match test-requirements.txt + rev: v4.6.0 # must match test-requirements.txt hooks: - id: trailing-whitespace - id: end-of-file-fixer - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.1.1 # must match test-requirements.txt + rev: 24.4.2 # must match test-requirements.txt hooks: - id: black exclude: '^(test-data/)' - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.2.0 # must match test-requirements.txt + rev: v0.5.0 # must match test-requirements.txt hooks: - id: ruff args: [--exit-non-zero-on-fix] From f75b8abe641db8c163b14feac5c8e9c43d04672c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 00:35:48 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- mypy/fastparse.py | 2 +- mypy/ipc.py | 3 +-- mypy/stubtest.py | 2 +- mypy/util.py | 3 +-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/mypy/fastparse.py b/mypy/fastparse.py index 342cf36d69e8..d06a3497f8f4 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -2004,7 +2004,7 @@ def visit_UnaryOp(self, n: UnaryOp) -> Type: if ( isinstance(typ, RawExpressionType) # Use type() because we do not want to allow bools. - and type(typ.literal_value) is int # noqa: E721 + and type(typ.literal_value) is int ): if isinstance(n.op, USub): typ.literal_value *= -1 diff --git a/mypy/ipc.py b/mypy/ipc.py index ab01f1b79e7d..991f9ac56652 100644 --- a/mypy/ipc.py +++ b/mypy/ipc.py @@ -17,9 +17,8 @@ if sys.platform == "win32": # This may be private, but it is needed for IPC on Windows, and is basically stable - import ctypes - import _winapi + import ctypes _IPCHandle = int diff --git a/mypy/stubtest.py b/mypy/stubtest.py index a7cde8b8fe6c..ab9605791585 100644 --- a/mypy/stubtest.py +++ b/mypy/stubtest.py @@ -700,7 +700,7 @@ def _verify_arg_default_value( stub_default != runtime_arg.default # We want the types to match exactly, e.g. in case the stub has # True and the runtime has 1 (or vice versa). - or type(stub_default) is not type(runtime_arg.default) # noqa: E721 + or type(stub_default) is not type(runtime_arg.default) ) ): yield ( diff --git a/mypy/util.py b/mypy/util.py index 4b1b918b92e6..d2cba9b7a662 100644 --- a/mypy/util.py +++ b/mypy/util.py @@ -15,9 +15,8 @@ from typing_extensions import Literal try: - import curses - import _curses # noqa: F401 + import curses CURSES_ENABLED = True except ImportError: