python312Packages.safetensors: add optional-dependencies

This commit is contained in:
Gaetan Lepage
2025-04-07 01:07:11 +02:00
parent 68898dd709
commit 7a503ec0e2
@@ -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