Skip to content

Commit

Permalink
Merge pull request #8 from ServiceNow/pre-release
Browse files Browse the repository at this point in the history
v0.2.0
  • Loading branch information
gasse authored May 9, 2024
2 parents 69a4ebc + e4b7a3f commit 4e9521c
Show file tree
Hide file tree
Showing 55 changed files with 2,236 additions and 603 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
name: Build and Publish

on: [push, workflow_dispatch]

Expand Down
188 changes: 188 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
name: Unit tests

on:
push:
branches:
- main
pull_request:

jobs:

code-format:
runs-on: ubuntu-latest

defaults:
run:
shell: bash -l {0}

steps:

- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies

- name: Pip install
run: pip install black[jupyter]==24.2.0 blacken-docs

- name: Code Formatting
run: black . --check

browsergym-core:
runs-on: ubuntu-latest

defaults:
run:
shell: bash -l {0}

steps:

- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies

- name: Pip install
working-directory: ./dev
run: pip install -r requirements.txt

- name: Pip list
run: pip list

- name: Install Playwright
run: playwright install --with-deps

- name: Run browsergym-core Unit Tests
run: pytest -n 1 --durations=10 -m 'not pricy' -v core/tests

browsergym-miniwob:
runs-on: ubuntu-latest

defaults:
run:
shell: bash -l {0}

steps:

- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies

- name: Pip install
working-directory: ./dev
run: pip install -r requirements.txt

- name: Pip list
run: pip list

- name: Install Playwright
run: playwright install --with-deps

- name: Fetch MiniWob
uses: actions/checkout@v4
with:
repository: "Farama-Foundation/miniwob-plusplus"
ref: "7fd85d71a4b60325c6585396ec4f48377d049838"
path: "miniwob-plusplus"

- name: Serve MiniWob
uses: Eun/http-server-action@v1
with:
directory: "${{ github.workspace }}/miniwob-plusplus/miniwob/html"
port: 8080

- name: Run browsergym-miniwob Unit Tests
env:
MINIWOB_URL: "http://localhost:8080/miniwob/"
run: pytest -n 5 --durations=10 -m 'not pricy' -v miniwob/tests

browsergym-webarena-fast:
runs-on: ubuntu-latest

defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies

- name: Pip install
working-directory: ./dev
run: pip install -r requirements.txt

- name: Pip list
run: pip list

- name: Install Playwright
run: playwright install --with-deps

- name: Run browsergym-webarena not slow Unit Tests
env:
SHOPPING: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:7770/"
SHOPPING_ADMIN: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:7780/admin"
REDDIT: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:9999"
GITLAB: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:8023"
WIKIPEDIA: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:8888/wikipedia_en_all_maxi_2022-05/A/User:The_other_Kiwix_guy/Landing"
MAP: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:3000"
HOMEPAGE: "PASS:4399"
WEBARENA_PATH: "${{ github.workspace }}/webarena/"
run: pytest -n 5 --durations=10 -m 'not slow and not pricy' --slowmo 1000 -v webarena/tests

browsergym-webarena-slow:
runs-on: ubuntu-latest

defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies

- name: Pip install
working-directory: ./dev
run: pip install -r requirements.txt

- name: Pip list
run: pip list

- name: Install Playwright
run: playwright install --with-deps

- name: Run browsergym-webarena slow Unit Tests
env:
SHOPPING: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:7770/"
SHOPPING_ADMIN: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:7780/admin"
REDDIT: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:9999"
GITLAB: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:8023"
WIKIPEDIA: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:8888/wikipedia_en_all_maxi_2022-05/A/User:The_other_Kiwix_guy/Landing"
MAP: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:3000"
HOMEPAGE: "PASS:4399"
WEBARENA_PATH: "${{ github.workspace }}/webarena/"
run: pytest -n 5 --durations=10 -m 'slow and not pricy' --slowmo 1000 -v webarena/tests
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.DS_store
.DS_store
__pycache__/
*.py[cod]
44 changes: 44 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
fail_fast: false

default_language_version:
python: python3

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: trailing-whitespace
exclude: ^(.*)\.md$
- id: end-of-file-fixer
- id: check-yaml
exclude: ^(.circleci/recipe|recipe) # conda build recipes are templated
- id: check-added-large-files
- repo: https://github.com/pocc/pre-commit-hooks
rev: v1.1.1
hooks:
- id: clang-format
args: [--style=file, -i]
- id: clang-tidy
args: [--fix, --fix-errors]
- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black
args: [--config=./pyproject.toml]
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
hooks:
- id: blacken-docs
args: [ '--line-length', '100' ]
additional_dependencies: [black]
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: forbid-crlf
- id: remove-crlf
# Black does not clear tabs in docstrings
- id: forbid-tabs
files: '.*\.py$'
- id: remove-tabs
files: '.*\.py$'
args: [ '--whitespaces-count', '4' ]
2 changes: 1 addition & 1 deletion core/src/browsergym/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.1.0rc7"
__version__ = "0.2.0"

import playwright.sync_api

Expand Down
Empty file.
Loading

0 comments on commit 4e9521c

Please sign in to comment.