Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Introduce an experimental uv toolchain #1989

Merged
merged 74 commits into from
Jul 12, 2024
Merged
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
4a816ca
Spike uv
groodt Jun 18, 2024
6d0bdeb
Spike uv
groodt Jun 18, 2024
c5c3f88
Adds Windows
groodt Jun 18, 2024
f038ce8
buildifier
groodt Jun 18, 2024
8086333
buildifier
groodt Jun 18, 2024
2591363
chore: add uv to rules_python bzlmod
aignas May 6, 2024
2797a46
adapt the uv directly from http_archive
aignas Jun 19, 2024
308fe32
bump uv version
aignas Jun 19, 2024
04e5e6c
move the usage of the uv extension around
aignas Jun 19, 2024
0fcdf65
fixup the buildozer fixup command
aignas Jun 19, 2024
6d1743f
Merge branch 'main' into groodt-uv-hacks
groodt Jun 20, 2024
aea2ef9
Merge branch 'groodt-uv-hacks' of github.com:bazelbuild/rules_python …
groodt Jun 20, 2024
9b1f5fd
Hacky toolchain. Needs py interpreter.
groodt Jun 22, 2024
abbcc97
Hacky toolchain. Needs py interpreter.
groodt Jun 22, 2024
4a01495
Kinda works
groodt Jun 22, 2024
850f254
Merge branch 'main' into groodt-uv-hacks
groodt Jun 23, 2024
c6bddea
.
groodt Jun 23, 2024
750d8da
Init toolchain
groodt Jun 23, 2024
3a1f889
Init toolchain
groodt Jun 23, 2024
37859b8
Init toolchain
groodt Jun 23, 2024
0ff0003
Init toolchain
groodt Jun 23, 2024
fb73a9f
Init toolchain
groodt Jun 23, 2024
aefd672
Init toolchain
groodt Jun 23, 2024
8002c0e
Working toolchain
groodt Jun 24, 2024
1c8bf77
Working toolchain
groodt Jun 24, 2024
4356066
Working executable rule
groodt Jun 26, 2024
26a87f2
Working executable rule
groodt Jun 26, 2024
eea3f34
Working executable rule
groodt Jun 26, 2024
2cede41
Fix copyright date
rickeylev Jun 28, 2024
76b381a
address some nit/style type of comments
rickeylev Jun 28, 2024
c4b01c7
Merge branch 'main' into groodt-uv-hacks
groodt Jun 28, 2024
6041414
.
groodt Jun 28, 2024
ba09edc
Address review comments
groodt Jun 29, 2024
ec0f6fa
Address review comments
groodt Jun 29, 2024
4cb451a
Address review comments
groodt Jun 29, 2024
07c1ff6
Address review comments
groodt Jun 29, 2024
a60a308
Address review comments
groodt Jun 29, 2024
ec0f9f4
Address review comments
groodt Jun 29, 2024
014afbb
Address review comments
groodt Jun 29, 2024
e8fbfa1
Address review comments
groodt Jun 29, 2024
23628ea
Address review comments
groodt Jun 29, 2024
c2d7694
Address review comments
groodt Jun 29, 2024
fd9eebf
Address review comments
groodt Jun 29, 2024
a59ab24
Address review comments
groodt Jun 29, 2024
431c79f
Address review comments
groodt Jun 29, 2024
e67fdc8
Address review comments
groodt Jun 29, 2024
d141195
Address review comments
groodt Jun 29, 2024
3a0441b
Address review comments
groodt Jun 29, 2024
40ccfb0
Address review comments
groodt Jun 29, 2024
7750195
Address review comments
groodt Jun 29, 2024
8342931
Address review comments
groodt Jun 30, 2024
d98ba65
Address review comments
groodt Jun 30, 2024
dc0df0b
Address review comments
groodt Jun 30, 2024
4c8c490
Address review comments
groodt Jun 30, 2024
ae45048
Address review comments
groodt Jun 30, 2024
0b0d49c
Address review comments
groodt Jun 30, 2024
93e81c6
Address review comments
groodt Jun 30, 2024
5ecc345
Address review comments
groodt Jun 30, 2024
5733118
Address review comments
groodt Jun 30, 2024
ec10150
Address review comments
groodt Jul 1, 2024
6adac07
Merge branch 'main' into groodt-uv-hacks
groodt Jul 9, 2024
8e3cbe9
Bump to uv 0.2.23
groodt Jul 9, 2024
7dd729c
Address review comments
groodt Jul 9, 2024
bb2996c
Address review comments
groodt Jul 9, 2024
c31f6f9
Address review comments
groodt Jul 9, 2024
6f22655
Add EXPERIMENTAL comments and visibility restrictions
groodt Jul 9, 2024
22ad69f
Add EXPERIMENTAL comments and visibility restrictions
groodt Jul 9, 2024
f4c8790
Address review comments
groodt Jul 9, 2024
02c537d
Address review comments
groodt Jul 9, 2024
dfa24fe
Address review comments
groodt Jul 9, 2024
5c11f75
Address review comments
groodt Jul 9, 2024
93829ca
Address review comments
groodt Jul 10, 2024
a0f3d5c
Address review comments
groodt Jul 10, 2024
7fb7af1
Address review comments
groodt Jul 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review comments
groodt committed Jul 9, 2024
commit f4c8790c79cef58193811df48bfd63d872b1e8bc
2 changes: 1 addition & 1 deletion python/uv/private/providers.bzl
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
UvToolchainInfo = provider(
doc = "Information about how to invoke the uv executable.",
fields = {
"uv_target": """
"uv": """
:type: Target

The uv binary `Target`
2 changes: 1 addition & 1 deletion python/uv/private/uv_pip_compile.bzl
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ script_template = """\

def _uv_pip_compile(ctx):
info = ctx.toolchains[UV_TOOLCHAIN_TYPE].uv_toolchain_info
uv = info.uv_target.files.to_list()[0]
uv = info.uv.files.to_list()[0]

python = ctx.toolchains[TARGET_TOOLCHAIN_TYPE].py3_runtime.interpreter
dependencies_file = ctx.file.dependencies_file
10 changes: 5 additions & 5 deletions python/uv/toolchain.bzl
Original file line number Diff line number Diff line change
@@ -21,15 +21,15 @@ This module implements the uv toolchain rule
load("//python/uv/private:providers.bzl", "UvToolchainInfo")

def _uv_toolchain_impl(ctx):
uv_target = ctx.attr.uv
uv_path = uv_target.files.to_list()[0].path
uv = ctx.attr.uv
uv_path = uv.files.to_list()[0].path

default_info = DefaultInfo(
files = uv_target.files,
runfiles = ctx.runfiles(files = uv_target.files.to_list()),
files = uv.files,
runfiles = ctx.attr.uv[DefaultInfo].default_runfiles,
)
uv_toolchain_info = UvToolchainInfo(
uv_target = uv_target,
uv = uv,
version = ctx.attr.version,
)
template_variable_info = platform_common.TemplateVariableInfo({