python312Packages.pymanopt: cleanup, skip failing tests on darwin

This commit is contained in:
Gaetan Lepage
2025-03-18 10:08:27 +01:00
parent 662a5d130b
commit d602c8487a
@@ -1,14 +1,23 @@
{
lib,
stdenv,
fetchFromGitHub,
buildPythonPackage,
# build-system
setuptools-scm,
# dependencies
numpy,
scipy,
torch,
# tests
autograd,
jax,
matplotlib,
pytestCheckHook,
setuptools-scm,
tensorflow,
torch,
}:
buildPythonPackage rec {
@@ -24,42 +33,40 @@ buildPythonPackage rec {
};
preConfigure = ''
substituteInPlace pyproject.toml --replace-fail "\"pip==22.3.1\"," ""
substituteInPlace pyproject.toml \
--replace-fail '"pip==22.3.1",' ""
'';
build-system = [
setuptools-scm
];
dependencies = [
numpy
scipy
torch
];
nativeCheckInputs = [
autograd
matplotlib
pytestCheckHook
];
preCheck = ''
substituteInPlace "tests/conftest.py" \
--replace-fail "import tensorflow as tf" ""
substituteInPlace "tests/conftest.py" \
--replace-fail "tf.random.set_seed(seed)" ""
'';
disabledTestPaths = [
"tests/test_examples.py"
"tests/backends/test_tensorflow.py"
"tests/backends/test_jax.py"
"tests/test_problem.py"
];
pythonImportsCheck = [ "pymanopt" ];
nativeCheckInputs = [
autograd
jax
matplotlib
pytestCheckHook
tensorflow
torch
];
pytestFlagsArray = lib.optionals stdenv.hostPlatform.isDarwin [
# FloatingPointError: divide by zero encountered in det
"--deselect=tests/manifolds/test_positive_definite.py::TestMultiSpecialHermitianPositiveDefiniteManifold::test_retraction"
"--deselect=tests/manifolds/test_positive_definite.py::TestSingleSpecialHermitianPositiveDefiniteManifold::test_retraction"
];
meta = {
description = "Python toolbox for optimization on Riemannian manifolds with support for automatic differentiation";
homepage = "https://www.pymanopt.org/";
changelog = "https://github.com/pymanopt/pymanopt/releases/tag/${version}";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ yl3dy ];
};