From ca6971d249080d15cc771c24deb7cb155142760e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Thu, 28 Dec 2023 18:19:49 +0100 Subject: [PATCH 1/2] Upgrade linters --- .pre-commit-config.yaml | 8 ++++---- src/pip/_internal/req/req_uninstall.py | 3 +-- tests/unit/test_vcs.py | 3 +-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 18d911256d3..66fd1e2cda1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ exclude: 'src/pip/_vendor/' repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-builtin-literals - id: check-added-large-files @@ -17,18 +17,18 @@ repos: exclude: .patch - repo: https://github.com/psf/black - rev: 23.7.0 + rev: 23.12.1 hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.4 + rev: v0.1.9 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.6.1 + rev: v1.8.0 hooks: - id: mypy exclude: tests/data diff --git a/src/pip/_internal/req/req_uninstall.py b/src/pip/_internal/req/req_uninstall.py index 3ca10098cf9..707fde1b2b9 100644 --- a/src/pip/_internal/req/req_uninstall.py +++ b/src/pip/_internal/req/req_uninstall.py @@ -172,8 +172,7 @@ def compress_for_output_listing(paths: Iterable[str]) -> Tuple[Set[str], Set[str folders.add(os.path.dirname(path)) files.add(path) - # probably this one https://github.com/python/mypy/issues/390 - _normcased_files = set(map(os.path.normcase, files)) # type: ignore + _normcased_files = set(map(os.path.normcase, files)) folders = compact(folders) diff --git a/tests/unit/test_vcs.py b/tests/unit/test_vcs.py index 5291f129cf7..a52a6217e77 100644 --- a/tests/unit/test_vcs.py +++ b/tests/unit/test_vcs.py @@ -458,8 +458,7 @@ def test_version_control__run_command__fails( with mock.patch("pip._internal.vcs.versioncontrol.call_subprocess") as call: call.side_effect = exc_cls with pytest.raises(BadCommand, match=msg_re.format(name=vcs_cls.name)): - # https://github.com/python/mypy/issues/3283 - vcs_cls.run_command([]) # type: ignore[arg-type] + vcs_cls.run_command([]) @pytest.mark.parametrize( From f63d4c17c80fa04cc4fc5a39cd88eb30db26a860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Mon, 15 Jan 2024 11:51:16 +0100 Subject: [PATCH 2/2] pre-commit: use faster mypyc-compiled version of black Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 66fd1e2cda1..5f06add1eb3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: - id: trailing-whitespace exclude: .patch -- repo: https://github.com/psf/black +- repo: https://github.com/psf/black-pre-commit-mirror rev: 23.12.1 hooks: - id: black