xref: /aosp_15_r20/external/bazelbuild-rules_python/tests/uv/toolchain/BUILD.bazel (revision 60517a1edbc8ecf509223e9af94a7adec7d736b8)
1*60517a1eSAndroid Build Coastguard Workerload("//python:py_test.bzl", "py_test")
2*60517a1eSAndroid Build Coastguard Workerload("//python/private:bzlmod_enabled.bzl", "BZLMOD_ENABLED")  # buildifier: disable=bzl-visibility
3*60517a1eSAndroid Build Coastguard Worker
4*60517a1eSAndroid Build Coastguard Worker# We only test this feature when `bzlmod` is enabled.
5*60517a1eSAndroid Build Coastguard Worker_TARGET_COMPATIBLE_WITH = [] if BZLMOD_ENABLED else ["@platforms//:incompatible"]
6*60517a1eSAndroid Build Coastguard Worker
7*60517a1eSAndroid Build Coastguard Workergenrule(
8*60517a1eSAndroid Build Coastguard Worker    name = "uv_help",
9*60517a1eSAndroid Build Coastguard Worker    outs = ["uv_help.txt"],
10*60517a1eSAndroid Build Coastguard Worker    cmd = "$(UV_BIN) --python-fetch manual --help >$@",
11*60517a1eSAndroid Build Coastguard Worker    target_compatible_with = _TARGET_COMPATIBLE_WITH,
12*60517a1eSAndroid Build Coastguard Worker    toolchains = ["//python/uv:current_toolchain"],
13*60517a1eSAndroid Build Coastguard Worker)
14*60517a1eSAndroid Build Coastguard Worker
15*60517a1eSAndroid Build Coastguard Workerpy_test(
16*60517a1eSAndroid Build Coastguard Worker    name = "uv_help_test",
17*60517a1eSAndroid Build Coastguard Worker    srcs = ["uv_help_test.py"],
18*60517a1eSAndroid Build Coastguard Worker    data = [":uv_help"],
19*60517a1eSAndroid Build Coastguard Worker    env = {"DATA": "$(rlocationpath :uv_help)"},
20*60517a1eSAndroid Build Coastguard Worker    target_compatible_with = _TARGET_COMPATIBLE_WITH,
21*60517a1eSAndroid Build Coastguard Worker    deps = ["//python/runfiles"],
22*60517a1eSAndroid Build Coastguard Worker)
23