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