Skip to content

Commit

Permalink
Pull Gym env in favor of Gymnasium and include ROMs with PyPI (#516)
Browse files Browse the repository at this point in the history
Co-authored-by: Jet <[email protected]>
  • Loading branch information
pseudo-rnd-thoughts and jjshoots authored Apr 23, 2024
1 parent 4c99c70 commit 9ac218a
Show file tree
Hide file tree
Showing 35 changed files with 766 additions and 997 deletions.
60 changes: 28 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: pre-commit/[email protected]

tests:
name: ${{ matrix.runs-on }} • py${{ matrix.python }}
Expand All @@ -36,9 +38,6 @@ jobs:
fail-fast: false
matrix:
include:
- runs-on: ubuntu-latest
python: '3.7'
triplet: x64-linux-mixed
- runs-on: ubuntu-latest
python: '3.8'
triplet: x64-linux-mixed
Expand All @@ -51,26 +50,26 @@ jobs:
- runs-on: ubuntu-latest
python: '3.11'
triplet: x64-linux-mixed
- runs-on: ubuntu-latest
python: '3.12'
triplet: x64-linux-mixed

- runs-on: macos-latest
python: '3.7'
triplet: x64-osx-mixed
- runs-on: macos-latest
- runs-on: macos-12 # macos latest is macos-14-arm64 running on M1 chips which doesn't have python support
python: '3.8'
triplet: x64-osx-mixed
- runs-on: macos-latest
- runs-on: macos-12
python: '3.9'
triplet: x64-osx-mixed
- runs-on: macos-latest
- runs-on: macos-12
python: '3.10'
triplet: x64-osx-mixed
- runs-on: macos-latest
- runs-on: macos-12
python: '3.11'
triplet: x64-osx-mixed
- runs-on: macos-12
python: '3.12'
triplet: x64-osx-mixed

- runs-on: windows-latest
python: '3.7'
triplet: x64-windows
- runs-on: windows-latest
python: '3.8'
triplet: x64-windows
Expand All @@ -83,47 +82,44 @@ jobs:
- runs-on: windows-latest
python: '3.11'
triplet: x64-windows
- runs-on: windows-latest
python: '3.12'
triplet: x64-windows
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
runs-on: ${{ matrix.runs-on }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Install test dependencies
# TODO(jfarebro): There's a bug with Windows cmake and PEP517 builds via pip install.
# As a temporary workaround installing cmake outside of the isolated env seems to work.
run: |
python -m pip install --user --upgrade -r tests/requirements.txt
python -m pip install --user cmake
run: python -m pip install --user cmake

- uses: microsoft/setup-msbuild@v1.1
- uses: microsoft/setup-msbuild@v2
if: runner.os == 'Windows'
# TODO(jfarebro): 02/16/2023 - There's a bug where pkg-config isn't installed on the macOS
# runner. See: https://github.com/actions/runner-images/pull/7125
- name: Install pkg-config on macOS
if: runner.os == 'macOS'
run: brew install pkg-config
- uses: lukka/run-vcpkg@v10
- uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: "9aa0d66373ce3a6868d12353d0d4960db0d4bd18"
vcpkgGitCommitId: "8150939b69720adc475461978e07c2d2bf5fb76e"
# There's a permissions issue with the cache
# https://github.com/microsoft/vcpkg/issues/20121
doNotCache: true

- name: Download and unpack ROMs
run: ./scripts/download_unpack_roms.sh

- name: Build
run: python -m pip install --user --verbose .
run: python -m pip install --verbose .[test]

- name: Test
run: python -m pytest

# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup SSH debug session on failure
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled && failure() }}
with:
limit-access-to-actor: true
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ jobs:
wheels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: ./.github/actions/download-release-asset
name: Download release wheels
with:
Expand All @@ -18,6 +19,8 @@ jobs:
- name: Unzip wheels asset
run: |
unzip wheels.zip -d dist
- name: Download and unpack ROMs
run: ./scripts/download_unpack_roms.sh
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
arch: x86_64
- runs-on: windows-latest
arch: AMD64
- runs-on: macos-latest
- runs-on: macos-12
arch: x86_64
- runs-on: macos-latest
- runs-on: macos-12
arch: arm64
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Docker
if: runner.os == 'Linux'
Expand All @@ -34,7 +34,7 @@ jobs:

- name: Setup msbuild
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v1.1
uses: microsoft/setup-msbuild@v2

# TODO(jfarebro): 02/16/2023 - There's a bug where pkg-config isn't installed on the macOS
# runner. See: https://github.com/actions/runner-images/pull/7125
Expand All @@ -44,9 +44,9 @@ jobs:

- name: Setup vcpkg
if: runner.os == 'macOS' || runner.os == 'Windows'
uses: lukka/run-vcpkg@v10
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: "9aa0d66373ce3a6868d12353d0d4960db0d4bd18"
vcpkgGitCommitId: "8150939b69720adc475461978e07c2d2bf5fb76e"
# There's a permissions issue with the cache
# https://github.com/microsoft/vcpkg/issues/20121
doNotCache: true
Expand Down
153 changes: 141 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
## ALE

ale
build
doc/examples/*Example

## Generic

# Emacs temp files
*~
.*
*#
# Don't save roms in repo
*.tar.gz.b64
*.tar.gz
*.bin
!tetris.bin

# Auto-generated dependency files
.deps
Expand All @@ -20,15 +18,146 @@ doc/examples/*Example
*.o
*.d

# Compiled Dynamic libraries
*.so

# Compiled Static libraries
*.lai
*.la
*.a

# Python
*.pyc
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
Loading

0 comments on commit 9ac218a

Please sign in to comment.