Skip to content

uv 0.2.6 #173600

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

Merged
merged 2 commits into from
Jun 4, 2024
Merged

uv 0.2.6 #173600

Changes from 1 commit
Commits
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
29 changes: 2 additions & 27 deletions Formula/u/uv.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
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.2.5.tar.gz"
sha256 "6a46ce9fc67c088c22f52daf9709287c19e75477c1e24d60409eaa412f3cd921"
url "https://github.com/astral-sh/uv/archive/refs/tags/0.2.6.tar.gz"
sha256 "92320fd6dd4bc8903af4ffd5b412a61125bbd4a83838c75deeaffa48e48faf7a"
license any_of: ["Apache-2.0", "MIT"]
head "https://github.com/astral-sh/uv.git", branch: "main"

Expand All @@ -18,8 +18,6 @@ class Uv < Formula

depends_on "pkg-config" => :build
depends_on "rust" => :build
depends_on "libgit2"
depends_on "openssl@3"

uses_from_macos "python" => :test

Expand All @@ -30,24 +28,10 @@ class Uv < Formula
end

def install
ENV["LIBGIT2_NO_VENDOR"] = "1"

# Ensure that the `openssl` crate picks up the intended library.
ENV["OPENSSL_DIR"] = Formula["openssl@3"].opt_prefix
ENV["OPENSSL_NO_VENDOR"] = "1"

system "cargo", "install", "--no-default-features", *std_cargo_args(path: "crates/uv")
generate_completions_from_executable(bin/"uv", "generate-shell-completion")
end

def check_binary_linkage(binary, library)
binary.dynamically_linked_libraries.any? do |dll|
next false unless dll.start_with?(HOMEBREW_PREFIX.to_s)

File.realpath(dll) == File.realpath(library)
end
end

test do
(testpath/"requirements.in").write <<~EOS
requests
Expand All @@ -56,14 +40,5 @@ def check_binary_linkage(binary, library)
compiled = shell_output("#{bin}/uv pip compile -q requirements.in")
assert_match "This file was autogenerated by uv", compiled
assert_match "# via requests", compiled

[
Formula["libgit2"].opt_lib/shared_library("libgit2"),
Formula["openssl@3"].opt_lib/shared_library("libssl"),
Formula["openssl@3"].opt_lib/shared_library("libcrypto"),
].each do |library|
assert check_binary_linkage(bin/"uv", library),
"No linkage with #{library.basename}! Cargo is likely using a vendored version."
end
end
end
Loading