fix(cli): copy workspace member manifests into the uv export stage

`uv export --package <member>` resolves a member by reading that member's own
pyproject.toml. The export stage copied only the workspace root's
pyproject.toml and uv.lock, so the root named the member but nothing on disk
defined it, and every workspace-member build failed with:

    error: The workspace does not have a member <name>

This is not hypothetical: uv-examples/monorepo fails this way, and the
integration job that builds it has been red.

Copy each member's manifest at its relative path alongside the lockfile. Only
the manifests, since member sources are copied later per member. Single-package
projects are unaffected, as they have no members beyond the root and emit no
extra COPY lines.
This commit is contained in:
Elior Nataf Lackritz
2026-08-14 12:26:51 -04:00
parent 644815f9e5
commit 8d1acadbc9
+13
View File
@@ -970,6 +970,19 @@ def python_config_to_docker_uv_lock(
f"{uv_export_project_dir}/uv.lock",
)
)
# `uv export --package` resolves a member by reading that member's own
# manifest, so the root manifest names it but is not enough to find it. Only
# the manifests are copied; member sources arrive later, per member.
for member_root in sorted(plan.all_workspace_roots - {plan.project_root}):
member_relative = pathlib.PurePosixPath(
member_root.relative_to(plan.project_root).as_posix()
)
docker_plan.add_raw(
copy_from_project_root(
member_relative / "pyproject.toml",
f"{uv_export_project_dir}/{member_relative}/pyproject.toml",
)
)
docker_plan.add_instruction("WORKDIR", uv_export_project_dir)
docker_plan.add_instruction(
"RUN",