From f6bb62abb28582752a7f82bc6e5f43a352cd12cd Mon Sep 17 00:00:00 2001 From: Daniel Fremont Date: Fri, 14 Feb 2025 11:12:39 -0800 Subject: [PATCH] Add support for Python 3.13 (#328) * fixes for Python 3.13 * allow newer manifold3d versions as the API has stabilized * bump version number --- pyproject.toml | 6 +++--- src/scenic/syntax/scenic.gram | 2 +- tests/syntax/test_errors.py | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 960bc4724..1d39d2fdd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "scenic" -version = "3.0.0" +version = "3.1.0a1" description = "The Scenic scenario description language." authors = [ { name = "Daniel Fremont" }, @@ -32,9 +32,9 @@ dependencies = [ "dotmap ~= 1.3", "mapbox_earcut >= 0.12.10", "matplotlib ~= 3.2", - "manifold3d == 2.3.0", + "manifold3d >= 2.5.1", "networkx >= 2.6", - "numpy ~= 1.24", + "numpy >= 1.24", "opencv-python ~= 4.5", "pegen >= 0.3.0", "pillow >= 9.1", diff --git a/src/scenic/syntax/scenic.gram b/src/scenic/syntax/scenic.gram index fa181e190..0033bd59e 100644 --- a/src/scenic/syntax/scenic.gram +++ b/src/scenic/syntax/scenic.gram @@ -2891,7 +2891,7 @@ invalid_while_stmt[NoReturn]: ) } invalid_for_stmt[NoReturn]: - | [ASYNC] 'for' star_targets 'in' star_expressions NEWLINE { self.raise_syntax_error("expected ':'") } + | ['async'] 'for' star_targets 'in' star_expressions NEWLINE { self.raise_syntax_error("expected ':'") } | ['async'] a='for' star_targets 'in' star_expressions ':' NEWLINE !INDENT { self.raise_indentation_error( f"expected an indented block after 'for' statement on line {a.start[0]}" diff --git a/tests/syntax/test_errors.py b/tests/syntax/test_errors.py index f51ad6e3b..da981d583 100644 --- a/tests/syntax/test_errors.py +++ b/tests/syntax/test_errors.py @@ -374,7 +374,10 @@ def checkException(e, lines, program, bug, path, output, topLevel=True): chained = bool(e.__cause__ or (e.__context__ and not e.__suppress_context__)) assert bool(remainingLines) == chained if remainingLines: - mid = loc - 5 if topLevel else loc - 2 + if topLevel: + mid = loc - 6 if sys.version_info >= (3, 13) else loc - 5 + else: + mid = loc - 2 assert len(output) >= -(mid - 1) if e.__cause__: assert (