Skip to content

Commit 3f31293

Browse files
committed
make makefile to run test locally
1 parent 09ef9a6 commit 3f31293

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

.github/workflows/darglint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ jobs:
3131
run: pip list
3232

3333
- name: Darglint checks
34-
run: darglint -v 2 -z short .
34+
run: darglint -v 2 -z short src/

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,6 @@ results/
168168
# gradio
169169
.gradio/
170170

171-
outputs/
171+
outputs/
172+
miniwob-plusplus/
173+
.miniwob-server.pid

Makefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.PHONY: test setup miniwob lint
2+
setup:
3+
@pip install darglint black
4+
@pip install -e .
5+
@playwright install chromium --with-deps
6+
@python -c 'import nltk; nltk.download("punkt_tab")'
7+
8+
miniwob:
9+
@kill -9 `cat .miniwob-server.pid` || true
10+
@git clone https://github.com/Farama-Foundation/miniwob-plusplus.git || true
11+
@cd miniwob-plusplus && git checkout 7fd85d71a4b60325c6585396ec4f48377d049838
12+
@python -m http.server 8080 --directory miniwob-plusplus/miniwob/html & echo $$! > .miniwob-server.pid
13+
@sleep 2
14+
@echo "MiniWob server started on port 8080"
15+
@echo "To stop the server: kill \`cat .miniwob-server.pid\`"
16+
17+
test: setup miniwob
18+
@MINIWOB_URL="http://localhost:8080/miniwob/" pytest -n 5 --durations=10 -m 'not pricy' -v tests/
19+
20+
lint:
21+
black src/ --check --diff
22+
darglint -v 2 -z short src/

src/agentlab/experiments/loop.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,10 +924,13 @@ def _flatten_dict(d, parent_key="", sep="."):
924924
return dict(items)
925925

926926

927-
def as_tape(steps_info: list) -> Tape:
927+
def as_tape(steps_info: list[StepInfo]) -> Tape:
928928
"""
929929
Create a Tape object from the steps info.
930930
931+
Args:
932+
steps_info: list of StepInfo objects.
933+
931934
Returns:
932935
Tape: a Tape object containing the steps and metadata.
933936
"""

0 commit comments

Comments
 (0)