File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
mjx/mujoco/mjx/third_party/mujoco_warp/_src Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change 1515
1616import dataclasses
1717import importlib .metadata
18- import re
1918import warnings
2019from typing import Any , Optional , Sequence
2120
2221import mujoco
2322import numpy as np
23+ import packaging .version
2424import warp as wp
2525
2626from mujoco .mjx .third_party .mujoco_warp ._src import bvh
3131
3232
3333def _is_mujoco_dev () -> bool :
34- _DEV_VERSION_PATTERN = re .compile (r"^\d+\.\d+\.\d+.+" ) # anything after x.y.z
35-
36- version = getattr (__import__ ("mujoco" ), "__version__" , None )
37- if version and _DEV_VERSION_PATTERN .match (version ):
38- return True
39-
40- # fall back to metadata
41- dist_version = importlib .metadata .version ("mujoco" )
42- if _DEV_VERSION_PATTERN .match (dist_version ):
43- return True
44-
45- return False
34+ """Checks if mujoco version is > 3.4.0."""
35+ version_str = getattr (mujoco , "__version__" , None )
36+ if not version_str :
37+ version_str = importlib .metadata .version ("mujoco" )
38+ version_str = version_str .split ("-" )[0 ].split (".dev" )[0 ]
39+ return packaging .version .parse (version_str ) > packaging .version .parse ("3.4.0" )
4640
4741
4842BLEEDING_EDGE_MUJOCO = _is_mujoco_dev ()
You can’t perform that action at this time.
0 commit comments