Something went wrong. Try again.
Nix Packages collection & NixOS github.com/NixOS/nixpkgs
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126{ lib, stdenv, config, buildPythonPackage, fetchFromGitHub,
# build-system cmake, ninja, nanobind, scikit-build-core, # linux-only jax,
# buildInputs SDL2, opencv, zlib,
# nativeBuildInputs cudaPackages,
# dependencies numpy,
# tests chex, gymnasium, pytestCheckHook,}:
buildPythonPackage (finalAttrs: { pname = "ale-py"; version = "0.12.1"; pyproject = true; __structuredAttrs = true;
src = fetchFromGitHub { owner = "Farama-Foundation"; repo = "Arcade-Learning-Environment"; tag = "v${finalAttrs.version}"; hash = "sha256-1oIF45+GZFWuRzXR5Hqh60yc1DZYAlXpsGgf3WiouQE="; };
# disable lto on darwin, cmake cannot find llvm-ar postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' substituteInPlace src/ale/CMakeLists.txt \ --replace-fail \ 'set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)' \ 'set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)' '';
build-system = [ cmake ninja scikit-build-core nanobind ] ++ lib.optionals stdenv.hostPlatform.isLinux [ jax ];
nativeBuildInputs = lib.optionals config.cudaSupport [ # Required by opencv's cmake cudaPackages.cuda_nvcc ];
dontUseCmakeConfigure = true;
buildInputs = [ SDL2 zlib opencv ];
dependencies = [ numpy ];
pythonImportsCheck = [ "ale_py" ];
nativeCheckInputs = [ chex gymnasium pytestCheckHook ];
disabledTests = [ # Fatal Python error: Aborted # line 414 in test_display_screen "test_display_screen"
# Most Atari tests fail because the ROM are missing. # The user is expected to manually download the roms: # https://github.com/Farama-Foundation/Arcade-Learning-Environment/blob/v0.9.0/docs/faq.md#i-downloaded-ale-and-i-installed-it-successfully-but-i-cannot-find-any-rom-file-at-roms-do-i-have-to-get-them-somewhere-else "TestVectorEnv" "test_check_env" "test_clone_pickle_restore_new_env" "test_clone_restore" "test_continuous_actions" "test_determinism" "test_gym_keys_to_action" "test_jit" "test_obs_params" "test_reset_step_shapes" "test_rollout_consistency" "test_seeding" "test_sound_obs" "test_state_serialize_roundtrip" ];
disabledTestPaths = [ "tests/python/test_atari_vector_xla.py" ];
meta = { description = "Simple framework that allows researchers and hobbyists to develop AI agents for Atari 2600 games"; mainProgram = "ale-import-roms"; homepage = "https://github.com/mgbellemare/Arcade-Learning-Environment"; changelog = "https://github.com/Farama-Foundation/Arcade-Learning-Environment/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.gpl2; maintainers = with lib.maintainers; [ billhuang ]; };})