Skip to content

Commit e46d8eb

Browse files
committed
more cleanup
1 parent 069a04c commit e46d8eb

File tree

5 files changed

+215
-117
lines changed

5 files changed

+215
-117
lines changed

MODULE.bazel

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -181,75 +181,76 @@ uv = use_extension("//python/uv:uv.bzl", "uv")
181181
# Here is how we can define platforms for the `uv` binaries - this will affect
182182
# all of the downstream callers because we are using the extension without
183183
# `dev_dependency = True`.
184-
uv.platform(
185-
name = "aarch64-apple-darwin",
184+
uv.default(
185+
base_url = "https://github.com/astral-sh/uv/releases/download",
186+
manifest_filename = "dist-manifest.json",
187+
version = "0.6.2",
188+
)
189+
uv.default(
186190
compatible_with = [
187191
"@platforms//os:macos",
188192
"@platforms//cpu:aarch64",
189193
],
194+
platform = "aarch64-apple-darwin",
190195
)
191-
uv.platform(
192-
name = "aarch64-unknown-linux-gnu",
196+
uv.default(
193197
compatible_with = [
194198
"@platforms//os:linux",
195199
"@platforms//cpu:aarch64",
196200
],
201+
platform = "aarch64-unknown-linux-gnu",
197202
)
198-
uv.platform(
199-
name = "powerpc64-unknown-linux-gnu",
203+
uv.default(
200204
compatible_with = [
201205
"@platforms//os:linux",
202206
"@platforms//cpu:ppc",
203207
],
208+
platform = "powerpc64-unknown-linux-gnu",
204209
)
205-
uv.platform(
206-
name = "powerpc64le-unknown-linux-gnu",
210+
uv.default(
207211
compatible_with = [
208212
"@platforms//os:linux",
209213
"@platforms//cpu:ppc64le",
210214
],
215+
platform = "powerpc64le-unknown-linux-gnu",
211216
)
212-
uv.platform(
213-
name = "s390x-unknown-linux-gnu",
217+
uv.default(
214218
compatible_with = [
215219
"@platforms//os:linux",
216220
"@platforms//cpu:s390x",
217221
],
222+
platform = "s390x-unknown-linux-gnu",
218223
)
219-
uv.platform(
220-
name = "x86_64-apple-darwin",
224+
uv.default(
221225
compatible_with = [
222226
"@platforms//os:macos",
223227
"@platforms//cpu:x86_64",
224228
],
229+
platform = "x86_64-apple-darwin",
225230
)
226-
uv.platform(
227-
name = "x86_64-pc-windows-msvc",
231+
uv.default(
228232
compatible_with = [
229233
"@platforms//os:windows",
230234
"@platforms//cpu:x86_64",
231235
],
236+
platform = "x86_64-pc-windows-msvc",
232237
)
233-
uv.platform(
234-
name = "x86_64-unknown-linux-gnu",
238+
uv.default(
235239
compatible_with = [
236240
"@platforms//os:linux",
237241
"@platforms//cpu:x86_64",
238242
],
243+
platform = "x86_64-unknown-linux-gnu",
239244
)
245+
use_repo(uv, "uv")
246+
247+
register_toolchains("@uv//:all")
240248

241249
uv_dev = use_extension(
242250
"//python/uv:uv.bzl",
243251
"uv",
244252
dev_dependency = True,
245253
)
246-
uv_dev.toolchain(
247-
name = "uv_toolchains",
248-
version = "0.5.24",
249-
)
250-
use_repo(uv_dev, "uv_toolchains")
251-
252-
register_toolchains(
253-
"@uv_toolchains//:all",
254-
dev_dependency = True,
254+
uv_dev.append_config(
255+
version = "0.6.2",
255256
)

examples/bzlmod/MODULE.bazel

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,22 +101,20 @@ python.single_version_platform_override(
101101
# rules based on the `python_version` arg values.
102102
use_repo(python, "python_3_10", "python_3_9", "python_versions", "pythons_hub")
103103

104-
# EXPERIMENTAL: This is experimental and may be removed without notice
104+
# EXPERIMENTAL: This is experimental and may be changed or removed without notice
105105
uv = use_extension(
106106
"@rules_python//python/uv:uv.bzl",
107107
"uv",
108108
dev_dependency = True,
109109
)
110-
uv.toolchain(
111-
name = "uv_toolchains",
112-
version = "0.5.24",
113-
)
114-
use_repo(uv, "uv_toolchains")
115-
116-
register_toolchains(
117-
"@uv_toolchains//:all",
118-
dev_dependency = True,
119-
)
110+
uv.append_config(version = "0.6.2")
111+
# You can also set the defaults for the base_url
112+
# uv.append_config(base_url = "my_mirror")
113+
# uv.append_config(
114+
# platform = "extra-platform",
115+
# target_settings = ["//my_config_setting_label"],
116+
# compatible_with = ["@platforms//os:exotic"],
117+
# )
120118

121119
# This extension allows a user to create modifications to how rules_python
122120
# creates different wheel repositories. Different attributes allow the user

0 commit comments

Comments
 (0)