about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pymanopt/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pymanopt/default.nix')
-rw-r--r--pkgs/development/python-modules/pymanopt/default.nix55
1 files changed, 37 insertions, 18 deletions
diff --git a/pkgs/development/python-modules/pymanopt/default.nix b/pkgs/development/python-modules/pymanopt/default.nix
index d6fbdacf4650..0172ecc6540d 100644
--- a/pkgs/development/python-modules/pymanopt/default.nix
+++ b/pkgs/development/python-modules/pymanopt/default.nix
@@ -1,39 +1,59 @@
-{ lib
-, fetchFromGitHub
-, buildPythonPackage
-, numpy
-, scipy
-, torch
-, autograd
-, matplotlib
-, pytestCheckHook
+{
+  lib,
+  fetchFromGitHub,
+  buildPythonPackage,
+  numpy,
+  scipy,
+  torch,
+  autograd,
+  matplotlib,
+  pytestCheckHook,
+  setuptools-scm,
 }:
 
 buildPythonPackage rec {
   pname = "pymanopt";
-  version = "2.2.0";
-  format = "setuptools";
+  version = "2.2.0-unstable-2024-07-10";
+  pyproject = true;
+
+  env.SETUPTOOLS_SCM_PRETEND_VERSION = "2.2.0";
 
   src = fetchFromGitHub {
     owner = pname;
     repo = pname;
-    rev = "refs/tags/${version}";
-    hash = "sha256-pDFRYhswcuAHG9pcqvzXIy3Ivhxe5R5Ric7AFRh7MK4=";
+    rev = "1de3b6f47258820fdc072fceaeaa763b9fd263b0";
+    hash = "sha256-j/fVeMgoLLBgRYFtSj2ZyNJb8iuWlnn2/YpBqUoCAFk=";
   };
 
-  propagatedBuildInputs = [ numpy scipy torch ];
-  nativeCheckInputs = [ autograd matplotlib pytestCheckHook ];
+  preConfigure = ''
+    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 "import tensorflow as tf" ""
+      --replace-fail "import tensorflow as tf" ""
     substituteInPlace "tests/conftest.py" \
-      --replace "tf.random.set_seed(seed)" ""
+      --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"
   ];
 
@@ -44,6 +64,5 @@ buildPythonPackage rec {
     homepage = "https://www.pymanopt.org/";
     license = lib.licenses.bsd3;
     maintainers = with lib.maintainers; [ yl3dy ];
-    broken = lib.versionAtLeast scipy.version "1.10.0";
   };
 }