Skip to content

Commit bc9d121

Browse files
committed
format code
1 parent 78c62b2 commit bc9d121

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

python/private/py_executable_info.bzl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ implementation isn't being used.
7777
7878
:::{versionadded} 1.9.0
7979
:::
80+
""",
81+
"venv_interpreter_runfiles": """
82+
:type: runfiles | None
83+
84+
Runfiles that are specific to the interpreter within the venv.
85+
86+
:::{versionadded} VERSION_NEXT_FEATURE
87+
:::
8088
""",
8189
"venv_python_exe": """
8290
:type: File | None
@@ -87,13 +95,5 @@ mode is not enabled.
8795
:::{versionadded} 1.9.0
8896
:::
8997
""",
90-
"venv_interpreter_runfiles": """
91-
:type: runfiles | None
92-
93-
Runfiles that are specific to the interpreter within the venv.
94-
95-
:::{versionadded} VERSION_NEXT_FEATURE
96-
:::
97-
"""
9898
},
9999
)

python/private/zipapp/zip_main_template.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@
2222
del sys.path[0]
2323

2424
import os
25-
from os.path import dirname, join
2625
import shutil
2726
import stat
2827
import subprocess
2928
import tempfile
3029
import zipfile
31-
from os.path import dirname, join, basename
30+
from os.path import basename, dirname, join
3231

3332
# runfiles-root-relative path
3433
_STAGE2_BOOTSTRAP = "%stage2_bootstrap%"
@@ -53,6 +52,7 @@
5352
# backslashes to be properly understood by Windows APIs.
5453
if IS_WINDOWS:
5554
from os.path import normpath
55+
5656
_STAGE2_BOOTSTRAP = normpath(_STAGE2_BOOTSTRAP)
5757
if _PYTHON_BINARY_VENV:
5858
_PYTHON_BINARY_VENV = normpath(_PYTHON_BINARY_VENV)
@@ -61,6 +61,7 @@
6161
if EXTRACT_ROOT:
6262
EXTRACT_ROOT = normpath(EXTRACT_ROOT)
6363

64+
6465
def print_verbose(*args, mapping=None, values=None):
6566
if not bool(os.environ.get("RULES_PYTHON_BOOTSTRAP_VERBOSE")):
6667
return
@@ -86,7 +87,6 @@ def print_verbose(*args, mapping=None, values=None):
8687
print("bootstrap: stage 1:", *args, file=sys.stderr, flush=True)
8788

8889

89-
9090
def get_windows_path_with_unc_prefix(path):
9191
"""Adds UNC prefix after getting a normalized absolute Windows path.
9292
@@ -308,6 +308,7 @@ def finish_venv_setup(runfiles_root):
308308

309309
return python_program
310310

311+
311312
def main():
312313
print_verbose("running zip main bootstrap")
313314
print_verbose("initial argv:", values=sys.argv)

tests/repl/repl_test.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
IS_WINDOWS = os.name == "nt"
2525

26+
2627
class ReplTest(unittest.TestCase):
2728
def setUp(self):
2829
rpath = "rules_python/python/bin/repl"
@@ -35,7 +36,7 @@ def setUp(self):
3536

3637
def run_code_in_repl(self, lines: Iterable[str], *, env=None) -> str:
3738
"""Runs the lines of code in the REPL and returns the text output."""
38-
input="\n".join(lines)
39+
input = "\n".join(lines)
3940
try:
4041
return subprocess.check_output(
4142
[self.repl],
@@ -48,14 +49,17 @@ def run_code_in_repl(self, lines: Iterable[str], *, env=None) -> str:
4849
raise RuntimeError(f"Failed to run the REPL:\n{error.stdout}") from error
4950
except Exception as exc:
5051
if env:
51-
env_str = "\n".join(f"{key}={value!r}" for key, value in sorted(env.items()))
52+
env_str = "\n".join(
53+
f"{key}={value!r}" for key, value in sorted(env.items())
54+
)
5255
else:
5356
env_str = "<inherited env>"
5457
if isinstance(exc, subprocess.CalledProcessError):
5558
stdout = exc.stdout
5659
else:
5760
stdout = "<unknown>"
58-
exc.add_note(f"""
61+
exc.add_note(
62+
f"""
5963
===== env start =====
6064
{env_str}
6165
===== env end =====
@@ -66,7 +70,8 @@ def run_code_in_repl(self, lines: Iterable[str], *, env=None) -> str:
6670
===== stdout start =====
6771
{stdout}
6872
===== stdout end =====
69-
""")
73+
"""
74+
)
7075
raise
7176

7277
def test_repl_version(self):

0 commit comments

Comments
 (0)