Add module level version dunder.
This commit is contained in:
@@ -79,3 +79,14 @@ if _MUJOCO_GL not in _MUJOCO_GL_DISABLE:
|
|||||||
from mujoco.egl import GLContext
|
from mujoco.egl import GLContext
|
||||||
else:
|
else:
|
||||||
from mujoco.glfw import GLContext
|
from mujoco.glfw import GLContext
|
||||||
|
|
||||||
|
|
||||||
|
def _get_version() -> str:
|
||||||
|
with open(os.path.join(HEADERS_DIR, 'mujoco.h'), 'r') as f:
|
||||||
|
for line in f:
|
||||||
|
if line.startswith('#define mjVERSION_HEADER'):
|
||||||
|
version = line.split()[2]
|
||||||
|
break
|
||||||
|
return '.'.join([d for d in str(version)])
|
||||||
|
|
||||||
|
__version__ = _get_version()
|
||||||
|
|||||||
Reference in New Issue
Block a user