forked from aspect-build/rules_py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMODULE.bazel
More file actions
232 lines (202 loc) · 7.56 KB
/
Copy pathMODULE.bazel
File metadata and controls
232 lines (202 loc) · 7.56 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
"aspect-build/rules_py"
module(
name = "aspect_rules_py",
compatibility_level = 1,
)
# NOTE: when publishing to BCR, we patch this to True, as we publish pre-built binaries along with our releases.
IS_RELEASE = False
bazel_dep(name = "bazel_features", version = "1.38.0")
bazel_dep(name = "bazel_lib", version = "3.0.0")
bazel_dep(name = "bazel_skylib", version = "1.4.2")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_python", version = "1.0.0")
bazel_dep(name = "with_cfg.bzl", version = "0.14.1")
bazel_dep(name = "rules_cc", version = "0.2.16")
bazel_dep(name = "rules_pkg", version = "1.1.0")
bazel_dep(name = "tar.bzl", version = "0.5.5")
bazel_lib_toolchains = use_extension("@tar.bzl//tar:extensions.bzl", "toolchains")
use_repo(bazel_lib_toolchains, "bsd_tar_toolchains")
tools = use_extension("//py:extensions.bzl", "py_tools")
tools.rules_py_tools()
use_repo(tools, "rules_py_tools")
use_repo(tools, "rules_py_pex_2_3_1")
register_toolchains(
"@rules_py_tools//:all",
"@aspect_rules_py//py/private/toolchain/...",
)
toml = use_extension("//uv/private/tomltool:extension.bzl", "tomltool")
use_repo(
toml,
"toml2json_aarch64_linux_gnu",
"toml2json_aarch64_osx_libsystem",
"toml2json_x86_64_linux_gnu",
"toml2json_x86_64_osx_libsystem",
)
host = use_extension("//uv/private/host:extension.bzl", "host_platform")
use_repo(host, "aspect_rules_py_uv_host")
bazel_dep(name = "aspect_tools_telemetry", version = "0.3.3")
tel = use_extension("@aspect_tools_telemetry//:extension.bzl", "telemetry")
use_repo(tel, "aspect_tools_telemetry_report")
################################################################################
# Dev deps are the remainder of the file
# LLVM configuration
bazel_dep(name = "toolchains_llvm_bootstrapped", version = "0.2.5", dev_dependency = IS_RELEASE)
archive_override(
module_name = "toolchains_llvm_bootstrapped",
integrity = "sha256-+nddimV34BYO8YExiKLYG2kMoA2Sv+5ZoMRPQLJxNfE=",
patch_strip = 1,
patches = [
"//bazel/patches:llvm_darwin_sysroot.patch",
],
strip_prefix = "toolchains_llvm_bootstrapped-121c8419394e76b5652c161369743c564799b2e3",
urls = ["https://github.com/cerisier/toolchains_llvm_bootstrapped/archive/121c8419394e76b5652c161369743c564799b2e3/master.tar.gz"],
)
register_toolchains(
"@toolchains_llvm_bootstrapped//toolchain:all",
dev_dependency = IS_RELEASE,
)
# Rust configuration
bazel_dep(name = "rules_rust", version = "0.68.1", dev_dependency = IS_RELEASE)
rust = use_extension(
"@rules_rust//rust:extensions.bzl",
"rust",
dev_dependency = IS_RELEASE,
)
rust.toolchain(
edition = "2024",
extra_target_triples = [
"aarch64-apple-darwin",
"x86_64-apple-darwin",
"aarch64-unknown-linux-musl",
"x86_64-unknown-linux-musl",
],
versions = ["1.88.0"],
)
use_repo(rust, "rust_toolchains")
register_toolchains(
"@rust_toolchains//:all",
dev_dependency = IS_RELEASE,
)
bazel_dep(name = "bazelrc-preset.bzl", version = "1.4.0", dev_dependency = IS_RELEASE)
bazel_dep(name = "bazel_env.bzl", version = "0.5.0", dev_dependency = IS_RELEASE)
bazel_dep(name = "bzip2", version = "1.0.8.bcr.3", dev_dependency = IS_RELEASE)
bazel_dep(name = "gazelle", version = "0.45.0", dev_dependency = IS_RELEASE)
bazel_dep(name = "rules_rs", version = "0.0.26", dev_dependency = IS_RELEASE)
bazel_dep(name = "xz", version = "5.4.5.bcr.7", dev_dependency = IS_RELEASE)
bazel_dep(name = "zstd", version = "1.5.7", dev_dependency = IS_RELEASE)
bazel_dep(name = "rules_multitool", version = "1.9.0", dev_dependency = IS_RELEASE)
multitool = use_extension("@rules_multitool//multitool:extension.bzl", "multitool", dev_dependency = IS_RELEASE)
multitool.hub(lockfile = "//tools:tools.lock.json")
use_repo(multitool, "multitool")
crate = use_extension(
"@rules_rs//rs:extensions.bzl",
"crate",
dev_dependency = IS_RELEASE,
)
crate.from_cargo(
name = "crates",
cargo_lock = "//:Cargo.lock",
cargo_toml = "//:Cargo.toml",
platform_triples = [
"aarch64-apple-darwin",
"aarch64-unknown-linux-musl",
"x86_64-apple-darwin",
"x86_64-unknown-linux-musl",
],
)
crate.annotation(
crate = "backtrace",
# This just compiles code on Android, we don't need it.
gen_build_script = "off",
repositories = ["crates"],
)
crate.annotation(
crate = "zstd-sys",
# This build script is naughty and tries to depend on system zstd or build it from source.
gen_build_script = "off",
repositories = ["crates"],
deps = ["@@zstd+//:zstd"],
)
crate.annotation(
crate = "bzip2-sys",
gen_build_script = "off",
repositories = ["crates"],
deps = ["@@bzip2+//:bz2"],
)
crate.annotation(
crate = "lzma-sys",
gen_build_script = "off",
repositories = ["crates"],
deps = ["@@xz+//:lzma"],
)
use_repo(crate, "crates")
# TODO: Replace with bazel_features?
# cf. https://github.com/bazel-contrib/bazelrc-preset.bzl/blob/main/MODULE.bazel#L8C1-L10C70
bazel_dep(name = "rules_shell", version = "0.6.1", dev_dependency = IS_RELEASE)
version = use_extension("@bazel_features//private:extensions.bzl", "version_extension", dev_dependency = IS_RELEASE)
use_repo(version, "bazel_features_globals", "bazel_features_version")
# rules_oci and friends
# rules_python and friends
bazel_dep(name = "rules_python_gazelle_plugin", version = "1.0.0", dev_dependency = IS_RELEASE)
python = use_extension("@rules_python//python/extensions:python.bzl", "python", dev_dependency = IS_RELEASE)
python.toolchain(
is_default = True,
python_version = "3.9",
)
python.toolchain(
is_default = False,
python_version = "3.12",
)
# We still use pip for testing the virtual deps machinery
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_dependency = IS_RELEASE)
pip.parse(
hub_name = "django",
python_version = "3.9",
requirements_lock = "//py/tests/virtual/django:requirements.txt",
)
use_repo(pip, "django")
# For everything else, we use our own uv machinery
uv = use_extension("//uv/unstable:extension.bzl", "uv", dev_dependency = IS_RELEASE)
uv.declare_hub(
hub_name = "pypi",
)
uv.declare_venv(
hub_name = "pypi",
venv_name = "default",
)
uv.lockfile(
src = "//:uv.lock",
hub_name = "pypi",
venv_name = "default",
)
uv.unstable_annotate_requirements(
src = "//:annotations.toml",
hub_name = "pypi",
venv_name = "default",
)
use_repo(uv, "pypi")
http_file = use_repo_rule(
"@bazel_tools//tools/build_defs/repo:http.bzl",
"http_file",
)
http_file(
name = "django_4_2_4",
dev_dependency = IS_RELEASE,
downloaded_file_path = "Django-4.2.4-py3-none-any.whl",
sha256 = "860ae6a138a238fc4f22c99b52f3ead982bb4b1aad8c0122bcd8c8a3a02e409d",
urls = ["https://files.pythonhosted.org/packages/7f/9e/fc6bab255ae10bc57fa2f65646eace3d5405fbb7f5678b90140052d1db0f/Django-4.2.4-py3-none-any.whl"],
)
http_file(
name = "django_4_1_10",
dev_dependency = IS_RELEASE,
downloaded_file_path = "Django-4.1.10-py3-none-any.whl",
sha256 = "26d0260c2fb8121009e62ffc548b2398dea2522b6454208a852fb0ef264c206c",
urls = ["https://files.pythonhosted.org/packages/34/25/8a218de57fc9853297a1a8e4927688eff8107d5bc6dcf6c964c59801f036/Django-4.1.10-py3-none-any.whl"],
)
http_file(
name = "sqlparse_0_4_0",
dev_dependency = IS_RELEASE,
downloaded_file_path = "sqlparse-0.4.0-py3-none-any.whl",
sha256 = "0523026398aea9c8b5f7a4a6d5c0829c285b4fbd960c17b5967a369342e21e01",
urls = ["https://files.pythonhosted.org/packages/10/96/36c136013c4a6ecb8c6aa3eed66e6dcea838f85fd80e1446499f1dabfac7/sqlparse-0.4.0-py3-none-any.whl"],
)