File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22
33import os
4- import pathlib
4+ import shutil
55import sys
6+ from pathlib import Path
67
78from python import runfiles
89
@@ -19,7 +20,6 @@ def _run() -> None:
1920 # Let `uv` know that it was spawned by this Python interpreter
2021 env ["UV_INTERNAL__PARENT_INTERPRETER" ] = sys .executable
2122 args = sys .argv [1 :]
22- running_interactively = "BUILD_WORKSPACE_DIRECTORY" in env
2323
2424 src_out = args [1 ] if args [0 ] == "--src-out" else None
2525 if src_out :
@@ -32,12 +32,13 @@ def _run() -> None:
3232 else :
3333 out = args [1 ]
3434
35- if running_interactively :
36- args [1 ] = pathlib .Path (env ["BUILD_WORKSPACE_DIRECTORY" ]) / out
35+ workspace = env .get ("BUILD_WORKSPACE_DIRECTORY" )
36+ if workspace :
37+ args [1 ] = Path (workspace ) / out
3738 elif src_out :
38- src = pathlib . Path (src_out )
39- dst = pathlib . Path (out )
40- dst . write_text (src . read_text () )
39+ src = Path (src_out )
40+ dst = Path (out )
41+ shutil . copy (src , dst )
4142
4243 uv_args = ["pip" , "compile" ] + args
4344
You can’t perform that action at this time.
0 commit comments