Skip to content

Commit d7a22ee

Browse files
committed
feat: add uv.lock to source path
1 parent 49f7e43 commit d7a22ee

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

package.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,6 +1482,7 @@ def strip_editable_self_dependency(requirements_file, query):
14821482
runtime = query.runtime
14831483
docker = query.docker
14841484
docker_image_tag_id = None
1485+
generated_uv_lock = False
14851486

14861487
uv_exec = "uv.exe" if WINDOWS and not docker else "uv"
14871488
subproc_env = None
@@ -1523,6 +1524,7 @@ def strip_editable_self_dependency(requirements_file, query):
15231524
try:
15241525
check_call([uv_exec, "lock"], cwd=temp_dir)
15251526
uv_lock_target = os.path.join(temp_dir, "uv.lock")
1527+
generated_uv_lock = True
15261528
except FileNotFoundError as e:
15271529
raise RuntimeError(
15281530
f"uv must be installed and available in PATH for runtime ({runtime})"
@@ -1602,6 +1604,15 @@ def strip_editable_self_dependency(requirements_file, query):
16021604
env=subproc_env,
16031605
)
16041606

1607+
if generated_uv_lock and os.path.isdir(path):
1608+
source_uv_lock = os.path.join(path, "uv.lock")
1609+
try:
1610+
shutil.copyfile(uv_lock_target, source_uv_lock)
1611+
except Exception as e:
1612+
log.debug(
1613+
"Failed to copy generated uv.lock back to source directory: %s", e
1614+
)
1615+
16051616
# Cleanup copied metadata
16061617
os.remove(pyproject_target)
16071618
if uv_lock_target:

0 commit comments

Comments
 (0)