1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 gymnasium,
11 numpy,
12 packaging,
13 typer,
14 typing-extensions,
15
16 # optional-dependencies
17 pyarrow,
18 jax,
19 google-cloud-storage,
20 tqdm,
21 h5py,
22 huggingface-hub,
23 mktestdocs,
24 pytest,
25 scikit-image,
26
27 # tests
28 jaxlib,
29 pytestCheckHook,
30}:
31
32buildPythonPackage rec {
33 pname = "minari";
34 version = "0.5.3";
35 pyproject = true;
36
37 src = fetchFromGitHub {
38 owner = "Farama-Foundation";
39 repo = "Minari";
40 tag = "v${version}";
41 hash = "sha256-LvJwp2dZdGPazJPWQtrk+v7zaPjOlomBu5j9avVdCcA=";
42 };
43
44 build-system = [
45 setuptools
46 ];
47
48 dependencies = [
49 gymnasium
50 numpy
51 packaging
52 typer
53 typing-extensions
54 ];
55
56 optional-dependencies = {
57 arrow = [ pyarrow ];
58 create = [ jax ];
59 gcs = [
60 google-cloud-storage
61 tqdm
62 ];
63 hdf5 = [ h5py ];
64 hf = [ huggingface-hub ];
65 integrations = [
66 # agilerl
67 # d3rlpy
68 ];
69 testing = [
70 # gymnasium-robotics
71 mktestdocs
72 pytest
73 scikit-image
74 ];
75 };
76
77 pythonImportsCheck = [ "minari" ];
78
79 nativeCheckInputs = [
80 jaxlib
81 pytestCheckHook
82 ]
83 ++ lib.flatten (lib.attrValues optional-dependencies);
84
85 disabledTests = [
86 # Require internet access
87 "test_download_namespace_dataset"
88 "test_download_namespace_metadata"
89 "test_markdown"
90
91 # Attempts at installing minari using pip (impossible in the sandbox)
92 "test_readme"
93 ];
94
95 disabledTestPaths = [
96 # Require internet access
97 "tests/dataset/test_dataset_download.py"
98 "tests/test_cli.py"
99 ];
100
101 meta = {
102 description = "Standard format for offline reinforcement learning datasets, with popular reference datasets and related utilities";
103 homepage = "https://github.com/Farama-Foundation/Minari";
104 changelog = "https://github.com/Farama-Foundation/Minari/releases/tag/v${version}";
105 license = with lib.licenses; [
106 asl20
107 mit
108 ];
109 maintainers = with lib.maintainers; [ GaetanLepage ];
110 mainProgram = "minari";
111 };
112}