From c9e6c684af38d0772c5625b9b8165d56d237eca5 Mon Sep 17 00:00:00 2001 From: Jet <38184875+jjshoots@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:47:10 +0900 Subject: [PATCH 1/7] Update docs to fix broken `loadROM` (#540) Co-authored-by: Jet --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1635039c9..0d6459cd7 100644 --- a/README.md +++ b/README.md @@ -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 From 489f4f29027b0fa733d368d49b9107bf4dd4c49c Mon Sep 17 00:00:00 2001 From: Mark Towers Date: Tue, 23 Jul 2024 11:32:51 +0100 Subject: [PATCH 2/7] Add dependabot (#542) --- .github/dependabot.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..2349ee662 --- /dev/null +++ b/.github/dependabot.yml @@ -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" \ No newline at end of file From 4e5de3cbab9ae72d7fa54fd3e80e75238311eca4 Mon Sep 17 00:00:00 2001 From: Mark Towers Date: Tue, 23 Jul 2024 12:06:42 +0100 Subject: [PATCH 3/7] Add compatibility with NumPy 2.0 (#535) --- .github/dependabot.yml | 2 +- .github/docker/manylinux-vcpkg.Dockerfile | 2 ++ .github/workflows/ci.yml | 15 ++++++++------- .github/workflows/pypi.yml | 1 + src/python/CMakeLists.txt | 3 ++- tests/python/test_python_interface.py | 2 +- vcpkg.json | 2 +- version.txt | 2 +- 8 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2349ee662..ea7c7d788 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,4 +11,4 @@ updates: directory: "/" # Check the for updates once a week schedule: - interval: "weekly" \ No newline at end of file + interval: "weekly" diff --git a/.github/docker/manylinux-vcpkg.Dockerfile b/.github/docker/manylinux-vcpkg.Dockerfile index add3bce6a..6f5ca2a53 100644 --- a/.github/docker/manylinux-vcpkg.Dockerfile +++ b/.github/docker/manylinux-vcpkg.Dockerfile @@ -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" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eabf924f6..d323da61d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -204,10 +205,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' @@ -288,10 +289,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 diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 1d65daad1..1eb1f8ab7 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -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 diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt index 911e2805a..7d0a93395 100644 --- a/src/python/CMakeLists.txt +++ b/src/python/CMakeLists.txt @@ -4,7 +4,8 @@ include(FetchContent) FetchContent_Declare( pybind11 GIT_REPOSITORY https://github.com/pybind/pybind11 - GIT_TAG v2.10.0) + GIT_TAG v2.13.1) +set(PYBIND11_FINDPYTHON ON) FetchContent_MakeAvailable(pybind11) add_library(ale-py MODULE ale_python_interface.cpp) diff --git a/tests/python/test_python_interface.py b/tests/python/test_python_interface.py index 915cf49c2..6855b7086 100644 --- a/tests/python/test_python_interface.py +++ b/tests/python/test_python_interface.py @@ -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 diff --git a/vcpkg.json b/vcpkg.json index 756cfb495..161a99d88 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -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" ], diff --git a/version.txt b/version.txt index ac39a106c..f374f6662 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.9.0 +0.9.1 From f30f113ac867ec095f50c70d5498801c29926625 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Tue, 23 Jul 2024 08:19:07 -0400 Subject: [PATCH 4/7] cmake: patch to use system pybind11 (#528) Signed-off-by: Rui Chen Co-authored-by: Mark Towers --- src/python/CMakeLists.txt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt index 7d0a93395..337b61aa0 100644 --- a/src/python/CMakeLists.txt +++ b/src/python/CMakeLists.txt @@ -1,12 +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.13.1) set(PYBIND11_FINDPYTHON ON) -FetchContent_MakeAvailable(pybind11) +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 From 0733a65e098a907e34a4aa7808c5fe358bd560f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:33:59 +0100 Subject: [PATCH 5/7] Bump pypa/cibuildwheel from 2.17.0 to 2.19.2 (#543) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/pypi.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d323da61d..7c88f745d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -187,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 }}" diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 1eb1f8ab7..63a3d068d 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -68,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 }}" From 03ff8a3e05ecae287b3f1039796dce17031b4865 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:34:12 +0100 Subject: [PATCH 6/7] Bump docker/setup-buildx-action from 1 to 3 (#547) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/pypi.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c88f745d..e40c08c5f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,7 +152,7 @@ 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 diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 63a3d068d..565d0ece8 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -33,7 +33,7 @@ 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 From aff5939521687ad778c420f170883a169814ab2c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:34:28 +0100 Subject: [PATCH 7/7] Bump docker/build-push-action from 2 to 6 (#546) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/pypi.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e40c08c5f..7296fde8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -159,7 +159,7 @@ jobs: - 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 diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 565d0ece8..ced5b642b 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -40,7 +40,7 @@ jobs: - 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