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
Copy file name to clipboardExpand all lines: python/uv/private/uv.bzl
+49-43Lines changed: 49 additions & 43 deletions
Original file line number
Diff line number
Diff line change
@@ -41,31 +41,48 @@ Since this is only for locking the requirements files, it should be always
41
41
marked as a `dev_dependency`.
42
42
"""
43
43
44
+
_DEFAULT_ATTRS= {
45
+
"base_url": attr.string(
46
+
doc="""\
47
+
Base URL to download metadata about the binaries and the binaries themselves.
48
+
""",
49
+
),
50
+
"compatible_with": attr.label_list(
51
+
doc="""\
52
+
The compatible with constraint values for toolchain resolution.
53
+
""",
54
+
),
55
+
"manifest_filename": attr.string(
56
+
doc="""\
57
+
The distribution manifest filename to use for the metadata fetching from GH. The
58
+
defaults for this are set in `rules_python` MODULE.bazel file that one can override
59
+
for a specific version.
60
+
""",
61
+
default="dist-manifest.json",
62
+
),
63
+
"platform": attr.string(
64
+
doc="""\
65
+
The platform string used in the UV repository to denote the platform triple.
66
+
""",
67
+
),
68
+
"target_settings": attr.label_list(
69
+
doc="""\
70
+
The `target_settings` to add to platform definitions that then get used in `toolchain`
71
+
definitions.
72
+
""",
73
+
),
74
+
"version": attr.string(
75
+
doc="""\
76
+
The version of uv to configure the sources for.
77
+
""",
78
+
),
79
+
}
80
+
44
81
default=tag_class(
45
82
doc="""\
46
83
Set the uv configuration defaults.
47
84
""",
48
-
attrs= {
49
-
"base_url": attr.string(
50
-
doc="Base URL to download metadata about the binaries and the binaries themselves.",
51
-
),
52
-
"compatible_with": attr.label_list(
53
-
doc="The compatible with constraint values for toolchain resolution",
54
-
),
55
-
"manifest_filename": attr.string(
56
-
doc="The manifest filename to for the metadata fetching.",
57
-
default="dist-manifest.json",
58
-
),
59
-
"platform": attr.string(
60
-
doc="The platform string used in the UV repository to denote the platform triple.",
61
-
),
62
-
"target_settings": attr.label_list(
63
-
doc="The `target_settings` to add to platform definitions.",
64
-
),
65
-
"version": attr.string(
66
-
doc="The version of uv to use.",
67
-
),
68
-
},
85
+
attrs=_DEFAULT_ATTRS,
69
86
)
70
87
71
88
configure=tag_class(
@@ -100,31 +117,20 @@ defaults for all versions, use the {attr}`default` for all of the configuration,
100
117
similarly how `rules_python` is doing it itself.
101
118
::::
102
119
""",
103
-
attrs= {
104
-
"base_url": attr.string(
105
-
doc="Base URL to download metadata about the binaries and the binaries themselves.",
106
-
),
107
-
"compatible_with": attr.label_list(
108
-
doc="The compatible with constraint values for toolchain resolution",
109
-
),
110
-
"manifest_filename": attr.string(
111
-
doc="The manifest filename to for the metadata fetching.",
112
-
default="dist-manifest.json",
113
-
),
114
-
"platform": attr.string(
115
-
doc="The platform string used in the UV repository to denote the platform triple.",
116
-
),
120
+
attrs=_DEFAULT_ATTRS| {
117
121
"sha256": attr.string(
118
-
doc="The sha256 of the downloaded artifact.",
119
-
),
120
-
"target_settings": attr.label_list(
121
-
doc="The `target_settings` to add to platform definitions.",
122
+
doc="The sha256 of the downloaded artifact if the {attr}`urls` is specified.",
122
123
),
123
124
"urls": attr.string_list(
124
-
doc="The urls to download the binary from. If this is used, {attr}`base_url` is ignored. If the `urls` are specified, they need to be specified for all of the platforms for a particular version.",
125
-
),
126
-
"version": attr.string(
127
-
doc="The version of uv to use.",
125
+
doc="""\
126
+
The urls to download the binary from. If this is used, {attr}`base_url` and
127
+
{attr}`manifest_name` are ignored for the given version.
128
+
129
+
::::note
130
+
If the `urls` are specified, they need to be specified for all of the platforms
0 commit comments