diff --git a/pkgs/development/python-modules/sparsediffpy/default.nix b/pkgs/development/python-modules/sparsediffpy/default.nix new file mode 100644 index 000000000000..5b84d329f292 --- /dev/null +++ b/pkgs/development/python-modules/sparsediffpy/default.nix @@ -0,0 +1,59 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + cmake, + ninja, + numpy, + scikit-build-core, + + # buildInputs + blas, +}: + +buildPythonPackage (finalAttrs: { + pname = "sparsediffpy"; + version = "0.3.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "SparseDifferentiation"; + repo = "SparseDiffPy"; + tag = "v${finalAttrs.version}"; + # SparseDiffEngine is built from source and their cmake does not support finding it on the + # system. We fallback to using the git submodule approach for now. + fetchSubmodules = true; + hash = "sha256-4FiObnGIJSSH7BMkKS7y7rc4HYzDgMV7ym+wPZ/KHJ8="; + }; + + build-system = [ + cmake + ninja + numpy + scikit-build-core + ]; + dontUseCmakeConfigure = true; + + buildInputs = [ + blas + ]; + + dependencies = [ + numpy + ]; + + pythonImportsCheck = [ "sparsediffpy" ]; + + # No tests + doCheck = false; + + meta = { + description = "Python bindings for SparseDiffEngine, a C library for computing sparse Jacobians and Hessians"; + homepage = "https://github.com/SparseDifferentiation/SparseDiffPy"; + changelog = "https://github.com/SparseDifferentiation/SparseDiffPy/blob/${finalAttrs.src.tag}/RELEASES.md"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 569e979191bc..00be0656f960 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -18323,6 +18323,8 @@ self: super: with self; { sparse = callPackage ../development/python-modules/sparse { }; + sparsediffpy = callPackage ../development/python-modules/sparsediffpy { }; + spatial-image = callPackage ../development/python-modules/spatial-image { }; spatialmath-python = callPackage ../development/python-modules/spatialmath-python { };