forked from aspect-build/rules_py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
66 lines (57 loc) · 1.83 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
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary")
load("@pypi//:requirements.bzl", "all_whl_requirements")
load("@rules_python_gazelle_plugin//:def.bzl", "GAZELLE_PYTHON_RUNTIME_DEPS")
load("@rules_python_gazelle_plugin//manifest:defs.bzl", "gazelle_python_manifest")
load("@rules_python_gazelle_plugin//modules_mapping:def.bzl", "modules_mapping")
load("@rules_python//python:defs.bzl", "py_runtime", "py_runtime_pair")
load("@rules_python//python/pip_install:requirements.bzl", "compile_pip_requirements")
# gazelle:exclude internal_python_deps.bzl
# gazelle:exclude internal_deps.bzl
# gazelle:exclude py/tests/
# gazelle:exclude examples/django
gazelle_python_manifest(
name = "gazelle_python_manifest",
modules_mapping = ":modules_map",
pip_repository_name = "pypi",
requirements = "requirements.txt",
)
gazelle_binary(
name = "gazelle_bin",
languages = [
"@bazel_skylib_gazelle_plugin//bzl",
"@rules_python_gazelle_plugin//python",
],
)
gazelle(
name = "gazelle",
data = GAZELLE_PYTHON_RUNTIME_DEPS,
gazelle = ":gazelle_bin",
)
compile_pip_requirements(
name = "requirements",
extra_args = ["--allow-unsafe"],
requirements_in = "requirements.in",
requirements_txt = "requirements.txt",
)
modules_mapping(
name = "modules_map",
wheels = all_whl_requirements,
)
py_runtime(
name = "container_py3_runtime",
interpreter_path = "/usr/bin/python",
python_version = "PY3",
)
py_runtime_pair(
name = "container_py_runtime_pair",
py2_runtime = None,
py3_runtime = ":container_py3_runtime",
)
toolchain(
name = "container_py_toolchain",
exec_compatible_with = [
"@io_bazel_rules_docker//platforms:run_in_container",
],
toolchain = ":container_py_runtime_pair",
toolchain_type = "@bazel_tools//tools/python:toolchain_type",
)