From 3273a21bfbc6c31e4142b19b3fc2b43430df96eb Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Sat, 28 Sep 2024 11:04:41 +0200 Subject: [PATCH] Apply ruff/pygrep-hooks rule PGH004 PGH004 Use specific rule codes when using `noqa` --- src/pip/_internal/utils/unpacking.py | 4 ++-- tests/functional/test_install.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pip/_internal/utils/unpacking.py b/src/pip/_internal/utils/unpacking.py index 811c904c9f8..16f159e7f31 100644 --- a/src/pip/_internal/utils/unpacking.py +++ b/src/pip/_internal/utils/unpacking.py @@ -26,7 +26,7 @@ SUPPORTED_EXTENSIONS = ZIP_EXTENSIONS + TAR_EXTENSIONS try: - import bz2 # noqa + import bz2 # noqa: F401 SUPPORTED_EXTENSIONS += BZ2_EXTENSIONS except ImportError: @@ -34,7 +34,7 @@ try: # Only for Python 3.3+ - import lzma # noqa + import lzma # noqa: F401 SUPPORTED_EXTENSIONS += XZ_EXTENSIONS except ImportError: diff --git a/tests/functional/test_install.py b/tests/functional/test_install.py index 8c30a69b515..458d598ddc7 100644 --- a/tests/functional/test_install.py +++ b/tests/functional/test_install.py @@ -1863,7 +1863,7 @@ def test_install_editable_with_wrong_egg_name( def test_install_tar_xz(script: PipTestEnvironment, data: TestData) -> None: try: - import lzma # noqa + import lzma # noqa: F401 except ImportError: pytest.skip("No lzma support") res = script.pip("install", data.packages / "singlemodule-0.0.1.tar.xz") @@ -1872,7 +1872,7 @@ def test_install_tar_xz(script: PipTestEnvironment, data: TestData) -> None: def test_install_tar_lzma(script: PipTestEnvironment, data: TestData) -> None: try: - import lzma # noqa + import lzma # noqa: F401 except ImportError: pytest.skip("No lzma support") res = script.pip("install", data.packages / "singlemodule-0.0.1.tar.lzma")