From bd8ab856863226ad58b5a70597f990d16836cefa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Wed, 8 May 2024 11:51:34 +0300 Subject: [PATCH] Extended the ruff rule list and applied fixes --- pyproject.toml | 13 ++++++------- src/wheel/bdist_wheel.py | 14 +++++++------- tests/cli/test_pack.py | 1 - tests/cli/test_tags.py | 1 - tests/cli/test_unpack.py | 1 - tests/test_bdist_wheel.py | 1 - tests/test_macosx_libfile.py | 1 - tests/test_wheelfile.py | 1 - 8 files changed, 13 insertions(+), 20 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b7785308..1f7784eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,17 +91,16 @@ omit = ["*/vendored/*"] [tool.coverage.report] show_missing = true -[tool.ruff] -line-length = 88 -src = ["src"] - [tool.ruff.lint] -select = [ - "E", "F", "W", # default flake-8 +extend-select = [ + "B", # flake8-bugbear + "G", # flake8-logging-format "I", # isort + "ISC", # flake8-implicit-str-concat "PGH", # pygrep-hooks + "RUF100", # unused noqa (yesqa) "UP", # pyupgrade - "B", # flake8-bugbear + "W", # pycodestyle warnings ] # Tox (https://tox.wiki/) is a tool for running tests in multiple virtualenvs. diff --git a/src/wheel/bdist_wheel.py b/src/wheel/bdist_wheel.py index cfea6a0f..dbcc6985 100644 --- a/src/wheel/bdist_wheel.py +++ b/src/wheel/bdist_wheel.py @@ -96,7 +96,7 @@ def get_flag( if val is None: if warn: warnings.warn( - f"Config variable '{var}' is unset, Python ABI tag may " "be incorrect", + f"Config variable '{var}' is unset, Python ABI tag may be incorrect", RuntimeWarning, stacklevel=2, ) @@ -192,23 +192,23 @@ class bdist_wheel(Command): ( "relative", None, - "build the archive using relative paths " "(default: false)", + "build the archive using relative paths (default: false)", ), ( "owner=", "u", - "Owner name used when creating a tar file" " [default: current user]", + "Owner name used when creating a tar file [default: current user]", ), ( "group=", "g", - "Group name used when creating a tar file" " [default: current group]", + "Group name used when creating a tar file [default: current group]", ), - ("universal", None, "make a universal wheel" " (default: false)"), + ("universal", None, "make a universal wheel (default: false)"), ( "compression=", None, - "zipfile compression (one of: {})" " (default: 'deflated')".format( + "zipfile compression (one of: {}) (default: 'deflated')".format( ", ".join(supported_compressions) ), ), @@ -228,7 +228,7 @@ class bdist_wheel(Command): ( "py-limited-api=", None, - "Python tag (cp32|cp33|cpNN) for abi3 wheel tag" " (default: false)", + "Python tag (cp32|cp33|cpNN) for abi3 wheel tag (default: false)", ), ] diff --git a/tests/cli/test_pack.py b/tests/cli/test_pack.py index 31f28de1..f0363bcf 100644 --- a/tests/cli/test_pack.py +++ b/tests/cli/test_pack.py @@ -7,7 +7,6 @@ from zipfile import ZipFile import pytest - from wheel.cli.pack import pack THISDIR = os.path.dirname(__file__) diff --git a/tests/cli/test_tags.py b/tests/cli/test_tags.py index 4d4dfa15..6940b10a 100644 --- a/tests/cli/test_tags.py +++ b/tests/cli/test_tags.py @@ -6,7 +6,6 @@ from zipfile import ZipFile import pytest - from wheel.cli import main, parser from wheel.cli.tags import tags from wheel.wheelfile import WheelFile diff --git a/tests/cli/test_unpack.py b/tests/cli/test_unpack.py index ae584af0..be93a3b2 100644 --- a/tests/cli/test_unpack.py +++ b/tests/cli/test_unpack.py @@ -4,7 +4,6 @@ import stat import pytest - from wheel.cli.unpack import unpack from wheel.wheelfile import WheelFile diff --git a/tests/test_bdist_wheel.py b/tests/test_bdist_wheel.py index 1608c568..53aa418b 100644 --- a/tests/test_bdist_wheel.py +++ b/tests/test_bdist_wheel.py @@ -16,7 +16,6 @@ import pytest import setuptools - from wheel.bdist_wheel import ( bdist_wheel, get_abi_tag, diff --git a/tests/test_macosx_libfile.py b/tests/test_macosx_libfile.py index ef8dc967..762d8362 100644 --- a/tests/test_macosx_libfile.py +++ b/tests/test_macosx_libfile.py @@ -5,7 +5,6 @@ import sysconfig import pytest - from wheel.bdist_wheel import get_platform from wheel.macosx_libfile import extract_macosx_min_system_version diff --git a/tests/test_wheelfile.py b/tests/test_wheelfile.py index b5878214..cbc8e802 100644 --- a/tests/test_wheelfile.py +++ b/tests/test_wheelfile.py @@ -5,7 +5,6 @@ from zipfile import ZIP_DEFLATED, ZipFile import pytest - from wheel.cli import WheelError from wheel.wheelfile import WheelFile