From 4915d1cb8aa1107e4a42de9f2905c6951511fbac Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 10 Jul 2024 12:05:41 +0200 Subject: [PATCH] python312Packages.lineax: init at 0.0.6 --- .../python-modules/lineax/default.nix | 66 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 68 insertions(+) create mode 100644 pkgs/development/python-modules/lineax/default.nix diff --git a/pkgs/development/python-modules/lineax/default.nix b/pkgs/development/python-modules/lineax/default.nix new file mode 100644 index 000000000000000..8f547bc1d9d76e1 --- /dev/null +++ b/pkgs/development/python-modules/lineax/default.nix @@ -0,0 +1,66 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + hatchling, + + # dependencies + equinox, + jax, + jaxtyping, + typing-extensions, + + # tests + beartype, + pytest, + python, +}: + +buildPythonPackage rec { + pname = "lineax"; + version = "0.0.6"; + pyproject = true; + + src = fetchFromGitHub { + owner = "patrick-kidger"; + repo = "lineax"; + rev = "refs/tags/v${version}"; + hash = "sha256-rM3H+q75F98eEIJkEszWgxD5C5vGK5RlYtVv8GD/VC0="; + }; + + build-system = [ hatchling ]; + + dependencies = [ + equinox + jax + jaxtyping + typing-extensions + ]; + + pythonImportsCheck = [ "lineax" ]; + + nativeCheckInputs = [ + beartype + pytest + ]; + + # Intentionaly not using pytest directly as it leads to JAX out-of-memory'ing + # https://github.com/patrick-kidger/lineax/blob/1909d190c1963d5f2d991508c1b2714f2266048b/tests/README.md + checkPhase = '' + runHook preCheck + + ${python.interpreter} -m tests + + runHook postCheck + ''; + + meta = { + description = "Linear solvers in JAX and Equinox"; + homepage = "https://github.com/patrick-kidger/lineax"; + changelog = "https://github.com/patrick-kidger/lineax/releases/tag/v${version}"; + 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 0938e8a343018e1..7168fe5f4d0addb 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7226,6 +7226,8 @@ self: super: with self; { linear-operator = callPackage ../development/python-modules/linear-operator { }; + lineax = callPackage ../development/python-modules/lineax { }; + linecache2 = callPackage ../development/python-modules/linecache2 { }; lineedit = callPackage ../development/python-modules/lineedit { };