File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,8 @@ def uv_export(dirname: str, lock_filename: str):
200200 if not os .path .exists (lock_path ):
201201 raise EnvironmentException ("uv.lock not found: %s" % lock_filename )
202202
203- with tempfile .NamedTemporaryFile (mode = "w+" , encoding = "utf-8" ) as tmp_file :
203+ with tempfile .TemporaryDirectory () as tmpdir :
204+ output_path = os .path .join (tmpdir , "requirements.txt.lock" )
204205 try :
205206 result = subprocess .run (
206207 [
@@ -215,7 +216,7 @@ def uv_export(dirname: str, lock_filename: str):
215216 "--no-header" ,
216217 "--no-emit-project" ,
217218 "--output-file" ,
218- tmp_file . name ,
219+ output_path ,
219220 ],
220221 cwd = os .path .dirname (lock_path ),
221222 stdout = sys .stderr ,
@@ -228,7 +229,7 @@ def uv_export(dirname: str, lock_filename: str):
228229 if result .returncode != 0 :
229230 raise EnvironmentException ("Error during uv export: exited with code %d" % result .returncode )
230231
231- with open (tmp_file . name ) as output_file :
232+ with open (output_path ) as output_file :
232233 exported = output_file .read ()
233234
234235 requirements = filter_pip_freeze_output (exported )
You can’t perform that action at this time.
0 commit comments