Skip to content

Commit 6bac123

Browse files
committed
Ensure annotations.yml and tool.uv.extra-build-dependencies compose
1 parent 376d54b commit 6bac123

3 files changed

Lines changed: 17 additions & 8 deletions

File tree

e2e/cases/BUILD.bazel

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,20 +116,21 @@ write_source_files(
116116
# rule expands env keys correctly given an explicit fixture.
117117
"snapshots/sdist_build.uv_sdist_jdk_build.jpype1.BUILD.bazel": "@sdist_build__uv_sdist_jdk_build__jpype1__1_7_1//:BUILD.bazel",
118118

119-
# @sdist_build for cowsay with native annotation and monitor_memory
120-
# ------------------------------------------------------------------
119+
# @sdist_build for cowsay with composed annotations and monitor_memory
120+
# ---------------------------------------------------------------------
121121
# cowsay is pure Python, so only `native = true` can select
122122
# pep517_native_whl. Its build and native annotations are split so the
123123
# snapshot also pins that a native-only annotation preserves explicit
124-
# and configure-discovered build deps. This retains the monitor-only
125-
# source-build coverage. The runtime //uv-sdist-fallback:test
124+
# and configure-discovered build deps, while legacy build deps compose
125+
# with distinctly marker-qualified uv-native deps. This retains the
126+
# monitor-only source-build coverage. The runtime //uv-sdist-fallback:test
126127
# proves that the forced-native build produces a working wheel.
127128
"snapshots/sdist_build.uv_sdist_fallback.cowsay.BUILD.bazel": "@sdist_build__uv_sdist_fallback__cowsay__6_0//:BUILD.bazel",
128129

129130
# @sdist_build for tqdm with tool.uv.extra-build-dependencies
130131
# -----------------------------------------------------------
131-
# Pins the uv-native annotation path independently of cowsay's legacy
132-
# annotations.toml entry.
132+
# Pins the uv-native annotation and match-runtime paths independently
133+
# of cowsay's composed legacy and uv-native annotations.
133134
"snapshots/sdist_build.uv_sdist_fallback.tqdm.BUILD.bazel": "@sdist_build__uv_sdist_fallback__tqdm__4_52_0//:BUILD.bazel",
134135

135136
# @sdist_build for both conflicting versions of packaging

e2e/cases/uv-sdist-fallback/pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ no-binary-package = ["cowsay", "tqdm"]
2121
[tool.uv.extra-build-dependencies]
2222
# `packaging` is intentionally absent from `default_build_dependencies`, so
2323
# the tqdm snapshot catches a broken uv-native annotation path.
24+
cowsay = [
25+
# Keep two conditional dependencies under distinct markers so composing
26+
# cowsay's legacy annotation does not accidentally discard a marker branch.
27+
"colorama; sys_platform != 'win32'",
28+
"colorama; sys_platform != 'imaginary'",
29+
"pyproject-hooks; sys_platform != 'emscripten'",
30+
]
2431
tqdm = [
2532
# `ssl` is an empty setuptools extra that exercises extra-qualified
2633
# requirements without expanding this fixture's lockfile.

uv/private/extension/defs.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,9 @@ def _parse_projects(module_ctx, hub_specs):
300300
break
301301
deps.append(resolved)
302302
if not skip:
303-
lock_build_dep_anns[target] = deps
304-
lock_conditional_build_dep_anns.pop(target, None)
303+
# Legacy and uv-native annotations compose, including
304+
# any marker-qualified uv-native dependencies.
305+
lock_build_dep_anns[target] = lock_build_dep_anns.get(target, []) + deps
305306

306307
package_overrides = {}
307308
package_console_scripts = {}

0 commit comments

Comments
 (0)