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")