Skip to content

Commit

Permalink
Merge branch 'master' into ci
Browse files Browse the repository at this point in the history
  • Loading branch information
btjanaka committed Sep 10, 2023
2 parents cb4614e + 8a5be85 commit 8af5137
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 151 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,30 +113,29 @@ jobs:
examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# SWIG should not be installed so that we can test that lunar lander is
# installing SWIG properly. See https://github.com/icaros-usc/pyribs/pull/366
- name: Remove swig
run: sudo rm -rf /usr/bin/swig
- name: Set up Python 3.8
uses: actions/setup-python@v4
run: sudo apt-get remove swig
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: "3.8"
- name: Create virtual env
run: python -m venv ./venv && source ./venv/bin/activate
python-version: 3.8
- name: Install deps
shell: bash -el {0}
run: pip install .[visualize]
- name: Test Examples
shell: bash -el {0}
run: bash tests/examples.sh
tutorials:
runs-on: ubuntu-latest
steps:
# We use Python 3.10 instead of 3.8 here since Google Colab uses 3.10.
- uses: actions/checkout@v4
# SWIG should not be installed so that we can test that lunar lander is
# installing SWIG properly. See https://github.com/icaros-usc/pyribs/pull/366
- name: Remove swig
run: sudo rm -rf /usr/bin/swig
run: sudo apt-get remove swig
# We use Python 3.10 instead of 3.8 here since Google Colab uses 3.10.
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
Expand Down
5 changes: 3 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ max-nested-blocks=5
max-line-length=80

# Regexp for a line that is allowed to be longer than the limit. The first group
# (before the `|`) matches URLs, and the second matches Sphinx links.
ignore-long-lines=(^\s*(# )?<?https?://\S+>?$)|(^\s*<.*>`_.?$)
# (before the `|`) matches URLs, the second matches Sphinx links, the third
# matches pip install commands.
ignore-long-lines=(^\s*(# )?<?https?://\S+>?$)|(^\s*<.*>`_.?$)|(^\s*pip install .*)

# Allow the body of an if to be on the same line as the test if there is no
# else.
Expand Down
4 changes: 2 additions & 2 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@

- Use dask instead of multiprocessing for lunar lander tutorial ({pr}`346`)
- pip install swig before gymnasium[box2d] in lunar lander tutorial ({pr}`346`)
- Fix lunar lander dependency issues ({pr}`366`)
- Fix lunar lander dependency issues ({pr}`366`, {pr}`377`)

#### Improvements

- Improve developer workflow with pre-commit ({pr}`351`, {pr}`363`)
- Refactor visualize module into multiple files ({pr}`357`)
- Add GitHub link roles in documentation ({pr}`361`)
- Refactor argument validation utilities ({pr}`365`)
- Use virtualenv in all CI jobs ({pr}`367`)
- Use virtualenv in all CI jobs ({pr}`368`)

## 0.5.2

Expand Down
6 changes: 4 additions & 2 deletions examples/lunar_lander.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""Uses CMA-ME to train agents with linear policies in Lunar Lander.
Install the following dependencies before running this example:
pip install ribs[visualize] tqdm fire gymnasium[box2d]==0.27.0 moviepy>=1.0.0 dask>=2.0.0 distributed>=2.0.0 bokeh>=2.0.0
Install the following dependencies before running this example -- swig must be
installed before box2d can be installed, hence it is a separate command:
pip install swig
pip install ribs[visualize] tqdm fire gymnasium[box2d]==0.29.1 moviepy>=1.0.0 dask>=2.0.0 distributed>=2.0.0 bokeh>=2.0.0
This script uses the same setup as the tutorial, but it also uses Dask instead
of Python's multiprocessing to parallelize evaluations on a single machine and
Expand Down
7 changes: 5 additions & 2 deletions tests/examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ if [ ! -d "${TMPDIR}" ]; then
fi

function install_deps() {
install_cmd=$(grep "pip install" "$1")
$install_cmd
# Loop through all instances of `pip install` in the script and run the
# installation commands.
grep '^\s*pip install' "$1" | while read -r install_cmd ; do
$install_cmd
done
}

# Single-threaded for consistency.
Expand Down
Loading

0 comments on commit 8af5137

Please sign in to comment.