Unverified Commit 80c069a9 authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

python312Packages.safetensors: add optional-dependencies (#396682)

parents b569b627 7a503ec0
Loading
Loading
Loading
Loading
+48 −3
Original line number Diff line number Diff line
@@ -5,11 +5,23 @@
  fetchFromGitHub,
  rustPlatform,

  # tests
  h5py,
  # optional-dependencies
  numpy,
  pytestCheckHook,
  torch,
  tensorflow,
  flax,
  jax,
  mlx,
  paddlepaddle,
  h5py,
  huggingface-hub,
  setuptools-rust,
  pytest,
  pytest-benchmark,
  hypothesis,

  # tests
  pytestCheckHook,
}:

buildPythonPackage rec {
@@ -36,6 +48,39 @@ buildPythonPackage rec {
    rustPlatform.maturinBuildHook
  ];

  optional-dependencies = lib.fix (self: {
    numpy = [ numpy ];
    torch = self.numpy ++ [
      torch
    ];
    tensorflow = self.numpy ++ [
      tensorflow
    ];
    pinned-tf = self.numpy ++ [
      tensorflow
    ];
    jax = self.numpy ++ [
      flax
      jax
    ];
    mlx = [
      mlx
    ];
    paddlepaddle = self.numpy ++ [
      paddlepaddle
    ];
    testing = self.numpy ++ [
      h5py
      huggingface-hub
      setuptools-rust
      pytest
      pytest-benchmark
      hypothesis
    ];
    all = self.torch ++ self.numpy ++ self.pinned-tf ++ self.jax ++ self.paddlepaddle ++ self.testing;
    dev = self.all;
  });

  nativeCheckInputs = [
    h5py
    numpy