Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply preview ruff rules #12981

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ ignore = [
"B020",
"B904", # Ruff enables opinionated warnings by default
"B905", # Ruff enables opinionated warnings by default
"E226",
"F841",
]
select = [
"ASYNC",
Expand Down
6 changes: 2 additions & 4 deletions src/pip/_internal/commands/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
4 changes: 2 additions & 2 deletions src/pip/_internal/locations/_sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
],
)
Expand Down
Loading