forked from bazel-contrib/rules_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBUILD.bazel
More file actions
55 lines (50 loc) · 1.51 KB
/
BUILD.bazel
File metadata and controls
55 lines (50 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@rules_shell//shell:sh_test.bzl", "sh_test")
load("//:version.bzl", "BAZEL_VERSION")
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
build_test(
name = "bzl_libraries_build_test",
targets = [
# keep sorted
"//python:current_py_toolchain_bzl",
"//python:defs_bzl",
"//python:proto_bzl",
"//python:py_binary_bzl",
"//python:py_cc_link_params_info_bzl",
"//python:py_import_bzl",
"//python:py_info_bzl",
"//python:py_library_bzl",
"//python:py_runtime_bzl",
"//python:py_runtime_info_bzl",
"//python:py_runtime_pair_bzl",
"//python:py_test_bzl",
"//python/cc:py_cc_toolchain_bzl",
"//python/cc:py_cc_toolchain_info_bzl",
"//python/entry_points:py_console_script_binary_bzl",
],
)
genrule(
name = "assert_bazelversion",
srcs = ["//:.bazelversion"],
outs = ["assert_bazelversion_test.sh"],
cmd = """\
set -o errexit -o nounset -o pipefail
current=$$(cat "$(execpath //:.bazelversion)")
cat > "$@" <<EOF
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail
if [[ \"$${{current}}\" != \"{expected}\" ]]; then
>&2 echo "ERROR: current bazel version '$${{current}}' is not the expected '{expected}'"
exit 1
fi
EOF
""".format(
expected = BAZEL_VERSION,
),
executable = True,
)
sh_test(
name = "assert_bazelversion_test",
srcs = [":assert_bazelversion_test.sh"],
)