Skip to content

Commit 8bf49e1

Browse files
committed
rename
1 parent 7d08113 commit 8bf49e1

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

python/uv/private/pip_compile.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/usr/bin/env python3
22

33
import os
4-
import pathlib
4+
import shutil
55
import sys
6+
from pathlib import Path
67

78
from 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

0 commit comments

Comments
 (0)