From ff226a9a2b08a1d2d368cb4b7cade71ad4e8659c Mon Sep 17 00:00:00 2001 From: Krish Suchak Date: Mon, 16 Feb 2026 22:33:48 -0500 Subject: [PATCH 1/4] fix version for homebrew --- .github/templates/formula.rb.template | 3 +++ .github/workflows/release.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/.github/templates/formula.rb.template b/.github/templates/formula.rb.template index 6418489..4f67075 100644 --- a/.github/templates/formula.rb.template +++ b/.github/templates/formula.rb.template @@ -20,6 +20,9 @@ class {{CLASS_NAME}} < Formula python3 = "python3.13" system python3, "-m", "venv", libexec + # Set version for setuptools_scm (GitHub tarballs lack .git metadata) + ENV["SETUPTOOLS_SCM_PRETEND_VERSION"] = "{{VERSION}}" + # Install the package and all dependencies system libexec/"bin/pip", "install", "--upgrade", "pip" system libexec/"bin/pip", "install", buildpath.to_s diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e8222c..18b6c48 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -324,6 +324,7 @@ jobs: NAME="${{ github.event.repository.name }}" TAG="${{ needs.version.outputs.tag_name }}" REPO="${{ github.repository }}" + VERSION="${{ needs.version.outputs.pypi_version }}" # Get description from pyproject.toml DESCRIPTION=$(grep '^description' pyproject.toml | sed 's/description = "\(.*\)"/\1/') @@ -357,6 +358,7 @@ jobs: -e "s|{{DESCRIPTION}}|${DESCRIPTION}|g" \ -e "s|{{HOMEPAGE}}|https://github.com/${REPO}|g" \ -e "s|{{SOURCE_LINE}}|${SOURCE_LINE}|g" \ + -e "s|{{VERSION}}|${VERSION}|g" \ ../.github/templates/formula.rb.template > "${NAME}.rb" echo "Generated formula:" From 9ff451c9e34f931755c5b93b91d4c96b7c1bad13 Mon Sep 17 00:00:00 2001 From: Krish Suchak Date: Mon, 16 Feb 2026 22:33:59 -0500 Subject: [PATCH 2/4] #patch From 1646958e0fe3e752a28eb1134b92513fdd66e9af Mon Sep 17 00:00:00 2001 From: Krish Suchak Date: Fri, 20 Feb 2026 03:03:49 -0500 Subject: [PATCH 3/4] update template --- .github/templates/formula.rb.template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/templates/formula.rb.template b/.github/templates/formula.rb.template index 4f67075..e5df6b3 100644 --- a/.github/templates/formula.rb.template +++ b/.github/templates/formula.rb.template @@ -20,11 +20,11 @@ class {{CLASS_NAME}} < Formula python3 = "python3.13" system python3, "-m", "venv", libexec - # Set version for setuptools_scm (GitHub tarballs lack .git metadata) - ENV["SETUPTOOLS_SCM_PRETEND_VERSION"] = "{{VERSION}}" - # Install the package and all dependencies system libexec/"bin/pip", "install", "--upgrade", "pip" + # 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 # Create wrapper scripts in bin that use the venv From 3a18994794e0c78dc788b332d9e8247757269c5f Mon Sep 17 00:00:00 2001 From: Krish Suchak Date: Fri, 20 Feb 2026 03:06:28 -0500 Subject: [PATCH 4/4] restore workflow --- .github/workflows/release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 18b6c48..4e8222c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -324,7 +324,6 @@ jobs: NAME="${{ github.event.repository.name }}" TAG="${{ needs.version.outputs.tag_name }}" REPO="${{ github.repository }}" - VERSION="${{ needs.version.outputs.pypi_version }}" # Get description from pyproject.toml DESCRIPTION=$(grep '^description' pyproject.toml | sed 's/description = "\(.*\)"/\1/') @@ -358,7 +357,6 @@ jobs: -e "s|{{DESCRIPTION}}|${DESCRIPTION}|g" \ -e "s|{{HOMEPAGE}}|https://github.com/${REPO}|g" \ -e "s|{{SOURCE_LINE}}|${SOURCE_LINE}|g" \ - -e "s|{{VERSION}}|${VERSION}|g" \ ../.github/templates/formula.rb.template > "${NAME}.rb" echo "Generated formula:"