From 34be09559cd0d55d5a6b91c0581cb72393551b5f Mon Sep 17 00:00:00 2001
From: "R. Ryantm" <ryantm-bot@ryantm.com>
Date: Fri, 27 Sep 2024 02:43:09 +0000
Subject: [PATCH 1/3] python312Packages.sasmodels: 1.0.7 -> 1.0.8

---
 pkgs/development/python-modules/sasmodels/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkgs/development/python-modules/sasmodels/default.nix b/pkgs/development/python-modules/sasmodels/default.nix
index 0f044c6e28b5..2b27dd862da0 100644
--- a/pkgs/development/python-modules/sasmodels/default.nix
+++ b/pkgs/development/python-modules/sasmodels/default.nix
@@ -14,7 +14,7 @@
 
 buildPythonPackage rec {
   pname = "sasmodels";
-  version = "1.0.7";
+  version = "1.0.8";
   format = "setuptools";
 
   disabled = pythonOlder "3.7";
@@ -23,7 +23,7 @@ buildPythonPackage rec {
     owner = "SasView";
     repo = "sasmodels";
     rev = "refs/tags/v${version}";
-    hash = "sha256-GZQYVvQ4bEBizTmJ+o5fIfGr8gn2/4uD3PxIswEjzSE=";
+    hash = "sha256-fa6/13z11AuTRItZOEmTbjpU1aT6Ur7evi6UvVvXQck=";
   };
 
   buildInputs = [ opencl-headers ];

From 7d1fd25075c2095daebed0d566d3ea2298b3759e Mon Sep 17 00:00:00 2001
From: natsukium <tomoya.otabi@gmail.com>
Date: Sun, 29 Sep 2024 11:29:38 +0900
Subject: [PATCH 2/3] python312Packages.sasmodels: switch to pypa builder

---
 pkgs/development/python-modules/sasmodels/default.nix | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/pkgs/development/python-modules/sasmodels/default.nix b/pkgs/development/python-modules/sasmodels/default.nix
index 2b27dd862da0..cfde1753b645 100644
--- a/pkgs/development/python-modules/sasmodels/default.nix
+++ b/pkgs/development/python-modules/sasmodels/default.nix
@@ -2,6 +2,7 @@
   lib,
   fetchFromGitHub,
   buildPythonPackage,
+  setuptools,
   pytest,
   numpy,
   scipy,
@@ -15,7 +16,7 @@
 buildPythonPackage rec {
   pname = "sasmodels";
   version = "1.0.8";
-  format = "setuptools";
+  pyproject = true;
 
   disabled = pythonOlder "3.7";
 
@@ -26,9 +27,11 @@ buildPythonPackage rec {
     hash = "sha256-fa6/13z11AuTRItZOEmTbjpU1aT6Ur7evi6UvVvXQck=";
   };
 
+  build-system = [ setuptools ];
+
   buildInputs = [ opencl-headers ];
 
-  propagatedBuildInputs = [
+  dependencies = [
     docutils
     matplotlib
     numpy

From 4a9f452e171c379c4225af6186d80574a1dba98a Mon Sep 17 00:00:00 2001
From: natsukium <tomoya.otabi@gmail.com>
Date: Sun, 29 Sep 2024 11:35:05 +0900
Subject: [PATCH 3/3] python312Packages.sasmodels: refactor inputs

---
 .../python-modules/sasmodels/default.nix      | 31 ++++++++++++-------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/pkgs/development/python-modules/sasmodels/default.nix b/pkgs/development/python-modules/sasmodels/default.nix
index cfde1753b645..5443545d5af5 100644
--- a/pkgs/development/python-modules/sasmodels/default.nix
+++ b/pkgs/development/python-modules/sasmodels/default.nix
@@ -3,13 +3,15 @@
   fetchFromGitHub,
   buildPythonPackage,
   setuptools,
-  pytest,
+  pytestCheckHook,
   numpy,
   scipy,
-  matplotlib,
+  bumps,
   docutils,
-  pyopencl,
+  matplotlib,
   opencl-headers,
+  pycuda,
+  pyopencl,
   pythonOlder,
 }:
 
@@ -32,19 +34,26 @@ buildPythonPackage rec {
   buildInputs = [ opencl-headers ];
 
   dependencies = [
-    docutils
-    matplotlib
     numpy
     scipy
-    pyopencl
   ];
 
-  # Note: the 1.0.5 release should be compatible with pytest6, so this can
-  # be set back to 'pytest' at that point
-  nativeCheckInputs = [ pytest ];
+  optional-dependencies = {
+    full = [
+      docutils
+      bumps
+      matplotlib
+      # columnize
+    ];
+    server = [ bumps ];
+    opencl = [ pyopencl ];
+    cuda = [ pycuda ];
+  };
 
-  checkPhase = ''
-    HOME=$(mktemp -d) py.test -c ./pytest.ini
+  nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.full;
+
+  preCheck = ''
+    export HOME=$TMPDIR
   '';
 
   pythonImportsCheck = [ "sasmodels" ];