Skip to content

Commit

Permalink
Merge remote-tracking branch 'Farama-Foundation/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
maichmueller committed Jul 24, 2024
2 parents 8c3e525 + aff5939 commit ece3f0d
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 23 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
# Look for GitHub Actions workflows in the `root` directory
directory: "/"
# Check the for updates once a week
schedule:
interval: "weekly"
2 changes: 2 additions & 0 deletions .github/docker/manylinux-vcpkg.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ LABEL org.opencontainers.image.source https://github.com/Farama-Foundation/Arcad
RUN yum install -y curl unzip zip tar

RUN git clone https://github.com/Microsoft/vcpkg.git /opt/vcpkg
RUN cd /opt/vcpkg && git reset --hard 8150939b6


ENV VCPKG_INSTALLATION_ROOT="/opt/vcpkg"
ENV PATH="${PATH}:/opt/vcpkg"
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
fail-fast: false
matrix:
include:
# To minimise the computational resources, we only use a single python version and the final test-wheels for all python versions
# To minimise the computational resources, we only use a single python version and the final test-wheels for all python versions
- runs-on: ubuntu-latest
python: '3.8'
triplet: x64-linux-mixed
Expand Down Expand Up @@ -152,14 +152,14 @@ jobs:
- name: Set up Docker Buildx
if: runner.os == 'linux'
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
with:
install: true

- name: Build Docker image with vcpkg
if: runner.os == 'linux'
# using build-push-action (without push) to make use of cache arguments
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: .
file: .github/docker/manylinux-vcpkg.Dockerfile
Expand All @@ -176,6 +176,7 @@ jobs:
run: brew install pkg-config

- uses: lukka/run-vcpkg@v11
if: runner.os != 'linux'
with:
vcpkgGitCommitId: "8150939b69720adc475461978e07c2d2bf5fb76e"
# There's a permissions issue with the cache
Expand All @@ -186,7 +187,7 @@ jobs:
run: ./scripts/download_unpack_roms.sh

- name: Build wheels
uses: pypa/cibuildwheel@v2.17.0
uses: pypa/cibuildwheel@v2.19.2
env:
CIBW_ARCHS: "${{ matrix.arch }}"

Expand All @@ -205,10 +206,10 @@ jobs:
matrix:
include:
# example wheel names (if the wheel names change, look at the `ls wheels/` for the new names)
# ale_py-0.9.0-cp310-cp310-macosx_10_15_x86_64.whl
# ale_py-0.9.0-cp310-cp310-macosx_11_0_arm64.whl
# ale_py-0.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
# ale_py-0.9.0-cp310-cp310-win_amd64.whl
# ale_py-0.x.x-cp310-cp310-macosx_10_15_x86_64.whl
# ale_py-0.x.x-cp310-cp310-macosx_11_0_arm64.whl
# ale_py-0.x.x-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
# ale_py-0.x.x-cp310-cp310-win_amd64.whl
- runs-on: ubuntu-latest # arch: x86_64
python: '3.8'
wheel-name: 'cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64'
Expand Down Expand Up @@ -289,10 +290,10 @@ jobs:

- name: Build
# wildcarding doesn't work for some reason, therefore, update the project version here
run: python -m pip install wheels/ale_py-0.9.0-${{ matrix.wheel-name }}.whl
run: python -m pip install wheels/ale_py-0.9.1-${{ matrix.wheel-name }}.whl

- name: Install Gymnasium and pytest
run: python -m pip install gymnasium>=1.0.0a1 pytest
run: python -m pip install gymnasium>=1.0.0a2 pytest

- name: Test
run: python -m pytest
7 changes: 4 additions & 3 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ jobs:
- name: Set up Docker Buildx
if: runner.os == 'linux'
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
with:
install: true

- name: Build Docker image with vcpkg
if: runner.os == 'linux'
# using build-push-action (without push) to make use of cache arguments
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: .
file: .github/docker/manylinux-vcpkg.Dockerfile
Expand All @@ -57,6 +57,7 @@ jobs:
run: brew install pkg-config

- uses: lukka/run-vcpkg@v11
if: runner.os != 'linux'
with:
vcpkgGitCommitId: "8150939b69720adc475461978e07c2d2bf5fb76e"
# There's a permissions issue with the cache
Expand All @@ -67,7 +68,7 @@ jobs:
run: ./scripts/download_unpack_roms.sh

- name: Build wheels
uses: pypa/cibuildwheel@v2.17.0
uses: pypa/cibuildwheel@v2.19.2
env:
CIBW_ARCHS: "${{ matrix.arch }}"

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Note: Make sure you're using an up-to-date version of `pip` or the installation

You can now import the ALE in your Python projects with providing a direct interface to Stella for interacting with games
```python
from ale_py import ALEInterface
from ale_py import ALEInterface, roms

ale = ALEInterface()
ale.loadROM("Breakout")
ale.loadROM(roms.get_rom_path("Breakout"))
ale.reset_game()

reward = ale.act(0) # noop
Expand Down
17 changes: 12 additions & 5 deletions src/ale/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
find_package(Python3 COMPONENTS Interpreter Development.Module REQUIRED)

set(PYBIND11_VER 2.13.1)

include(FetchContent)
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG v2.10.0)
FetchContent_MakeAvailable(pybind11)
set(PYBIND11_FINDPYTHON ON)
find_package(pybind11 ${PYBIND11_VER} QUIET)

if(NOT pybind11_FOUND)
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG v${PYBIND11_VER})
FetchContent_MakeAvailable(pybind11)
endif()

add_library(ale-py MODULE ale_python_interface.cpp)
# Depend on the ALE and pybind11 module
Expand Down
2 changes: 1 addition & 1 deletion tests/python/test_python_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_get_ram(tetris):
tetris.getRAM(preallocate)
assert exc_info.type == TypeError

preallocate = np.empty((1), dtype=np.uint8)
preallocate = np.empty(1, dtype=np.uint8)
with pytest.raises(RuntimeError) as exc_info:
tetris.getRAM(preallocate)
assert exc_info.type == RuntimeError
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "arcade-learning-environment",
"version": "0.9.0",
"version": "0.9.1",
"dependencies": [
"zlib"
],
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.0
0.9.1

0 comments on commit ece3f0d

Please sign in to comment.