@@ -707,7 +707,7 @@ def pip_requirements_step(path, prefix=None, required=False, tmp_dir=None):
707
707
hash (requirements )
708
708
709
709
def poetry_install_step (
710
- path , poetry_export_extra_args = [], prefix = None , required = False
710
+ path , poetry_export_extra_args = [], prefix = None , required = False , tmp_dir = None
711
711
):
712
712
pyproject_file = path
713
713
if os .path .isdir (path ):
@@ -718,7 +718,7 @@ def poetry_install_step(
718
718
"poetry configuration not found: {}" .format (pyproject_file )
719
719
)
720
720
else :
721
- step ("poetry" , runtime , path , poetry_export_extra_args , prefix )
721
+ step ("poetry" , runtime , path , poetry_export_extra_args , prefix , tmp_dir )
722
722
hash (pyproject_file )
723
723
pyproject_path = os .path .dirname (pyproject_file )
724
724
poetry_lock_file = os .path .join (pyproject_path , "poetry.lock" )
@@ -821,7 +821,9 @@ def commands_step(path, commands):
821
821
pip_requirements = claim .get ("pip_requirements" )
822
822
poetry_install = claim .get ("poetry_install" )
823
823
poetry_export_extra_args = claim .get ("poetry_export_extra_args" , [])
824
- npm_requirements = claim .get ("npm_package_json" )
824
+ npm_requirements = claim .get (
825
+ "npm_requirements" , claim .get ("npm_package_json" )
826
+ )
825
827
runtime = claim .get ("runtime" , query .runtime )
826
828
827
829
if pip_requirements and runtime .startswith ("python" ):
@@ -847,6 +849,7 @@ def commands_step(path, commands):
847
849
prefix = prefix ,
848
850
poetry_export_extra_args = poetry_export_extra_args ,
849
851
required = True ,
852
+ tmp_dir = claim .get ("poetry_tmp_dir" ),
850
853
)
851
854
852
855
if npm_requirements and runtime .startswith ("nodejs" ):
@@ -947,15 +950,12 @@ def execute(self, build_plan, zip_stream, query):
947
950
# XXX: timestamp=0 - what actually do with it?
948
951
zs .write_dirs (rd , prefix = prefix , timestamp = 0 )
949
952
elif cmd == "poetry" :
950
- (
951
- runtime ,
952
- path ,
953
- poetry_export_extra_args ,
954
- prefix ,
955
- ) = action [1 :]
953
+ (runtime , path , poetry_export_extra_args , prefix , tmp_dir ) = action [
954
+ 1 :
955
+ ]
956
956
log .info ("poetry_export_extra_args: %s" , poetry_export_extra_args )
957
957
with install_poetry_dependencies (
958
- query , path , poetry_export_extra_args
958
+ query , path , poetry_export_extra_args , tmp_dir
959
959
) as rd :
960
960
if rd :
961
961
if pf :
@@ -1175,7 +1175,7 @@ def install_pip_requirements(query, requirements_file, tmp_dir):
1175
1175
1176
1176
1177
1177
@contextmanager
1178
- def install_poetry_dependencies (query , path , poetry_export_extra_args ):
1178
+ def install_poetry_dependencies (query , path , poetry_export_extra_args , tmp_dir ):
1179
1179
# TODO:
1180
1180
# 1. Emit files instead of temp_dir
1181
1181
@@ -1229,7 +1229,7 @@ def install_poetry_dependencies(query, path, poetry_export_extra_args):
1229
1229
working_dir = os .getcwd ()
1230
1230
1231
1231
log .info ("Installing python dependencies with poetry & pip: %s" , poetry_lock_file )
1232
- with tempdir () as temp_dir :
1232
+ with tempdir (tmp_dir ) as temp_dir :
1233
1233
1234
1234
def copy_file_to_target (file , temp_dir ):
1235
1235
filename = os .path .basename (file )
0 commit comments