depot/third_party/nixpkgs/pkgs/development/python-modules/pymanopt/default.nix
Default email 9c6ee729d6 Project import generated by Copybara.
GitOrigin-RevId: 6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222
2023-07-15 19:15:38 +02:00

49 lines
1.2 KiB
Nix

{ lib
, fetchFromGitHub
, buildPythonPackage
, numpy
, scipy
, torch
, autograd
, matplotlib
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "pymanopt";
version = "2.1.1";
format = "setuptools";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-nbSxqMmYWi71s74bbB9LAlPKEslTqG/j266cLfNHrwg=";
};
propagatedBuildInputs = [ numpy scipy torch ];
nativeCheckInputs = [ autograd matplotlib pytestCheckHook ];
preCheck = ''
substituteInPlace "tests/conftest.py" \
--replace "import tensorflow as tf" ""
substituteInPlace "tests/conftest.py" \
--replace "tf.random.set_seed(seed)" ""
'';
disabledTestPaths = [
"tests/test_examples.py"
"tests/backends/test_tensorflow.py"
"tests/test_problem.py"
];
pythonImportsCheck = [ "pymanopt" ];
meta = {
description = "Python toolbox for optimization on Riemannian manifolds with support for automatic differentiation";
homepage = "https://www.pymanopt.org/";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ yl3dy ];
broken = lib.versionAtLeast scipy.version "1.10.0";
};
}