about summary refs log tree commit diff
path: root/pkgs/development/python-modules/minari/default.nix
blob: dd6373a58c56a38fcc79f0a269e4b3be1c0bbd5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
{
  lib,
  buildPythonPackage,
  pythonOlder,
  fetchFromGitHub,

  # build-system
  setuptools,

  # dependencies
  gymnasium,
  numpy,
  packaging,
  typer,
  typing-extensions,

  # optional-dependencies
  pyarrow,
  jax,
  google-cloud-storage,
  tqdm,
  h5py,
  mktestdocs,
  pytest,

  # tests
  jaxlib,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "minari";
  version = "0.5.0";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "Farama-Foundation";
    repo = "Minari";
    rev = "refs/tags/v${version}";
    hash = "sha256-SVt93d0GbCxeZXhh5vMPvnsBAeJAfGWNceFi0W9RgeM=";
  };

  build-system = [
    setuptools
  ];

  dependencies = [
    gymnasium
    numpy
    packaging
    typer
    typing-extensions
  ];

  optional-dependencies = {
    arrow = [ pyarrow ];
    create = [ jax ];
    gcs = [
      google-cloud-storage
      tqdm
    ];
    hdf5 = [ h5py ];
    testing = [
      # gymnasium-robotics
      mktestdocs
      pytest
    ];
  };

  pythonImportsCheck = [ "minari" ];

  nativeCheckInputs = [
    jaxlib
    pytestCheckHook
  ] ++ lib.flatten (lib.attrValues optional-dependencies);

  disabledTests = [
    # Require internet access
    "test_download_namespace_dataset"
    "test_download_namespace_metadata"
    "test_markdown"

    # Attempts at installing minari using pip (impossible in the sandbox)
    "test_readme"
  ];

  disabledTestPaths = [
    # Require internet access
    "tests/dataset/test_dataset_download.py"
    "tests/test_cli.py"
  ];

  meta = {
    description = "Standard format for offline reinforcement learning datasets, with popular reference datasets and related utilities";
    homepage = "https://github.com/Farama-Foundation/Minari";
    changelog = "https://github.com/Farama-Foundation/Minari/releases/tag/v${version}";
    license = with lib.licenses; [
      asl20
      mit
    ];
    maintainers = with lib.maintainers; [ GaetanLepage ];
    mainProgram = "minari";
  };
}