Merge pull request #325184 from natsukium/pot/fix

python312Packages.pot: 0.9.3 -> 0.9.4 and fix
This commit is contained in:
OTABI Tomoya 2024-07-07 22:59:30 +09:00 committed by GitHub
commit 7708798859
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,25 +3,25 @@
autograd,
buildPythonPackage,
fetchFromGitHub,
cupy,
cvxopt,
cython,
oldest-supported-numpy,
jax,
jaxlib,
matplotlib,
numpy,
tensorflow,
pymanopt,
pytestCheckHook,
pythonOlder,
scikit-learn,
scipy,
enableDimensionalityReduction ? false,
enableGPU ? false,
setuptools,
tensorflow,
torch,
}:
buildPythonPackage rec {
pname = "pot";
version = "0.9.3";
version = "0.9.4";
pyproject = true;
disabled = pythonOlder "3.6";
@ -30,40 +30,66 @@ buildPythonPackage rec {
owner = "PythonOT";
repo = "POT";
rev = "refs/tags/${version}";
hash = "sha256-fdqDM0V6zTFe1lcqi53ZZNHAfmuR2I7fdX4SN9qeNn8=";
hash = "sha256-Yx9hjniXebn7ZZeqou0JEsn2Yf9hyJSu/acDlM4kCCI=";
};
nativeBuildInputs = [
build-system = [
setuptools
cython
oldest-supported-numpy
];
propagatedBuildInputs =
[
numpy
scipy
]
++ lib.optionals enableGPU [ cupy ]
++ lib.optionals enableDimensionalityReduction [
autograd
pymanopt
];
nativeCheckInputs = [
cvxopt
matplotlib
numpy
tensorflow
scikit-learn
pytestCheckHook
];
dependencies = [
numpy
scipy
];
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 \
--replace " --cov-report= --cov=ot" "" \
--replace " --durations=20" "" \
--replace " --junit-xml=junit-results.xml" ""
substituteInPlace pyproject.toml \
--replace-fail "numpy>=2.0.0" "numpy"
# we don't need setup.py to find the macos sdk for us
sed -i '/sdk_path/d' setup.py
'';
@ -106,8 +132,6 @@ buildPythonPackage rec {
"test_emd1d_device_tf"
];
disabledTestPaths = lib.optionals (!enableDimensionalityReduction) [ "test/test_dr.py" ];
pythonImportsCheck = [
"ot"
"ot.lp"