From 3d9d639578e2e65aed3cc389bf51d6fd12916c59 Mon Sep 17 00:00:00 2001 From: Aman Jaiswal <66757799+amanjaiswal73892@users.noreply.github.com> Date: Wed, 16 Jul 2025 12:04:41 -0400 Subject: [PATCH] Make miniwob installation automatic. --- .gitignore | 3 +++ Makefile | 33 +++++++++++++++++++++++++++++++++ browsergym/miniwob/README.md | 29 +++++++++++++++++++++++++++-- 3 files changed, 63 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f4f63f13f..5db1a8fdb 100644 --- a/.gitignore +++ b/.gitignore @@ -151,4 +151,7 @@ tests/assistantbench/assistantbench-predictions-test.jsonl # weblinx bg_wl_data/ +# miniwob setup +miniwob-plusplus/ + uv.lock diff --git a/Makefile b/Makefile index c8b0fd7a9..84cf255aa 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,39 @@ demo: @echo "--- ๐Ÿš€ Running demo agent ---" (set -x && cd demo_agent && python run_demo.py) +setup-miniwob: + @echo "--- ๐Ÿค– Setting up MiniWoB++ ---" + @if [ ! -d "miniwob-plusplus" ]; then \ + echo "Cloning MiniWoB++ repository..."; \ + git clone https://github.com/Farama-Foundation/miniwob-plusplus.git; \ + else \ + echo "MiniWoB++ repository already exists, skipping clone..."; \ + fi + @echo "Resetting to specific commit for reproducibility..." + git -C "./miniwob-plusplus" reset --hard 7fd85d71a4b60325c6585396ec4f48377d049838 + @echo "Adding MINIWOB_URL to .env file..." + @echo "MINIWOB_URL=\"file://$(shell pwd)/miniwob-plusplus/miniwob/html/miniwob/\"" >> .env + @echo "โœ… MiniWoB++ setup complete!" + @echo "๐Ÿ’ก To use MiniWoB++, load the environment variables:" + @echo " source .env" + test-core: @echo "--- ๐Ÿงช Running tests ---" pytest -n auto ./tests/core + +clean-miniwob: + @echo "--- ๐Ÿงน Cleaning MiniWoB++ installation ---" + rm -rf miniwob-plusplus + @echo "โœ… MiniWoB++ installation cleaned!" + +help: + @echo "Available targets:" + @echo " install - Install project dependencies" + @echo " setup-miniwob - Setup MiniWoB++ dependencies" + @echo " install-demo - Install demo dependencies" + @echo " demo - Run demo agent" + @echo " test-core - Run core tests" + @echo " clean-miniwob - Remove MiniWoB++ directory" + @echo " help - Show this help message" + +.PHONY: install setup-miniwob install-demo demo test-core clean-miniwob help diff --git a/browsergym/miniwob/README.md b/browsergym/miniwob/README.md index 2bda732f9..90dcf71ef 100644 --- a/browsergym/miniwob/README.md +++ b/browsergym/miniwob/README.md @@ -4,18 +4,43 @@ This package provides `browsergym.miniwob`, which is an unofficial port of the [ ## Setup +### Option 1: Automated setup (Recommended) + +If you're working from the BrowserGym root directory, you can use the Makefile for automated setup: + +```sh +make setup-miniwob +``` + +This will: + +- Clone the MiniWoB++ repository +- Reset to the specific commit for reproducibility +- Add the `MINIWOB_URL` to your `.env` file + +Then load the environment variables: + +```sh +source .env +``` + +### Option 2: Manual setup + 1. Install the package + ```sh pip install browsergym-miniwob ``` -2. Clone miniwob (use a specific frozen commit for reproducibility) +1. Clone miniwob (use a specific frozen commit for reproducibility) + ```sh git clone git@github.com:Farama-Foundation/miniwob-plusplus.git git -C "./miniwob-plusplus" reset --hard 7fd85d71a4b60325c6585396ec4f48377d049838 ``` -3. Setup Miniwob URL (change `PATH_TO_MINIWOB_CLONED_REPO` here to the absolute path to your `miniwob-plusplus` folder) +1. Setup Miniwob URL (change `PATH_TO_MINIWOB_CLONED_REPO` here to the absolute path to your `miniwob-plusplus` folder) + ```sh export MINIWOB_URL="file:///miniwob/html/miniwob/" ```