Skip to content

Commit

Permalink
Apply ruff/pygrep-hooks rule PGH004
Browse files Browse the repository at this point in the history
PGH004 Use specific rule codes when using `noqa`
  • Loading branch information
DimitriPapadopoulos committed Sep 28, 2024
1 parent c48ec13 commit 3273a21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/pip/_internal/utils/unpacking.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
SUPPORTED_EXTENSIONS = ZIP_EXTENSIONS + TAR_EXTENSIONS

try:
import bz2 # noqa
import bz2 # noqa: F401

SUPPORTED_EXTENSIONS += BZ2_EXTENSIONS
except ImportError:
logger.debug("bz2 module is not available")

try:
# Only for Python 3.3+
import lzma # noqa
import lzma # noqa: F401

SUPPORTED_EXTENSIONS += XZ_EXTENSIONS
except ImportError:
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down

0 comments on commit 3273a21

Please sign in to comment.