Skip to content

Commit da0a91b

Browse files
committed
Run black
1 parent e6a52f5 commit da0a91b

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

build_env.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ def is_data_file(file: EnvFile) -> bool:
106106

107107

108108
def install_data_file(env_path: pathlib.Path, file: EnvFile) -> None:
109-
if len(file.site_packages_path.parts) > 2 and file.site_packages_path.parts[1] == "scripts":
109+
if (
110+
len(file.site_packages_path.parts) > 2
111+
and file.site_packages_path.parts[1] == "scripts"
112+
):
110113
install_included_script(env_path, file.path)
111114

112115

@@ -125,10 +128,14 @@ def install_files(env_path: pathlib.Path, files: List[EnvFile]) -> None:
125128
else:
126129
install_site_file(site_packages_path, file)
127130

131+
128132
# A copy of importlib_metadata:entry_points that takes a list of search paths.
129133
def entry_points(path: List[str], **params) -> importlib_metadata.EntryPoints:
130134
eps = itertools.chain.from_iterable(
131-
dist.entry_points for dist in importlib_metadata._unique(importlib_metadata.distributions(path=path))
135+
dist.entry_points
136+
for dist in importlib_metadata._unique(
137+
importlib_metadata.distributions(path=path)
138+
)
132139
)
133140
return importlib_metadata.EntryPoints(eps).select(**params)
134141

@@ -137,12 +144,14 @@ def generate_console_scripts(env_path: pathlib.Path) -> None:
137144
site_packages = find_site_packages(env_path)
138145
bin = env_path / "bin"
139146

140-
console_scripts = entry_points(path=[str(site_packages)], group='console_scripts')
147+
console_scripts = entry_points(path=[str(site_packages)], group="console_scripts")
141148
for ep in console_scripts:
142149
script = bin / ep.name
143150
if script.exists():
144151
continue
145-
script.write_text(console_script(env_path, ep.module, ep.attr), encoding="utf-8")
152+
script.write_text(
153+
console_script(env_path, ep.module, ep.attr), encoding="utf-8"
154+
)
146155
script.chmod(0o755)
147156

148157

@@ -166,7 +175,7 @@ def run_additional_commands(env_path: pathlib.Path, commands: List[str]) -> None
166175
for cmd in commands:
167176
pip_cmd = f"pip --no-input {cmd}"
168177
# Echo in green what command is being run
169-
lines.append(fr'echo "\n\033[0;32m> {pip_cmd}\033[0m"')
178+
lines.append(rf'echo "\n\033[0;32m> {pip_cmd}\033[0m"')
170179
lines.append(pip_cmd)
171180

172181
full_command = ";".join(lines)
@@ -178,7 +187,9 @@ def run_additional_commands(env_path: pathlib.Path, commands: List[str]) -> None
178187
for zsh in ["/bin/zsh", "/usr/bin/zsh"]:
179188
if pathlib.Path(zsh).exists():
180189
shell = zsh
181-
ret = subprocess.run(full_command, capture_output=False, shell=True, executable=shell)
190+
ret = subprocess.run(
191+
full_command, capture_output=False, shell=True, executable=shell
192+
)
182193
ret.check_returncode()
183194

184195

0 commit comments

Comments
 (0)