2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
2024-10-29 11:11:06 +00:00
|
|
|
stdenv,
|
2024-06-05 15:53:02 +00:00
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2024-10-29 11:11:06 +00:00
|
|
|
|
|
|
|
# build-system
|
2024-06-05 15:53:02 +00:00
|
|
|
setuptools,
|
2024-10-29 11:11:06 +00:00
|
|
|
|
|
|
|
# dependencies
|
2024-06-05 15:53:02 +00:00
|
|
|
cloudpickle,
|
|
|
|
farama-notifications,
|
2024-10-29 11:11:06 +00:00
|
|
|
numpy,
|
|
|
|
typing-extensions,
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonOlder,
|
2024-10-29 11:11:06 +00:00
|
|
|
importlib-metadata,
|
|
|
|
|
|
|
|
# tests
|
|
|
|
dill,
|
|
|
|
flax,
|
2024-06-05 15:53:02 +00:00
|
|
|
jax,
|
|
|
|
jaxlib,
|
|
|
|
matplotlib,
|
2024-10-29 11:11:06 +00:00
|
|
|
mujoco,
|
2024-06-05 15:53:02 +00:00
|
|
|
moviepy,
|
|
|
|
opencv4,
|
|
|
|
pybox2d,
|
|
|
|
pygame,
|
|
|
|
pytestCheckHook,
|
|
|
|
scipy,
|
2023-03-30 22:05:00 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "gymnasium";
|
2024-10-29 11:11:06 +00:00
|
|
|
version = "1.0.0";
|
|
|
|
|
|
|
|
pyproject = true;
|
2023-03-30 22:05:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Farama-Foundation";
|
2023-10-09 19:29:22 +00:00
|
|
|
repo = "gymnasium";
|
2023-08-04 22:07:22 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-10-29 11:11:06 +00:00
|
|
|
hash = "sha256-Qchuz08yJ0giVrtKLC9vBgr28JrHQyAOCuoS239ivVw=";
|
2023-03-30 22:05:00 +00:00
|
|
|
};
|
|
|
|
|
2024-10-29 11:11:06 +00:00
|
|
|
build-system = [ setuptools ];
|
2023-03-30 22:05:00 +00:00
|
|
|
|
2024-10-29 11:11:06 +00:00
|
|
|
dependencies = [
|
2023-03-30 22:05:00 +00:00
|
|
|
cloudpickle
|
2023-10-09 19:29:22 +00:00
|
|
|
farama-notifications
|
|
|
|
numpy
|
2023-03-30 22:05:00 +00:00
|
|
|
typing-extensions
|
|
|
|
] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "gymnasium" ];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeCheckInputs = [
|
2024-10-29 11:11:06 +00:00
|
|
|
dill
|
|
|
|
flax
|
2023-10-09 19:29:22 +00:00
|
|
|
jax
|
|
|
|
jaxlib
|
|
|
|
matplotlib
|
|
|
|
moviepy
|
2024-10-29 11:11:06 +00:00
|
|
|
mujoco
|
2023-10-09 19:29:22 +00:00
|
|
|
opencv4
|
|
|
|
pybox2d
|
|
|
|
pygame
|
|
|
|
pytestCheckHook
|
|
|
|
scipy
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
# if `doCheck = true` on Darwin, `jaxlib` is evaluated, which is both
|
|
|
|
# marked as broken and throws an error during evaluation if the package is evaluated anyway.
|
|
|
|
# disabling checks on Darwin avoids this and allows the package to be built.
|
|
|
|
# if jaxlib is ever fixed on Darwin, remove this.
|
2024-09-26 11:04:55 +00:00
|
|
|
doCheck = !stdenv.hostPlatform.isDarwin;
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
disabledTestPaths = [
|
2024-10-29 11:11:06 +00:00
|
|
|
# Unpackaged `mujoco-py` (Openai's mujoco) is required for these tests.
|
2023-10-09 19:29:22 +00:00
|
|
|
"tests/envs/mujoco/test_mujoco_custom_env.py"
|
2024-10-29 11:11:06 +00:00
|
|
|
"tests/envs/mujoco/test_mujoco_rendering.py"
|
|
|
|
"tests/envs/mujoco/test_mujoco_v5.py"
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-10-29 11:11:06 +00:00
|
|
|
# Rendering tests failing in the sandbox
|
|
|
|
"tests/wrappers/vector/test_human_rendering.py"
|
|
|
|
|
|
|
|
# These tests need to write on the filesystem which cause them to fail.
|
2023-10-09 19:29:22 +00:00
|
|
|
"tests/utils/test_save_video.py"
|
|
|
|
"tests/wrappers/test_record_video.py"
|
|
|
|
];
|
|
|
|
|
2024-10-29 11:11:06 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Succeeds for most environments but `test_render_modes[Reacher-v4]` fails because it requires
|
|
|
|
# OpenGL access which is not possible inside the sandbox.
|
|
|
|
"test_render_mode"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Standard API for reinforcement learning and a diverse set of reference environments (formerly Gym)";
|
2023-03-30 22:05:00 +00:00
|
|
|
homepage = "https://github.com/Farama-Foundation/Gymnasium";
|
2024-10-29 11:11:06 +00:00
|
|
|
changelog = "https://github.com/Farama-Foundation/Gymnasium/releases/tag/v${version}";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ GaetanLepage ];
|
2023-03-30 22:05:00 +00:00
|
|
|
};
|
|
|
|
}
|