You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is using the `dist-manifest.json` on the GH releases page so that
we can get the expected `sha256` value of each available file and
download all of the usable archives. This means that `rules_python` no
longer needs to be updated for `uv` version bumps.
The remaining bits for closing the ticket:
- [ ] Finalize the `lock` interface.
- [ ] Add it to the `pip.parse` hub repo if `pyproject.toml` is passed
in.
- [ ] Add a rule/target for `venv` creation.
Work towards #1975.
doc="Configure where the binaries are going to be downloaded from.",
54
+
attrs= {
55
+
"base_url": attr.string(
56
+
doc="Base URL to download metadata about the binaries and the binaries themselves.",
57
+
default=_DEFAULT_BASE_URL,
58
+
),
59
+
},
60
+
)
61
+
62
+
platform=tag_class(
63
+
doc="Configure the available platforms for lock file generation.",
64
+
attrs= {
65
+
"compatible_with": attr.label_list(
66
+
doc="The compatible with constraint values for toolchain resolution",
67
+
),
68
+
"flag_values": attr.label_keyed_string_dict(
69
+
doc="The flag values for toolchain resolution",
70
+
),
71
+
"name": attr.string(
72
+
doc="The platform string used in the UV repository to denote the platform triple.",
73
+
mandatory=True,
74
+
),
75
+
},
76
+
)
77
+
27
78
uv_toolchain=tag_class(
28
79
doc="Configure uv toolchain for lock file generation.",
29
80
attrs= {
30
-
"uv_version": attr.string(doc="Explicit version of uv.", mandatory=True),
81
+
"name": attr.string(
82
+
doc="The name of the toolchain repo",
83
+
default="uv_toolchains",
84
+
),
85
+
"version": attr.string(
86
+
doc="Explicit version of uv.",
87
+
mandatory=True,
88
+
),
31
89
},
32
90
)
33
91
34
92
def_uv_toolchain_extension(module_ctx):
93
+
config= {
94
+
"platforms": {},
95
+
}
96
+
35
97
formodinmodule_ctx.modules:
98
+
ifnotmod.is_rootandnotmod.name=="rules_python":
99
+
# Only rules_python and the root module can configure this.
100
+
#
101
+
# Ignore any attempts to configure the `uv` toolchain elsewhere
102
+
#
103
+
# Only the root module may configure the uv toolchain.
104
+
# This prevents conflicting registrations with any other modules.
105
+
#
106
+
# NOTE: We may wish to enforce a policy where toolchain configuration is only allowed in the root module, or in rules_python. See https://github.com/bazelbuild/bazel/discussions/22024
107
+
continue
108
+
109
+
# Note, that the first registration will always win, givin priority to
"Only the root module may configure the uv toolchain.",
40
-
"This prevents conflicting registrations with any other modules.",
41
-
"NOTE: We may wish to enforce a policy where toolchain configuration is only allowed in the root module, or in rules_python. See https://github.com/bazelbuild/bazel/discussions/22024",
0 commit comments