diff --git a/pyproject.toml b/pyproject.toml index 4d8d1181697..d7754d3b39d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -165,6 +165,8 @@ ignore = [ "B020", "B904", # Ruff enables opinionated warnings by default "B905", # Ruff enables opinionated warnings by default + "E226", + "F841", ] select = [ "ASYNC", diff --git a/src/pip/_internal/commands/search.py b/src/pip/_internal/commands/search.py index 74b8d656b47..26bfde63768 100644 --- a/src/pip/_internal/commands/search.py +++ b/src/pip/_internal/commands/search.py @@ -140,10 +140,8 @@ def print_results( if name_column_width is None: name_column_width = ( max( - [ - len(hit["name"]) + len(highest_version(hit.get("versions", ["-"]))) - for hit in hits - ] + len(hit["name"]) + len(highest_version(hit.get("versions", ["-"]))) + for hit in hits ) + 4 ) diff --git a/src/pip/_internal/locations/_sysconfig.py b/src/pip/_internal/locations/_sysconfig.py index ca860ea562c..efc3cbadcf2 100644 --- a/src/pip/_internal/locations/_sysconfig.py +++ b/src/pip/_internal/locations/_sysconfig.py @@ -161,9 +161,9 @@ def get_scheme( scheme_name = "posix_prefix" if home is not None: - variables = {k: home for k in _HOME_KEYS} + variables = dict.fromkeys(_HOME_KEYS, home) elif prefix is not None: - variables = {k: prefix for k in _HOME_KEYS} + variables = dict.fromkeys(_HOME_KEYS, prefix) else: variables = {} diff --git a/tests/unit/test_vcs.py b/tests/unit/test_vcs.py index 13ef42fc43f..81843334615 100644 --- a/tests/unit/test_vcs.py +++ b/tests/unit/test_vcs.py @@ -604,7 +604,7 @@ def test_get_git_version() -> None: ("git version 2.17", (2, 17)), ("git version 2.18.1", (2, 18)), ("git version 2.35.GIT", (2, 35)), # gh:12280 - ("oh my git version 2.37.GIT", ()), # invalid version + ("oh my git version 2.37.GIT", ()), # invalid version ("git version 2.GIT", ()), # invalid version ], )