Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at gcc-offload 105 lines 2.5 kB view raw
1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchFromGitHub, 6 7 # build-system 8 setuptools, 9 10 # dependencies 11 cloudpickle, 12 farama-notifications, 13 numpy, 14 typing-extensions, 15 pythonOlder, 16 importlib-metadata, 17 18 # tests 19 dill, 20 flax, 21 jax, 22 jaxlib, 23 matplotlib, 24 mujoco, 25 moviepy, 26 opencv4, 27 pybox2d, 28 pygame, 29 pytestCheckHook, 30 scipy, 31}: 32 33buildPythonPackage rec { 34 pname = "gymnasium"; 35 version = "1.0.0"; 36 37 pyproject = true; 38 39 src = fetchFromGitHub { 40 owner = "Farama-Foundation"; 41 repo = "gymnasium"; 42 rev = "refs/tags/v${version}"; 43 hash = "sha256-Qchuz08yJ0giVrtKLC9vBgr28JrHQyAOCuoS239ivVw="; 44 }; 45 46 build-system = [ setuptools ]; 47 48 dependencies = [ 49 cloudpickle 50 farama-notifications 51 numpy 52 typing-extensions 53 ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; 54 55 pythonImportsCheck = [ "gymnasium" ]; 56 57 nativeCheckInputs = [ 58 dill 59 flax 60 jax 61 jaxlib 62 matplotlib 63 moviepy 64 mujoco 65 opencv4 66 pybox2d 67 pygame 68 pytestCheckHook 69 scipy 70 ]; 71 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; 77 78 disabledTestPaths = [ 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" 83 84 # Rendering tests failing in the sandbox 85 "tests/wrappers/vector/test_human_rendering.py" 86 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" 90 ]; 91 92 disabledTests = [ 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. 95 "test_render_mode" 96 ]; 97 98 meta = { 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 ]; 104 }; 105}