Skip to content

Commit 5a130f6

Browse files
committed
Fix ruff violations in get-pip.py
- Fixed E501: Split long line on line 31 across multiple lines - Fixed E402 & I001: Moved and sorted all imports to top of file - Fixed RUF005: Used iterable unpacking instead of concatenation - All imports now properly organized (argparse, importlib, os.path, etc.) Resolves CI failure from job 53408583954
1 parent 2cf43bc commit 5a130f6

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

get-pip.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,29 @@
2020
# If you're wondering how this is created, it is generated using
2121
# `scripts/generate.py` in https://github.com/pypa/get-pip.
2222

23+
import argparse
24+
import importlib
25+
import os.path
26+
import pkgutil
27+
import shutil
2328
import sys
29+
import tempfile
30+
from base64 import b85decode
2431

2532
this_python = sys.version_info[:2]
2633
min_version = (3, 9)
2734
if this_python < min_version:
2835
message_parts = [
2936
"This script does not work on Python {}.{}.".format(*this_python),
3037
"The minimum supported Python version is {}.{}.".format(*min_version),
31-
"Please use https://bootstrap.pypa.io/pip/{}.{}/get-pip.py instead.".format(*this_python),
38+
"Please use https://bootstrap.pypa.io/pip/{}.{}/get-pip.py instead.".format(
39+
*this_python
40+
),
3241
]
3342
print("ERROR: " + " ".join(message_parts))
3443
sys.exit(1)
3544

3645

37-
import os.path
38-
import pkgutil
39-
import shutil
40-
import tempfile
41-
import argparse
42-
import importlib
43-
from base64 import b85decode
44-
45-
4646
def include_setuptools(args):
4747
"""
4848
Install setuptools only if absent, not excluded and when using Python <3.12.
@@ -79,7 +79,7 @@ def determine_pip_install_arguments():
7979
if include_wheel(pre):
8080
args.append("wheel")
8181

82-
return ["install", "--upgrade", "--force-reinstall"] + args
82+
return ["install", "--upgrade", "--force-reinstall", *args]
8383

8484

8585
def monkeypatch_for_cert(tmpdir):

0 commit comments

Comments
 (0)