mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 21:03:15 +00:00
python312Packages.pot: migrate to optional-dependencies
This commit is contained in:
parent
3e5e84c829
commit
98b89f97cb
@ -3,9 +3,10 @@
|
||||
autograd,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
cupy,
|
||||
cvxopt,
|
||||
cython,
|
||||
jax,
|
||||
jaxlib,
|
||||
matplotlib,
|
||||
numpy,
|
||||
pymanopt,
|
||||
@ -14,8 +15,8 @@
|
||||
scikit-learn,
|
||||
scipy,
|
||||
setuptools,
|
||||
enableDimensionalityReduction ? false,
|
||||
enableGPU ? false,
|
||||
tensorflow,
|
||||
torch,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
@ -38,24 +39,47 @@ buildPythonPackage rec {
|
||||
numpy
|
||||
];
|
||||
|
||||
dependencies =
|
||||
[
|
||||
dependencies = [
|
||||
numpy
|
||||
scipy
|
||||
]
|
||||
++ lib.optionals enableGPU [ cupy ]
|
||||
++ lib.optionals enableDimensionalityReduction [
|
||||
autograd
|
||||
pymanopt
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
cvxopt
|
||||
matplotlib
|
||||
numpy
|
||||
scikit-learn
|
||||
pytestCheckHook
|
||||
optional-dependencies = {
|
||||
backend-numpy = [ ];
|
||||
backend-jax = [
|
||||
jax
|
||||
jaxlib
|
||||
];
|
||||
backend-cupy = [ ];
|
||||
backend-tf = [ tensorflow ];
|
||||
backend-torch = [ torch ];
|
||||
cvxopt = [ cvxopt ];
|
||||
dr = [
|
||||
scikit-learn
|
||||
pymanopt
|
||||
autograd
|
||||
];
|
||||
gnn = [
|
||||
torch
|
||||
# torch-geometric
|
||||
];
|
||||
plot = [ matplotlib ];
|
||||
all =
|
||||
with optional-dependencies;
|
||||
(
|
||||
backend-numpy
|
||||
++ backend-jax
|
||||
++ backend-cupy
|
||||
++ backend-tf
|
||||
++ backend-torch
|
||||
++ optional-dependencies.cvxopt
|
||||
++ dr
|
||||
++ gnn
|
||||
++ plot
|
||||
);
|
||||
};
|
||||
|
||||
nativeCheckInputs = [ pytestCheckHook ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace setup.cfg \
|
||||
@ -108,8 +132,6 @@ buildPythonPackage rec {
|
||||
"test_emd1d_device_tf"
|
||||
];
|
||||
|
||||
disabledTestPaths = lib.optionals (!enableDimensionalityReduction) [ "test/test_dr.py" ];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"ot"
|
||||
"ot.lp"
|
||||
|
Loading…
Reference in New Issue
Block a user