From 44324d5438d430efd6a1e39da97018f2651da1fc Mon Sep 17 00:00:00 2001 From: Florian Felten Date: Thu, 24 Oct 2024 17:14:21 +0200 Subject: [PATCH] Add Python 3.12 support (#108) --- .github/workflows/test.yml | 13 +++++-------- README.md | 2 ++ pyproject.toml | 7 ++++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5f205a95..c05a60ad 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,10 +8,10 @@ on: jobs: linux-test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -20,14 +20,11 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - pip install pytest - pip install mujoco==2.3.2 - git clone https://github.com/benelot/pybullet-gym.git - pip install -e pybullet-gym + pip install uv + uv pip install --system pytest sudo apt-get update sudo apt-get install libglu1-mesa-dev libgl1-mesa-dev libosmesa6-dev xvfb patchelf ffmpeg cmake swig - pip install gymnasium - pip install -e .[all] + uv pip install --system -e .[all] - name: Full Python tests run: | pytest tests/test_envs.py diff --git a/README.md b/README.md index 708bb3a6..cfa346dc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Python](https://img.shields.io/pypi/pyversions/mo-gymnasium.svg)](https://badge.fury.io/py/mo-gymnasium) +[![PyPI](https://badge.fury.io/py/mo-gymnasium.svg)](https://badge.fury.io/py/mo-gymnasium) ![tests](https://github.com/Farama-Foundation/mo-gymnasium/workflows/Python%20tests/badge.svg) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://pre-commit.com/) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) diff --git a/pyproject.toml b/pyproject.toml index d4b42d55..e779a7c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", 'Intended Audience :: Science/Research', 'Topic :: Scientific/Engineering :: Artificial Intelligence', ] @@ -36,7 +37,7 @@ mario = ["nes-py", "gym-super-mario-bros"] minecart = ["scipy >=1.7.3 "] mujoco = ["mujoco >=2.2.0", "imageio >=2.14.1"] highway = ["highway-env >=1.8"] -box2d = ["box2d-py ==2.3.5", "pygame ==2.1.3.dev8", "swig ==4.*"] +box2d = ["box2d-py ==2.3.5", "pygame >=2.1.3", "swig ==4.*"] all = [ # All dependencies above except accept-rom-license # NOTE: No need to manually remove the duplicates, setuptools automatically does that. @@ -52,7 +53,7 @@ all = [ "highway-env >= 1.9.1", # box2d "box2d-py ==2.3.5", - "pygame ==2.1.3.dev8", + "pygame >=2.1.3", "swig ==4.*", ] testing = ["pytest ==7.1.3"] @@ -80,7 +81,7 @@ mo_gymnasium = [ [tool.black] line-length = 127 -target-version = ['py38', 'py39', 'py310', 'py311'] +target-version = ['py38', 'py39', 'py310', 'py311', 'py312'] include = '\.pyi?$' [tool.isort]