diff --git a/pkgs/development/python-modules/pymanopt/default.nix b/pkgs/development/python-modules/pymanopt/default.nix index 20cac6031746..de1408d95b39 100644 --- a/pkgs/development/python-modules/pymanopt/default.nix +++ b/pkgs/development/python-modules/pymanopt/default.nix @@ -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 ]; };