1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 absl-py,
7 mujoco,
8 pyparsing,
9 setuptools,
10 wheel,
11 dm-env,
12 dm-tree,
13 fsspec,
14 glfw,
15 h5py,
16 lxml,
17 mock,
18 nose,
19 nose-xunitmp,
20 numpy,
21 pillow,
22 protobuf,
23 pyopengl,
24 requests,
25 scipy,
26 tqdm,
27 etils,
28}:
29
30buildPythonPackage rec {
31 pname = "dm-control";
32 version = "1.0.20";
33 pyproject = true;
34
35 disabled = pythonOlder "3.8";
36
37 src = fetchFromGitHub {
38 owner = "google-deepmind";
39 repo = "dm_control";
40 rev = "refs/tags/${version}";
41 hash = "sha256-huXvfQz7E+OCqRrhLC5dUaG/A2PQXrPBzseIFx7ZIeE=";
42 };
43
44 build-system = [
45 absl-py
46 mujoco
47 pyparsing
48 setuptools
49 wheel
50 ];
51
52 pythonRemoveDeps = [
53 # Unpackaged
54 "labmaze"
55 ];
56
57 dependencies = [
58 absl-py
59 dm-env
60 dm-tree
61 fsspec
62 glfw
63 h5py
64 lxml
65 mock
66 mujoco
67 nose
68 nose-xunitmp
69 numpy
70 pillow
71 protobuf
72 pyopengl
73 pyparsing
74 requests
75 scipy
76 setuptools
77 tqdm
78 ] ++ etils.optional-dependencies.epath;
79
80 pythonImportsCheck = [ "dm_control" ];
81
82 # The installed library clashes with the `dm_control` directory remaining in the source path.
83 # Usually, we get around this by `rm -rf` the python source files to ensure that the installed package is used.
84 # Here, we cannot do that as it would also remove the tests which are also in the `dm_control` directory.
85 # See https://github.com/google-deepmind/dm_control/issues/6
86 doCheck = false;
87
88 meta = {
89 changelog = "https://github.com/google-deepmind/dm_control/releases/tag/${version}";
90 description = "Google DeepMind's software stack for physics-based simulation and Reinforcement Learning environments, using MuJoCo";
91 homepage = "https://github.com/google-deepmind/dm_control";
92 license = lib.licenses.asl20;
93 maintainers = with lib.maintainers; [ GaetanLepage ];
94 };
95}