Skip to content

Commit 8d338b6

Browse files
Make miniwob installation automatic. (#359)
1 parent 79ac68e commit 8d338b6

File tree

3 files changed

+63
-2
lines changed

3 files changed

+63
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,7 @@ tests/assistantbench/assistantbench-predictions-test.jsonl
151151
# weblinx
152152
bg_wl_data/
153153

154+
# miniwob setup
155+
miniwob-plusplus/
156+
154157
uv.lock

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,39 @@ demo:
1212
@echo "--- 🚀 Running demo agent ---"
1313
(set -x && cd demo_agent && python run_demo.py)
1414

15+
setup-miniwob:
16+
@echo "--- 🤖 Setting up MiniWoB++ ---"
17+
@if [ ! -d "miniwob-plusplus" ]; then \
18+
echo "Cloning MiniWoB++ repository..."; \
19+
git clone https://github.com/Farama-Foundation/miniwob-plusplus.git; \
20+
else \
21+
echo "MiniWoB++ repository already exists, skipping clone..."; \
22+
fi
23+
@echo "Resetting to specific commit for reproducibility..."
24+
git -C "./miniwob-plusplus" reset --hard 7fd85d71a4b60325c6585396ec4f48377d049838
25+
@echo "Adding MINIWOB_URL to .env file..."
26+
@echo "MINIWOB_URL=\"file://$(shell pwd)/miniwob-plusplus/miniwob/html/miniwob/\"" >> .env
27+
@echo "✅ MiniWoB++ setup complete!"
28+
@echo "💡 To use MiniWoB++, load the environment variables:"
29+
@echo " source .env"
30+
1531
test-core:
1632
@echo "--- 🧪 Running tests ---"
1733
pytest -n auto ./tests/core
34+
35+
clean-miniwob:
36+
@echo "--- 🧹 Cleaning MiniWoB++ installation ---"
37+
rm -rf miniwob-plusplus
38+
@echo "✅ MiniWoB++ installation cleaned!"
39+
40+
help:
41+
@echo "Available targets:"
42+
@echo " install - Install project dependencies"
43+
@echo " setup-miniwob - Setup MiniWoB++ dependencies"
44+
@echo " install-demo - Install demo dependencies"
45+
@echo " demo - Run demo agent"
46+
@echo " test-core - Run core tests"
47+
@echo " clean-miniwob - Remove MiniWoB++ directory"
48+
@echo " help - Show this help message"
49+
50+
.PHONY: install setup-miniwob install-demo demo test-core clean-miniwob help

browsergym/miniwob/README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,43 @@ This package provides `browsergym.miniwob`, which is an unofficial port of the [
44

55
## Setup
66

7+
### Option 1: Automated setup (Recommended)
8+
9+
If you're working from the BrowserGym root directory, you can use the Makefile for automated setup:
10+
11+
```sh
12+
make setup-miniwob
13+
```
14+
15+
This will:
16+
17+
- Clone the MiniWoB++ repository
18+
- Reset to the specific commit for reproducibility
19+
- Add the `MINIWOB_URL` to your `.env` file
20+
21+
Then load the environment variables:
22+
23+
```sh
24+
source .env
25+
```
26+
27+
### Option 2: Manual setup
28+
729
1. Install the package
30+
831
```sh
932
pip install browsergym-miniwob
1033
```
1134

12-
2. Clone miniwob (use a specific frozen commit for reproducibility)
35+
1. Clone miniwob (use a specific frozen commit for reproducibility)
36+
1337
```sh
1438
git clone [email protected]:Farama-Foundation/miniwob-plusplus.git
1539
git -C "./miniwob-plusplus" reset --hard 7fd85d71a4b60325c6585396ec4f48377d049838
1640
```
1741

18-
3. Setup Miniwob URL (change `PATH_TO_MINIWOB_CLONED_REPO` here to the absolute path to your `miniwob-plusplus` folder)
42+
1. Setup Miniwob URL (change `PATH_TO_MINIWOB_CLONED_REPO` here to the absolute path to your `miniwob-plusplus` folder)
43+
1944
```sh
2045
export MINIWOB_URL="file://<PATH_TO_MINIWOB_CLONED_REPO>/miniwob/html/miniwob/"
2146
```

0 commit comments

Comments
 (0)