-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
/
Copy pathuv.rb
48 lines (40 loc) · 2.1 KB
/
uv.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
class Uv < Formula
desc "Extremely fast Python package installer and resolver, written in Rust"
homepage "https://github.com/astral-sh/uv"
url "https://github.com/astral-sh/uv/archive/refs/tags/0.4.11.tar.gz"
sha256 "6640242d2628273441f0b0d4770d346696867a6fa1b8beced27310c41c9c044e"
license any_of: ["Apache-2.0", "MIT"]
head "https://github.com/astral-sh/uv.git", branch: "main"
bottle do
sha256 cellar: :any_skip_relocation, arm64_sequoia: "059a1cedbfac58280a88360f326fa8f512f1faba0ec3bd2151216c8b7cf4eb3a"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "e704db3c132ff02388ef55e4ed9bb277528ce9071495e4955037126ad8db770c"
sha256 cellar: :any_skip_relocation, arm64_ventura: "960fd66c8ec693e78a4b55f288e2d9905e40887ca1505f01432759a0cec8540b"
sha256 cellar: :any_skip_relocation, sonoma: "0c62d2ae6d54ece4836c00fcac725501b4b5c0cac571e3a318ab513c3e9061fa"
sha256 cellar: :any_skip_relocation, ventura: "2551e2f31206bf9f213516ecbb43103d47546fdb33bcf19bbfcf3f2760510cea"
sha256 cellar: :any_skip_relocation, x86_64_linux: "6a9be7f764a493ff04c03f0d754d019f1cf3ad01c3b9986b59f2c8a9df072bd2"
end
depends_on "pkg-config" => :build
depends_on "rust" => :build
uses_from_macos "python" => :test
uses_from_macos "xz"
on_linux do
# On macOS, bzip2-sys will use the bundled lib as it cannot find the system or brew lib.
# We only ship bzip2.pc on Linux which bzip2-sys needs to find library.
depends_on "bzip2"
end
def install
ENV["UV_COMMIT_HASH"] = ENV["UV_COMMIT_SHORT_HASH"] = tap.user
ENV["UV_COMMIT_DATE"] = time.strftime("%F")
system "cargo", "install", "--no-default-features", *std_cargo_args(path: "crates/uv")
generate_completions_from_executable(bin/"uv", "generate-shell-completion")
end
test do
(testpath/"requirements.in").write <<~EOS
requests
EOS
compiled = shell_output("#{bin}/uv pip compile -q requirements.in")
assert_match "This file was autogenerated by uv", compiled
assert_match "# via requests", compiled
assert_match "ruff 0.5.1", shell_output("#{bin}/uvx -q ruff@0.5.1 --version")
end
end