Unverified Commit f86695fb authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

Merge pull request #309980 from GaetanLepage/shimmy

python311Packages.shimmy: init at 1.3.0, python311Packages.dm-control: init at 1.0.19, python311Packages.noxe-xunitmp: init at 0.4.1
parents 82cd9ea4 7a77fae6
Loading
Loading
Loading
Loading
+98 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, absl-py
, mujoco
, pyparsing
, pythonRelaxDepsHook
, setuptools
, wheel
, dm-env
, dm-tree
, fsspec
, glfw
, h5py
, lxml
, mock
, nose
, nose-xunitmp
, numpy
, pillow
, protobuf
, pyopengl
, requests
, scipy
, tqdm
, etils
}:

buildPythonPackage rec {
  pname = "dm-control";
  version = "1.0.19";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "google-deepmind";
    repo = "dm_control";
    rev = "refs/tags/${version}";
    hash = "sha256-q9hY/icvc1tPI0xBYxExc2a+gv0i6utaB4GBnJwQPCw=";
  };

  build-system = [
    absl-py
    mujoco
    pyparsing
    pythonRelaxDepsHook
    setuptools
    wheel
  ];

  pythonRemoveDeps = [
    # Unpackaged
    "labmaze"
  ];

  dependencies = [
    absl-py
    dm-env
    dm-tree
    fsspec
    glfw
    h5py
    lxml
    mock
    mujoco
    nose
    nose-xunitmp
    numpy
    pillow
    protobuf
    pyopengl
    pyparsing
    requests
    scipy
    setuptools
    tqdm
  ] ++ etils.optional-dependencies.epath;

  pythonImportsCheck = [
    "dm_control"
  ];

  # The installed library clashes with the `dm_control` directory remaining in the source path.
  # Usually, we get around this by `rm -rf` the python source files to ensure that the installed package is used.
  # Here, we cannot do that as it would also remove the tests which are also in the `dm_control` directory.
  # See https://github.com/google-deepmind/dm_control/issues/6
  doCheck = false;

  meta = {
    changelog = "https://github.com/google-deepmind/dm_control/releases/tag/${version}";
    description = "Google DeepMind's software stack for physics-based simulation and Reinforcement Learning environments, using MuJoCo";
    homepage = "https://github.com/google-deepmind/dm_control";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ GaetanLepage ];
  };
}
+39 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchPypi
, setuptools
, wheel
, nose
}:

buildPythonPackage rec {
  pname = "nose-xunitmp";
  version = "0.4.1";
  pyproject = true;

  src = fetchPypi {
    pname = "nose_xunitmp";
    inherit version;
    hash = "sha256-wt9y9HYHUdMBU9Rzgiqr8afD1GL2ZKp/f9uNxibcfEA=";
  };

  build-system = [
    setuptools
    wheel
  ];

  dependencies = [
    nose
  ];

  pythonImportsCheck = [
    "nose_xunitmp"
  ];

  meta = {
    description = "Xunit output when running multiprocess tests using nose";
    homepage = "https://pypi.org/project/nose_xunitmp/";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ GaetanLepage ];
  };
}
+92 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, setuptools
, wheel
, gymnasium
, numpy
, ale-py
, bsuite
, dm-control
, gym
, imageio
, pettingzoo
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "shimmy";
  version = "1.3.0";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "Farama-Foundation";
    repo = "Shimmy";
    rev = "refs/tags/v${version}";
    hash = "sha256-rYBbGyMSFF/iIGruKn2JXKAVIZIfJDEHUEZUESiUg/k=";
  };

  build-system = [
    setuptools
    wheel
  ];

  dependencies = [
    gymnasium
    numpy
  ];

  pythonImportsCheck = [ "shimmy" ];

  nativeCheckInputs = [
    ale-py
    bsuite
    dm-control
    gym
    imageio
    pettingzoo
    pytestCheckHook
  ];

  disabledTestPaths = [
    # Requires unpackaged pyspiel
    "tests/test_openspiel.py"
  ];

  preCheck = ''
    export HOME=$(mktemp -d)
  '';

  disabledTests = [
    # Require network access
    "test_check_env[bsuite/mnist_noise-v0]"
    "test_check_env[bsuite/mnist_scale-v0]"
    "test_check_env[bsuite/mnist-v0]"
    "test_existing_env"
    "test_loading_env"
    "test_pickle[bsuite/mnist-v0]"
    "test_seeding[bsuite/mnist_noise-v0]"
    "test_seeding[bsuite/mnist_scale-v0]"
    "test_seeding[bsuite/mnist-v0]"
    "test_seeding"

    # RuntimeError: std::exception
    "test_check_env"
    "test_seeding[dm_control/quadruped-escape-v0]"
    "test_rendering_camera_id"
    "test_rendering_multiple_cameras"
    "test_rendering_depth"
    "test_render_height_widths"
  ];

  meta = {
    changelog = "https://github.com/Farama-Foundation/Shimmy/releases/tag/v${version}";
    description = "An API conversion tool for popular external reinforcement learning environments";
    homepage = "https://github.com/Farama-Foundation/Shimmy";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ GaetanLepage ];
  };
}
+6 −0
Original line number Diff line number Diff line
@@ -3420,6 +3420,8 @@ self: super: with self; {
  dmenu-python = callPackage ../development/python-modules/dmenu { };
  dm-control = callPackage ../development/python-modules/dm-control { };
  dm-env = callPackage ../development/python-modules/dm-env { };
  dm-haiku = callPackage ../development/python-modules/dm-haiku { };
@@ -8860,6 +8862,8 @@ self: super: with self; {
  nose-warnings-filters = callPackage ../development/python-modules/nose-warnings-filters { };
  nose-xunitmp = callPackage ../development/python-modules/nose-xunitmp { };
  nosexcover = callPackage ../development/python-modules/nosexcover { };
  notebook = callPackage ../development/python-modules/notebook { };
@@ -13837,6 +13841,8 @@ self: super: with self; {
    inherit (pkgs) cmake llvmPackages;
  });
  shimmy = callPackage ../development/python-modules/shimmy { };
  shippai = callPackage ../development/python-modules/shippai { };
  shiv = callPackage ../development/python-modules/shiv { };