• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tensorchord / envd / 13719232201

07 Mar 2025 10:57AM UTC coverage: 42.211%. First build
13719232201

Pull #1990

github

kemingy
fix ci

Signed-off-by: Keming <kemingyang@tensorchord.ai>
Pull Request #1990: feat: support uv

44 of 52 new or added lines in 6 files covered. (84.62%)

5075 of 12023 relevant lines covered (42.21%)

159.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.62
/pkg/lang/ir/v1/uv.go
1
// Copyright 2025 The envd Authors
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
//      http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15
package v1
16

17
import "github.com/moby/buildkit/client/llb"
18

19
const (
20
        uvVersion = "0.6.5"
21
)
22

23
func (g generalGraph) compileUV(root llb.State) llb.State {
2✔
24
        if g.UVConfig == nil {
2✔
NEW
25
                return root
×
NEW
26
        }
×
27
        // uv configurations
28
        g.RuntimeEnviron["UV_LINK_MODE"] = "copy"
2✔
29
        g.RuntimeEnviron["UV_PYTHON_PREFERENCE"] = "only-managed"
2✔
30

2✔
31
        base := llb.Image(builderImage)
2✔
32
        builder := base.Run(
2✔
33
                llb.Shlexf(`sh -c "wget -qO- https://github.com/astral-sh/uv/releases/download/%s/uv-$(uname -m)-unknown-linux-gnu.tar.gz | tar -xz --strip-components=1 -C /tmp || exit 1"`, uvVersion),
2✔
34
                llb.WithCustomNamef("[internal] download uv %s", uvVersion),
2✔
35
        ).Root()
2✔
36

2✔
37
        root = root.File(
2✔
38
                llb.Copy(builder, "/tmp/uv", "/usr/bin/uv"), llb.WithCustomName("[internal] install uv")).
2✔
39
                File(llb.Copy(builder, "/tmp/uvx", "/usr/bin/uvx"), llb.WithCustomName("[internal] install uvx"))
2✔
40
        return g.compileUVPython(root)
2✔
41
}
42

43
func (g generalGraph) compileUVPython(root llb.State) llb.State {
4✔
44
        if g.UVConfig == nil {
4✔
NEW
45
                return root
×
NEW
46
        }
×
47

48
        root = root.Run(
4✔
49
                llb.Shlexf(`uv python install %s`, g.UVConfig.PythonVersion),
4✔
50
                llb.WithCustomNamef("[internal] install uv Python=%s", g.UVConfig.PythonVersion),
4✔
51
        ).Root()
4✔
52
        return root
4✔
53
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc