1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 setuptools,
7 wheel,
8 gymnasium,
9 numpy,
10 ale-py,
11 bsuite,
12 dm-control,
13 gym,
14 imageio,
15 pettingzoo,
16 pytestCheckHook,
17}:
18
19buildPythonPackage rec {
20 pname = "shimmy";
21 version = "1.3.0";
22 pyproject = true;
23
24 disabled = pythonOlder "3.8";
25
26 src = fetchFromGitHub {
27 owner = "Farama-Foundation";
28 repo = "Shimmy";
29 rev = "refs/tags/v${version}";
30 hash = "sha256-rYBbGyMSFF/iIGruKn2JXKAVIZIfJDEHUEZUESiUg/k=";
31 };
32
33 build-system = [
34 setuptools
35 wheel
36 ];
37
38 dependencies = [
39 gymnasium
40 numpy
41 ];
42
43 pythonImportsCheck = [ "shimmy" ];
44
45 nativeCheckInputs = [
46 ale-py
47 bsuite
48 dm-control
49 gym
50 imageio
51 pettingzoo
52 pytestCheckHook
53 ];
54
55 disabledTestPaths = [
56 # Requires unpackaged labmaze
57 "tests/test_dm_control_multi_agent.py"
58
59 # Requires unpackaged pyspiel
60 "tests/test_openspiel.py"
61
62 # Broken since ale-py v0.9.0 due to API change
63 # https://github.com/Farama-Foundation/Shimmy/issues/120
64 "tests/test_atari.py"
65 ];
66
67 preCheck = ''
68 export HOME=$(mktemp -d)
69 '';
70
71 disabledTests = [
72 # Require network access
73 "test_check_env[bsuite/mnist_noise-v0]"
74 "test_check_env[bsuite/mnist_scale-v0]"
75 "test_check_env[bsuite/mnist-v0]"
76 "test_existing_env"
77 "test_loading_env"
78 "test_pickle[bsuite/mnist-v0]"
79 "test_seeding[bsuite/mnist_noise-v0]"
80 "test_seeding[bsuite/mnist_scale-v0]"
81 "test_seeding[bsuite/mnist-v0]"
82 "test_seeding"
83
84 # RuntimeError: std::exception
85 "test_check_env"
86 "test_seeding[dm_control/quadruped-escape-v0]"
87 "test_rendering_camera_id"
88 "test_rendering_multiple_cameras"
89 "test_rendering_depth"
90 "test_render_height_widths"
91 ];
92
93 meta = {
94 changelog = "https://github.com/Farama-Foundation/Shimmy/releases/tag/v${version}";
95 description = "API conversion tool for popular external reinforcement learning environments";
96 homepage = "https://github.com/Farama-Foundation/Shimmy";
97 license = lib.licenses.mit;
98 maintainers = with lib.maintainers; [ GaetanLepage ];
99 };
100}