about summary refs log tree commit diff
path: root/pkgs/development/python-modules/atsim-potentials/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/atsim-potentials/default.nix')
-rw-r--r--pkgs/development/python-modules/atsim-potentials/default.nix55
1 files changed, 33 insertions, 22 deletions
diff --git a/pkgs/development/python-modules/atsim-potentials/default.nix b/pkgs/development/python-modules/atsim-potentials/default.nix
index b06ef867c21f8..f194c251d5d31 100644
--- a/pkgs/development/python-modules/atsim-potentials/default.nix
+++ b/pkgs/development/python-modules/atsim-potentials/default.nix
@@ -1,36 +1,36 @@
-{ lib
-, buildPythonPackage
-, fetchFromGitHub
-, configparser
-, pyparsing
-, pytestCheckHook
-, future
-, openpyxl
-, wrapt
-, scipy
-, cexprtk
-, deepdiff
-, sympy
+{
+  lib,
+  buildPythonPackage,
+  pythonAtLeast,
+  fetchFromGitHub,
+  setuptools,
+  configparser,
+  pyparsing,
+  pytestCheckHook,
+  future,
+  openpyxl,
+  wrapt,
+  scipy,
+  cexprtk,
+  deepdiff,
+  sympy,
 }:
 
 buildPythonPackage rec {
-  version = "0.4.1";
-  format = "setuptools";
   pname = "atsim-potentials";
+  version = "0.4.1";
+  pyproject = true;
 
   src = fetchFromGitHub {
     owner = "mjdrushton";
-    repo = pname;
+    repo = "atsim-potentials";
     rev = "refs/tags/${version}";
     hash = "sha256-G7lNqwEUwAT0f7M2nUTCxpXOAl6FWKlh7tcsvbur1eM=";
   };
 
-  postPatch = ''
-    # Remove conflicting openpyxl dependency version check
-    sed -i '/openpyxl==2.6.4/d' setup.py
-  '';
+  build-system = [ setuptools ];
 
-  propagatedBuildInputs = [
+  dependencies = [
     cexprtk
     configparser
     future
@@ -46,10 +46,21 @@ buildPythonPackage rec {
     pytestCheckHook
   ];
 
+  # these files try to import `distutils` removed in Python 3.12
+  disabledTestPaths = lib.optionals (pythonAtLeast "3.12") [
+    "tests/config/test_configuration_eam.py"
+    "tests/config/test_configuration_eam_fs.py"
+    "tests/config/test_configuration_pair.py"
+    "tests/test_dlpoly_writeTABEAM.py"
+    "tests/test_documentation_examples.py"
+    "tests/test_eam_adp_writer.py"
+    "tests/test_gulp_writer.py"
+    "tests/test_lammpsWriteEAM.py"
+  ];
+
   disabledTests = [
     # Missing lammps executable
     "eam_tabulate_example2TestCase"
-    "test_pymath"
   ];
 
   pythonImportsCheck = [ "atsim.potentials" ];