33 buildPythonPackage rec {
39 src = fetchFromGitHub {
40 owner = "Farama-Foundation";
42 rev = "refs/tags/v${version}";
43 hash = "sha256-Qchuz08yJ0giVrtKLC9vBgr28JrHQyAOCuoS239ivVw=";
46 build-system = [ setuptools ];
53 ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
55 pythonImportsCheck = [ "gymnasium" ];
72 # if `doCheck = true` on Darwin, `jaxlib` is evaluated, which is both
73 # marked as broken and throws an error during evaluation if the package is evaluated anyway.
74 # disabling checks on Darwin avoids this and allows the package to be built.
75 # if jaxlib is ever fixed on Darwin, remove this.
76 doCheck = !stdenv.hostPlatform.isDarwin;
79 # Unpackaged `mujoco-py` (Openai's mujoco) is required for these tests.
80 "tests/envs/mujoco/test_mujoco_custom_env.py"
81 "tests/envs/mujoco/test_mujoco_rendering.py"
82 "tests/envs/mujoco/test_mujoco_v5.py"
84 # Rendering tests failing in the sandbox
85 "tests/wrappers/vector/test_human_rendering.py"
87 # These tests need to write on the filesystem which cause them to fail.
88 "tests/utils/test_save_video.py"
89 "tests/wrappers/test_record_video.py"
93 # Succeeds for most environments but `test_render_modes[Reacher-v4]` fails because it requires
94 # OpenGL access which is not possible inside the sandbox.
99 description = "Standard API for reinforcement learning and a diverse set of reference environments (formerly Gym)";
100 homepage = "https://github.com/Farama-Foundation/Gymnasium";
101 changelog = "https://github.com/Farama-Foundation/Gymnasium/releases/tag/v${version}";
102 license = lib.licenses.mit;
103 maintainers = with lib.maintainers; [ GaetanLepage ];