Skip to content

Commit 543912f

Browse files
committed
Make MetaDrive an optional dependency
1 parent 6b72ef9 commit 543912f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ dependencies = [
3333
"mapbox_earcut >= 0.12.10",
3434
"matplotlib ~= 3.2",
3535
"manifold3d == 2.3.0",
36-
"metadrive-simulator >= 0.4.3",
3736
"networkx >= 2.6",
3837
"numpy ~= 1.24",
3938
"opencv-python ~= 4.5",
@@ -48,7 +47,6 @@ dependencies = [
4847
"scikit-image ~= 0.21",
4948
"scipy ~= 1.7",
5049
"shapely ~= 2.0",
51-
"sumolib >= 1.21.0",
5250
"trimesh >=4.0.9, <5",
5351
]
5452

@@ -57,6 +55,10 @@ guideways = [
5755
'pyproj ~= 3.0; python_version < "3.10"',
5856
'pyproj ~= 3.3; python_version >= "3.10"',
5957
]
58+
metadrive = [
59+
"metadrive-simulator >= 0.4.3",
60+
"sumolib >= 1.21.0",
61+
]
6062
test = [ # minimum dependencies for running tests (used for tox virtualenvs)
6163
"pytest >= 7.0.0, <8",
6264
"pytest-cov >= 3.0.0",
@@ -65,6 +67,7 @@ test = [ # minimum dependencies for running tests (used for tox virtualenvs)
6567
test-full = [ # like 'test' but adds dependencies for optional features
6668
"scenic[test]", # all dependencies from 'test' extra above
6769
"scenic[guideways]", # for running guideways modules
70+
'scenic[metadrive]; python_version <= "3.11"', # MetaDrive only supports Python ≤ 3.11; excluded for newer versions
6871
"astor >= 0.8.1",
6972
'carla >= 0.9.12; python_version <= "3.10" and (platform_system == "Linux" or platform_system == "Windows")',
7073
"dill",

src/scenic/simulators/metadrive/model.scenic

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Global Parameters:
2525
"""
2626
import pathlib
2727
from scenic.domains.driving.model import *
28+
from scenic.core.errors import InvalidScenarioError
2829

2930
from scenic.simulators.metadrive.simulator import MetaDriveSimulator
3031
from scenic.simulators.metadrive.actions import *

0 commit comments

Comments
 (0)