1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, setuptools
5, numpy
6, cloudpickle
7, gym-notices
8, jax-jumpy
9, typing-extensions
10, farama-notifications
11, importlib-metadata
12, pythonOlder
13, ffmpeg
14, jax
15, jaxlib
16, matplotlib
17, moviepy
18, opencv4
19, pybox2d
20, pygame
21, pytestCheckHook
22, scipy
23}:
24
25buildPythonPackage rec {
26 pname = "gymnasium";
27 version = "0.29.1";
28 format = "pyproject";
29
30 src = fetchFromGitHub {
31 owner = "Farama-Foundation";
32 repo = "gymnasium";
33 rev = "refs/tags/v${version}";
34 hash = "sha256-L7fn9FaJzXwQhjDKwI9hlFpbPuQdwynU+Xjd8bbjxiw=";
35 };
36
37 nativeBuildInputs = [ setuptools ];
38
39 propagatedBuildInputs = [
40 cloudpickle
41 farama-notifications
42 gym-notices
43 jax-jumpy
44 numpy
45 typing-extensions
46 ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
47
48 pythonImportsCheck = [ "gymnasium" ];
49
50 nativeCheckInputs = [
51 ffmpeg
52 jax
53 jaxlib
54 matplotlib
55 moviepy
56 opencv4
57 pybox2d
58 pygame
59 pytestCheckHook
60 scipy
61 ];
62
63 disabledTestPaths = [
64 # mujoco is required for those tests but the mujoco python bindings are not packaged in nixpkgs.
65 "tests/envs/mujoco/test_mujoco_custom_env.py"
66
67 # Those tests need to write on the filesystem which cause them to fail.
68 "tests/experimental/wrappers/test_record_video.py"
69 "tests/utils/test_save_video.py"
70 "tests/wrappers/test_record_video.py"
71 "tests/wrappers/test_video_recorder.py"
72 ];
73
74 meta = with lib; {
75 description = "A standard API for reinforcement learning and a diverse set of reference environments (formerly Gym)";
76 homepage = "https://github.com/Farama-Foundation/Gymnasium";
77 license = licenses.mit;
78 maintainers = with maintainers; [ GaetanLepage ];
79 };
80}