forked from googleapis/gapic-generator-python
-
Notifications
You must be signed in to change notification settings - Fork 2
/
BUILD.bazel
76 lines (67 loc) · 1.87 KB
/
BUILD.bazel
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
load("//:gapic_generator_python.bzl", "pandoc_binary", "pandoc_toolchain")
load("@gapic_generator_python_pip_deps//:requirements.bzl", "requirement")
load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair")
toolchain_type(
name = "pandoc_toolchain_type",
visibility = ["//visibility:public"],
)
pandoc_toolchain(
exec_compatible_with = [
"@bazel_tools//platforms:linux",
"@bazel_tools//platforms:x86_64",
],
platform = "linux",
)
pandoc_toolchain(
exec_compatible_with = [
"@bazel_tools//platforms:osx",
"@bazel_tools//platforms:x86_64",
],
platform = "macOS",
)
pandoc_binary(
name = "pandoc_binary",
)
config_setting(
name = "gapic_gen_python_3_6",
values = {"define": "gapic_gen_python=3.6"},
)
py_runtime(
name = "pyenv3_runtime",
interpreter = ":pyenv3wrapper.sh",
python_version = "PY3",
)
py_runtime_pair(
name = "pyenv3_runtime_pair",
py3_runtime = ":pyenv3_runtime",
)
toolchain(
name = "pyenv3_toolchain",
toolchain = ":pyenv3_runtime_pair",
toolchain_type = "@bazel_tools//tools/python:toolchain_type",
)
py_binary(
name = "gapic_plugin",
srcs = glob(["gapic/**/*.py"]),
data = [":pandoc_binary"] + glob([
"gapic/**/*.j2",
"gapic/**/.*.j2",
]),
main = "gapic/cli/generate_with_pandoc.py",
python_version = "PY3",
visibility = ["//visibility:public"],
deps = [
"@com_github_grpc_grpc//src/python/grpcio/grpc:grpcio",
requirement("protobuf"),
requirement("click"),
requirement("google-api-core"),
requirement("googleapis-common-protos"),
requirement("jinja2"),
requirement("MarkupSafe"),
requirement("pypandoc"),
requirement("PyYAML"),
] + select({
":gapic_gen_python_3_6": [requirement("dataclasses")],
"//conditions:default": [],
}),
)