From 4606fad206cd0260bb1b2044c85b5e4fe1fab28f Mon Sep 17 00:00:00 2001 From: Nicholas Romero Date: Thu, 29 Jan 2026 10:52:45 -0600 Subject: [PATCH 1/6] Add script to test Homebrew formula with local build Adds scripts/test-homebrew.sh for testing the Homebrew formula against unreleased deepwork changes. The script builds an sdist tarball, creates a temporary formula pointing to it, and runs the Homebrew install/test. Co-Authored-By: Claude Opus 4.5 --- scripts/test-homebrew.sh | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 scripts/test-homebrew.sh diff --git a/scripts/test-homebrew.sh b/scripts/test-homebrew.sh new file mode 100755 index 00000000..687c6ef2 --- /dev/null +++ b/scripts/test-homebrew.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Test the Homebrew formula against a local build of deepwork +# Usage: ./scripts/test-homebrew.sh [path-to-homebrew-tap] + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_DIR="$(dirname "$SCRIPT_DIR")" +HOMEBREW_TAP="${1:-$REPO_DIR/../homebrew-deepwork}" + +if [[ ! -f "$HOMEBREW_TAP/Formula/deepwork.rb" ]]; then + echo "Error: homebrew-deepwork tap not found at $HOMEBREW_TAP" + echo "Usage: $0 [path-to-homebrew-tap]" + exit 1 +fi + +echo "==> Building deepwork from $REPO_DIR" +cd "$REPO_DIR" + +# Clean previous builds +rm -rf dist/ + +# Build the sdist tarball +python -m build --sdist + +# Find the built tarball +TARBALL=$(ls dist/deepwork-*.tar.gz | head -1) +if [[ ! -f "$TARBALL" ]]; then + echo "Error: No tarball found in dist/" + exit 1 +fi + +VERSION=$(basename "$TARBALL" | sed 's/deepwork-\(.*\)\.tar\.gz/\1/') +SHA256=$(shasum -a 256 "$TARBALL" | awk '{print $1}') +TARBALL_PATH="$(cd "$(dirname "$TARBALL")" && pwd)/$(basename "$TARBALL")" + +echo "==> Built deepwork-$VERSION" +echo " Tarball: $TARBALL_PATH" +echo " SHA256: $SHA256" + +# Create a temporary formula pointing to the local tarball +TEMP_FORMULA=$(mktemp) +trap "rm -f $TEMP_FORMULA" EXIT + +sed -e "s|url \"https://.*\"|url \"file://$TARBALL_PATH\"|" \ + -e "s|sha256 \".*\"|sha256 \"$SHA256\"|" \ + "$HOMEBREW_TAP/Formula/deepwork.rb" > "$TEMP_FORMULA" + +echo "==> Installing from local build..." +brew uninstall deepwork 2>/dev/null || true +brew install --verbose "$TEMP_FORMULA" + +echo "==> Running brew test..." +brew test deepwork + +echo "==> Verifying binary..." +deepwork --version +deepwork --help | head -5 + +echo "==> All tests passed for deepwork-$VERSION (local build)" From fbd9b93bf562731f35adfe25472e27bb054b23ac Mon Sep 17 00:00:00 2001 From: Nicholas Romero Date: Thu, 29 Jan 2026 12:43:55 -0600 Subject: [PATCH 2/6] Use python3 with fallback to python in homebrew test script Co-Authored-By: Claude Opus 4.5 --- scripts/test-homebrew.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/test-homebrew.sh b/scripts/test-homebrew.sh index 687c6ef2..690af35a 100755 --- a/scripts/test-homebrew.sh +++ b/scripts/test-homebrew.sh @@ -17,11 +17,13 @@ fi echo "==> Building deepwork from $REPO_DIR" cd "$REPO_DIR" +PYTHON=$(command -v python3 || command -v python) || { echo "Error: No python found"; exit 1; } + # Clean previous builds rm -rf dist/ # Build the sdist tarball -python -m build --sdist +$PYTHON -m build --sdist # Find the built tarball TARBALL=$(ls dist/deepwork-*.tar.gz | head -1) From 36ab9e60c9f70019c717ee85a9bf7fce9fef5db2 Mon Sep 17 00:00:00 2001 From: Nicholas Romero Date: Thu, 29 Jan 2026 12:50:00 -0600 Subject: [PATCH 3/6] Install build package before building sdist Co-Authored-By: Claude Opus 4.5 --- scripts/test-homebrew.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/test-homebrew.sh b/scripts/test-homebrew.sh index 690af35a..ef3698dd 100755 --- a/scripts/test-homebrew.sh +++ b/scripts/test-homebrew.sh @@ -19,6 +19,9 @@ cd "$REPO_DIR" PYTHON=$(command -v python3 || command -v python) || { echo "Error: No python found"; exit 1; } +# Ensure build tool is available +$PYTHON -m pip install --quiet build + # Clean previous builds rm -rf dist/ From fcaf2e7765b2b16855aca37f00e5cbfbba11f756 Mon Sep 17 00:00:00 2001 From: Nicholas Romero Date: Thu, 29 Jan 2026 12:58:51 -0600 Subject: [PATCH 4/6] Use uv build instead of python -m build Co-Authored-By: Claude Opus 4.5 --- scripts/test-homebrew.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/test-homebrew.sh b/scripts/test-homebrew.sh index ef3698dd..663f01ee 100755 --- a/scripts/test-homebrew.sh +++ b/scripts/test-homebrew.sh @@ -17,16 +17,11 @@ fi echo "==> Building deepwork from $REPO_DIR" cd "$REPO_DIR" -PYTHON=$(command -v python3 || command -v python) || { echo "Error: No python found"; exit 1; } - -# Ensure build tool is available -$PYTHON -m pip install --quiet build - # Clean previous builds rm -rf dist/ # Build the sdist tarball -$PYTHON -m build --sdist +uv build --sdist # Find the built tarball TARBALL=$(ls dist/deepwork-*.tar.gz | head -1) From 6fb77da5db37bb76cca66465de6d2c3e03b73b16 Mon Sep 17 00:00:00 2001 From: Nicholas Romero Date: Thu, 29 Jan 2026 13:03:10 -0600 Subject: [PATCH 5/6] Fix temp formula needing .rb extension for Homebrew Co-Authored-By: Claude Opus 4.5 --- scripts/test-homebrew.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/test-homebrew.sh b/scripts/test-homebrew.sh index 663f01ee..3e919be3 100755 --- a/scripts/test-homebrew.sh +++ b/scripts/test-homebrew.sh @@ -39,8 +39,9 @@ echo " Tarball: $TARBALL_PATH" echo " SHA256: $SHA256" # Create a temporary formula pointing to the local tarball -TEMP_FORMULA=$(mktemp) -trap "rm -f $TEMP_FORMULA" EXIT +TEMP_DIR=$(mktemp -d) +TEMP_FORMULA="$TEMP_DIR/deepwork.rb" +trap "rm -rf $TEMP_DIR" EXIT sed -e "s|url \"https://.*\"|url \"file://$TARBALL_PATH\"|" \ -e "s|sha256 \".*\"|sha256 \"$SHA256\"|" \ @@ -48,7 +49,7 @@ sed -e "s|url \"https://.*\"|url \"file://$TARBALL_PATH\"|" \ echo "==> Installing from local build..." brew uninstall deepwork 2>/dev/null || true -brew install --verbose "$TEMP_FORMULA" +brew install --formula --verbose "$TEMP_FORMULA" echo "==> Running brew test..." brew test deepwork From 56da442276abef2ac52d6651af36b95a3b30f1f2 Mon Sep 17 00:00:00 2001 From: Nicholas Romero Date: Thu, 29 Jan 2026 13:42:18 -0600 Subject: [PATCH 6/6] Use local Homebrew tap instead of temp formula file Homebrew requires formulas to live in a tap. Create a local/deepwork-test tap and copy the modified formula there before installing. Co-Authored-By: Claude Opus 4.5 --- scripts/test-homebrew.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/test-homebrew.sh b/scripts/test-homebrew.sh index 3e919be3..72049fa9 100755 --- a/scripts/test-homebrew.sh +++ b/scripts/test-homebrew.sh @@ -38,21 +38,24 @@ echo "==> Built deepwork-$VERSION" echo " Tarball: $TARBALL_PATH" echo " SHA256: $SHA256" -# Create a temporary formula pointing to the local tarball -TEMP_DIR=$(mktemp -d) -TEMP_FORMULA="$TEMP_DIR/deepwork.rb" -trap "rm -rf $TEMP_DIR" EXIT +# Set up a local tap with the modified formula +TAP_NAME="local/deepwork-test" +TAP_DIR="$(brew --repository)/Library/Taps/local/homebrew-deepwork-test" + +echo "==> Setting up local tap..." +brew untap "$TAP_NAME" 2>/dev/null || true +brew tap-new --no-git "$TAP_NAME" sed -e "s|url \"https://.*\"|url \"file://$TARBALL_PATH\"|" \ -e "s|sha256 \".*\"|sha256 \"$SHA256\"|" \ - "$HOMEBREW_TAP/Formula/deepwork.rb" > "$TEMP_FORMULA" + "$HOMEBREW_TAP/Formula/deepwork.rb" > "$TAP_DIR/Formula/deepwork.rb" echo "==> Installing from local build..." brew uninstall deepwork 2>/dev/null || true -brew install --formula --verbose "$TEMP_FORMULA" +brew install --verbose "$TAP_NAME/deepwork" echo "==> Running brew test..." -brew test deepwork +brew test "$TAP_NAME/deepwork" echo "==> Verifying binary..." deepwork --version