From 34851e38b972dc36a4b7970f95e67bc0d1cd0ac0 Mon Sep 17 00:00:00 2001 From: lola Date: Mon, 21 Jul 2025 17:07:40 -0700 Subject: [PATCH 1/5] Add Python 3.14 support --- docs/conf.py | 6 ++++-- docs/simulators.rst | 4 ++++ pyproject.toml | 2 +- tox.ini | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 02628a3ec..cbb53d094 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -605,7 +605,9 @@ def add_directive_header(self, sig): orig_object_description = sphinx.util.inspect.object_description -def object_description(obj): +def object_description(obj, **kwargs): + # Accept **kwargs to support Sphinx ≥7.2, which passes the `_seen` argument + # to object_description. This ensures compatibility across Sphinx versions. if obj is scenic.core.regions.nowhere or obj is scenic.core.regions.everywhere: return str(obj) elif isinstance( @@ -622,7 +624,7 @@ def object_description(obj): elif obj is sys.stderr: return "sys.stderr" else: - return orig_object_description(obj) + return orig_object_description(obj, **kwargs) sphinx.util.inspect.object_description = object_description diff --git a/docs/simulators.rst b/docs/simulators.rst index 2b1e22df0..4214ff69f 100644 --- a/docs/simulators.rst +++ b/docs/simulators.rst @@ -10,6 +10,10 @@ On this page we list interfaces that we and others have developed; if you have a Note that not every interface supports all Scenic features: in particular, some interfaces do not support dynamic scenarios. See the individual entries for details on each interface's capabilities and how to set it up. +.. note:: + While Scenic aims to support multiple Python versions, some simulators may have more limited compatibility. + Be sure to check the documentation of each simulator to confirm which Python versions are supported. + .. contents:: List of Simulators :local: diff --git a/pyproject.toml b/pyproject.toml index aea2630d9..f4480869e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ test-full = [ # like 'test' but adds dependencies for optional features "exceptiongroup", "inflect ~= 5.5", "pygments ~= 2.11", - "sphinx >= 6.2.0, <7.2.0", + "sphinx >= 6.2.0, <8", "sphinx_rtd_theme >= 0.5.2", "sphinx-tabs ~= 3.4.1", "verifai >= 2.1.0b1", diff --git a/tox.ini b/tox.ini index d4f9392dd..19ed9d3f8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] -envlist = py{38,39,310,311,312,313}{,-extras} +envlist = py{38,39,310,311,312,313,314}{,-extras} labels = - basic = py{38,39,310,311,312,313} + basic = py{38,39,310,311,312,313,314} [testenv] extras = From e83736a8b12e8b5cc813f9eafc8861d0ddf36222 Mon Sep 17 00:00:00 2001 From: lola Date: Mon, 28 Jul 2025 15:01:54 -0700 Subject: [PATCH 2/5] =?UTF-8?q?Enable=20tox=20testing=20on=20Python=203.12?= =?UTF-8?q?=E2=80=933.14=20by=20excluding=20MetaDrive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 7 +++++-- tox.ini | 13 +++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f4480869e..bac526a65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,10 +64,9 @@ test = [ # minimum dependencies for running tests (used for tox virtualenvs) "pytest-cov >= 3.0.0", "pytest-randomly ~= 3.2", ] -test-full = [ # like 'test' but adds dependencies for optional features +test-full-without-metadrive = [ # like 'test', but adds optional dependencies excluding MetaDrive (for Python ≥ 3.12) "scenic[test]", # all dependencies from 'test' extra above "scenic[guideways]", # for running guideways modules - 'scenic[metadrive]; python_version <= "3.11"', # MetaDrive only supports Python ≤ 3.11; excluded for newer versions "astor >= 0.8.1", 'carla >= 0.9.12; python_version <= "3.10" and (platform_system == "Linux" or platform_system == "Windows")', "dill", @@ -79,6 +78,10 @@ test-full = [ # like 'test' but adds dependencies for optional features "sphinx-tabs ~= 3.4.1", "verifai >= 2.1.0b1", ] +test-full = [ # like 'test-full-without-metadrive', but also includes MetaDrive (only for Python ≤ 3.11) + "scenic[test-full-without-metadrive]", + 'scenic[metadrive]; python_version <= "3.11"', # MetaDrive only supports Python ≤ 3.11; excluded for newer versions +] dev = [ "scenic[test-full]", "black ~= 25.1.0", diff --git a/tox.ini b/tox.ini index 19ed9d3f8..791b6371f 100644 --- a/tox.ini +++ b/tox.ini @@ -9,3 +9,16 @@ extras = extras: test-full commands = pytest --basetemp={envtmpdir} {posargs} + +# Skip installing MetaDrive for Python ≥ 3.12 since it's unsupported +[testenv:py312-extras] +extras = + test-full-without-metadrive + +[testenv:py313-extras] +extras = + test-full-without-metadrive + +[testenv:py314-extras] +extras = + test-full-without-metadrive From 4da5e31c0c799211fb1354a712155e4134279faa Mon Sep 17 00:00:00 2001 From: lola Date: Mon, 28 Jul 2025 16:32:29 -0700 Subject: [PATCH 3/5] Add Python 3.14 support to CI and pre-commit config --- .github/workflows/run-tests.yml | 4 ++-- .pre-commit-config.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 69336f470..7d05b888d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -33,11 +33,11 @@ jobs: strategy: fail-fast: true matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] os: [ubuntu-latest, windows-latest, macos-13, macos-latest] include: # Only run slow tests on the latest version of Python - - python-version: "3.13" + - python-version: "3.14" slow: true runs-on: ${{ matrix.os }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 703fabe41..4f86e1d46 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,10 +3,10 @@ repos: rev: 25.1.0 hooks: - id: black - language_version: python3.13 + language_version: python3.14 - repo: https://github.com/pycqa/isort rev: 5.12.0 hooks: - id: isort - language_version: python3.13 + language_version: python3.14 From 1111842c0e86aab2b062bec212c24ab6486ba2e7 Mon Sep 17 00:00:00 2001 From: lola Date: Mon, 4 Aug 2025 11:59:29 -0700 Subject: [PATCH 4/5] Work around tox issue with MetaDrive; allow pre-release Python in setup-python --- .github/workflows/run-tests.yml | 1 + pyproject.toml | 8 +++----- tox.ini | 13 ------------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5476e0cf7..b00d5d513 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -63,6 +63,7 @@ jobs: uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true cache: 'pip' - name: Update pip diff --git a/pyproject.toml b/pyproject.toml index bac526a65..995f1b665 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,7 +64,7 @@ test = [ # minimum dependencies for running tests (used for tox virtualenvs) "pytest-cov >= 3.0.0", "pytest-randomly ~= 3.2", ] -test-full-without-metadrive = [ # like 'test', but adds optional dependencies excluding MetaDrive (for Python ≥ 3.12) +test-full = [ # like 'test' but adds dependencies for optional features "scenic[test]", # all dependencies from 'test' extra above "scenic[guideways]", # for running guideways modules "astor >= 0.8.1", @@ -72,16 +72,14 @@ test-full-without-metadrive = [ # like 'test', but adds optional dependencies e "dill", "exceptiongroup", "inflect ~= 5.5", + 'metadrive-simulator >= 0.4.3; python_version <= "3.11"', # listed directly (not scenic[metadrive]) to work around tox issue that ignored the python_version<=3.11 guard "pygments ~= 2.11", "sphinx >= 6.2.0, <8", "sphinx_rtd_theme >= 0.5.2", "sphinx-tabs ~= 3.4.1", + 'sumolib >= 1.21.0; python_version <= "3.11"', # required for MetaDrive "verifai >= 2.1.0b1", ] -test-full = [ # like 'test-full-without-metadrive', but also includes MetaDrive (only for Python ≤ 3.11) - "scenic[test-full-without-metadrive]", - 'scenic[metadrive]; python_version <= "3.11"', # MetaDrive only supports Python ≤ 3.11; excluded for newer versions -] dev = [ "scenic[test-full]", "black ~= 25.1.0", diff --git a/tox.ini b/tox.ini index 791b6371f..19ed9d3f8 100644 --- a/tox.ini +++ b/tox.ini @@ -9,16 +9,3 @@ extras = extras: test-full commands = pytest --basetemp={envtmpdir} {posargs} - -# Skip installing MetaDrive for Python ≥ 3.12 since it's unsupported -[testenv:py312-extras] -extras = - test-full-without-metadrive - -[testenv:py313-extras] -extras = - test-full-without-metadrive - -[testenv:py314-extras] -extras = - test-full-without-metadrive From ba35730ede2d4487e3603a2dc152cb18a61af676 Mon Sep 17 00:00:00 2001 From: Lola Marrero Date: Tue, 31 Mar 2026 10:05:37 -0700 Subject: [PATCH 5/5] Use pygame-ce on Python 3.10+ and allow CARLA on Python 3.12 --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 473d6895a..2b6732727 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,8 +38,8 @@ dependencies = [ "opencv-python ~= 4.5", "pegen >= 0.3.0", "pillow >= 9.1", - 'pygame >= 2.1.3.dev8, <3; python_version >= "3.11"', - 'pygame ~= 2.0; python_version < "3.11"', + 'pygame-ce >= 2.5.7, <3; python_version >= "3.10"', + 'pygame ~= 2.0; python_version < "3.10"', "pyglet >= 1.5, <= 1.5.26", "python-fcl >= 0.7", "Rtree ~= 1.0", @@ -68,7 +68,7 @@ test-full = [ # like 'test' but adds dependencies for optional features "scenic[test]", # all dependencies from 'test' extra above "scenic[guideways]", # for running guideways modules "astor >= 0.8.1", - 'carla >= 0.9.12; python_version <= "3.10" and (platform_system == "Linux" or platform_system == "Windows")', + 'carla >= 0.9.12; python_version <= "3.12" and (platform_system == "Linux" or platform_system == "Windows")', "dill", "exceptiongroup", "inflect ~= 5.5",