@@ -687,7 +687,9 @@ def step(*x):
687
687
def hash (path ):
688
688
source_paths .append (path )
689
689
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
+ ):
691
693
command = runtime
692
694
requirements = path
693
695
if os .path .isdir (path ):
@@ -703,11 +705,23 @@ def pip_requirements_step(path, prefix=None, required=False, tmp_dir=None, pip_i
703
705
"available in system PATH" .format (command )
704
706
)
705
707
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
+ )
707
716
hash (requirements )
708
717
709
718
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 = [],
711
725
):
712
726
pyproject_file = path
713
727
if os .path .isdir (path ):
@@ -718,7 +732,15 @@ def poetry_install_step(
718
732
"poetry configuration not found: {}" .format (pyproject_file )
719
733
)
720
734
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
+ )
722
744
hash (pyproject_file )
723
745
pyproject_path = os .path .dirname (pyproject_file )
724
746
poetry_lock_file = os .path .join (pyproject_path , "poetry.lock" )
@@ -941,7 +963,13 @@ def execute(self, build_plan, zip_stream, query):
941
963
else :
942
964
zs .write_file (source_path , prefix = prefix , timestamp = ts )
943
965
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 :]
945
973
with install_pip_requirements (
946
974
query , pip_requirements , tmp_dir , pip_install_extra_args
947
975
) as rd :
@@ -954,12 +982,21 @@ def execute(self, build_plan, zip_stream, query):
954
982
# XXX: timestamp=0 - what actually do with it?
955
983
zs .write_dirs (rd , prefix = prefix , timestamp = 0 )
956
984
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 :]
960
993
log .info ("poetry_export_extra_args: %s" , poetry_export_extra_args )
961
994
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 ,
963
1000
) as rd :
964
1001
if rd :
965
1002
if pf :
@@ -1179,7 +1216,9 @@ def install_pip_requirements(query, requirements_file, tmp_dir, pip_install_extr
1179
1216
1180
1217
1181
1218
@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
+ ):
1183
1222
# TODO:
1184
1223
# 1. Emit files instead of temp_dir
1185
1224
@@ -1305,7 +1344,8 @@ def copy_file_to_target(file, temp_dir):
1305
1344
"--prefix=" ,
1306
1345
"--target=." ,
1307
1346
"--requirement=requirements.txt" ,
1308
- ] + pip_install_extra_args ,
1347
+ ]
1348
+ + pip_install_extra_args ,
1309
1349
]
1310
1350
if docker :
1311
1351
with_ssh_agent = docker .with_ssh_agent
0 commit comments