Skip to content

Commit 309eb12

Browse files
committed
ruff fix
1 parent f5f4510 commit 309eb12

File tree

1 file changed

+51
-11
lines changed

1 file changed

+51
-11
lines changed

package.py

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,9 @@ def step(*x):
687687
def hash(path):
688688
source_paths.append(path)
689689

690-
def pip_requirements_step(path, prefix=None, required=False, tmp_dir=None, pip_install_extra_args=[]):
690+
def pip_requirements_step(
691+
path, prefix=None, required=False, tmp_dir=None, pip_install_extra_args=[]
692+
):
691693
command = runtime
692694
requirements = path
693695
if os.path.isdir(path):
@@ -703,11 +705,23 @@ def pip_requirements_step(path, prefix=None, required=False, tmp_dir=None, pip_i
703705
"available in system PATH".format(command)
704706
)
705707

706-
step("pip", runtime, requirements, prefix, tmp_dir, pip_install_extra_args)
708+
step(
709+
"pip",
710+
runtime,
711+
requirements,
712+
prefix,
713+
tmp_dir,
714+
pip_install_extra_args,
715+
)
707716
hash(requirements)
708717

709718
def poetry_install_step(
710-
path, poetry_export_extra_args=[], prefix=None, required=False, tmp_dir=None, pip_install_extra_args=[]
719+
path,
720+
poetry_export_extra_args=[],
721+
prefix=None,
722+
required=False,
723+
tmp_dir=None,
724+
pip_install_extra_args=[],
711725
):
712726
pyproject_file = path
713727
if os.path.isdir(path):
@@ -718,7 +732,15 @@ def poetry_install_step(
718732
"poetry configuration not found: {}".format(pyproject_file)
719733
)
720734
else:
721-
step("poetry", runtime, path, poetry_export_extra_args, prefix, tmp_dir, pip_install_extra_args)
735+
step(
736+
"poetry",
737+
runtime,
738+
path,
739+
poetry_export_extra_args,
740+
prefix,
741+
tmp_dir,
742+
pip_install_extra_args,
743+
)
722744
hash(pyproject_file)
723745
pyproject_path = os.path.dirname(pyproject_file)
724746
poetry_lock_file = os.path.join(pyproject_path, "poetry.lock")
@@ -941,7 +963,13 @@ def execute(self, build_plan, zip_stream, query):
941963
else:
942964
zs.write_file(source_path, prefix=prefix, timestamp=ts)
943965
elif cmd == "pip":
944-
runtime, pip_requirements, prefix, tmp_dir, pip_install_extra_args = action[1:]
966+
(
967+
runtime,
968+
pip_requirements,
969+
prefix,
970+
tmp_dir,
971+
pip_install_extra_args,
972+
) = action[1:]
945973
with install_pip_requirements(
946974
query, pip_requirements, tmp_dir, pip_install_extra_args
947975
) as rd:
@@ -954,12 +982,21 @@ def execute(self, build_plan, zip_stream, query):
954982
# XXX: timestamp=0 - what actually do with it?
955983
zs.write_dirs(rd, prefix=prefix, timestamp=0)
956984
elif cmd == "poetry":
957-
(runtime, path, poetry_export_extra_args, prefix, tmp_dir, pip_install_extra_args) = action[
958-
1:
959-
]
985+
(
986+
runtime,
987+
path,
988+
poetry_export_extra_args,
989+
prefix,
990+
tmp_dir,
991+
pip_install_extra_args,
992+
) = action[1:]
960993
log.info("poetry_export_extra_args: %s", poetry_export_extra_args)
961994
with install_poetry_dependencies(
962-
query, path, poetry_export_extra_args, tmp_dir, pip_install_extra_args
995+
query,
996+
path,
997+
poetry_export_extra_args,
998+
tmp_dir,
999+
pip_install_extra_args,
9631000
) as rd:
9641001
if rd:
9651002
if pf:
@@ -1179,7 +1216,9 @@ def install_pip_requirements(query, requirements_file, tmp_dir, pip_install_extr
11791216

11801217

11811218
@contextmanager
1182-
def install_poetry_dependencies(query, path, poetry_export_extra_args, tmp_dir, pip_install_extra_args):
1219+
def install_poetry_dependencies(
1220+
query, path, poetry_export_extra_args, tmp_dir, pip_install_extra_args
1221+
):
11831222
# TODO:
11841223
# 1. Emit files instead of temp_dir
11851224

@@ -1305,7 +1344,8 @@ def copy_file_to_target(file, temp_dir):
13051344
"--prefix=",
13061345
"--target=.",
13071346
"--requirement=requirements.txt",
1308-
] + pip_install_extra_args,
1347+
]
1348+
+ pip_install_extra_args,
13091349
]
13101350
if docker:
13111351
with_ssh_agent = docker.with_ssh_agent

0 commit comments

Comments
 (0)