From cdb38401541e6591d5384eb35013db56f79f9e37 Mon Sep 17 00:00:00 2001 From: Krish Suchak Date: Sat, 21 Feb 2026 05:00:44 -0500 Subject: [PATCH 1/3] uv --- .github/templates/formula.rb.template | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/templates/formula.rb.template b/.github/templates/formula.rb.template index 44383c3..5e89655 100644 --- a/.github/templates/formula.rb.template +++ b/.github/templates/formula.rb.template @@ -14,19 +14,17 @@ class {{CLASS_NAME}} < Formula license "MIT" depends_on "python@3.13" + depends_on "uv" => :build def install - # Create venv with pip included (not --without-pip) - python3 = "python3.13" - system python3, "-m", "venv", libexec - - # Install the package and all dependencies - system libexec/"bin/pip", "install", "--upgrade", "pip", "setuptools", "wheel" + # Point uv's venv at Homebrew's libexec directory + ENV["UV_PROJECT_ENVIRONMENT"] = libexec.to_s # Set version for setuptools-scm since archive tarballs lack .git metadata # Skip for HEAD builds — they use git clone, so setuptools-scm reads tags directly ENV["SETUPTOOLS_SCM_PRETEND_VERSION"] = version.to_s unless build.head? - system libexec/"bin/pip", "install", buildpath.to_s - + # Install project + locked dependencies from uv.lock (no resolver runs) + system "uv", "sync", "--frozen", "--no-dev", "--python", "python3.13" + # Create wrapper scripts in bin that use the venv bin.install_symlink Dir[libexec/"bin/{{NAME}}"] end From bc34bb422bcca013abcd6898213de279ee4e42b0 Mon Sep 17 00:00:00 2001 From: Krish Suchak Date: Sat, 21 Feb 2026 05:00:44 -0500 Subject: [PATCH 2/3] #patch From 5de01a69f66335f7df52d37c7a846de17b4587af Mon Sep 17 00:00:00 2001 From: Krish Suchak Date: Sat, 21 Feb 2026 05:09:29 -0500 Subject: [PATCH 3/3] gemini --- .github/templates/formula.rb.template | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/templates/formula.rb.template b/.github/templates/formula.rb.template index 5e89655..6474711 100644 --- a/.github/templates/formula.rb.template +++ b/.github/templates/formula.rb.template @@ -17,13 +17,14 @@ class {{CLASS_NAME}} < Formula depends_on "uv" => :build def install - # Point uv's venv at Homebrew's libexec directory + # Point uv's venv at Homebrew's libexec directory and use a local cache ENV["UV_PROJECT_ENVIRONMENT"] = libexec.to_s + ENV["UV_CACHE_DIR"] = (buildpath/".uv_cache").to_s # Set version for setuptools-scm since archive tarballs lack .git metadata # Skip for HEAD builds — they use git clone, so setuptools-scm reads tags directly ENV["SETUPTOOLS_SCM_PRETEND_VERSION"] = version.to_s unless build.head? # Install project + locked dependencies from uv.lock (no resolver runs) - system "uv", "sync", "--frozen", "--no-dev", "--python", "python3.13" + system "uv", "sync", "--frozen", "--no-dev", "--no-editable", "--python", "python3.13" # Create wrapper scripts in bin that use the venv bin.install_symlink Dir[libexec/"bin/{{NAME}}"]