17 buildPythonPackage rec {
22 src = fetchFromGitHub {
25 rev = "refs/tags/v${version}";
26 hash = "sha256-+6job9fEHVguh9JBE/NUv+QezwQohuKPO8DlhbaawZ4=";
27 # Since this upstream patch (https://github.com/jax-ml/ml_dtypes/commit/1bfd097e794413b0d465fa34f2eff0f3828ff521),
28 # the attempts to use the nixpkgs packaged eigen dependency have failed.
29 # Hence, we rely on the bundled eigen library.
30 fetchSubmodules = true;
34 substituteInPlace pyproject.toml \
35 --replace-fail "numpy~=2.0" "numpy" \
36 --replace-fail "setuptools~=73.0.1" "setuptools"
39 build-system = [ setuptools ];
41 dependencies = [ numpy ];
49 # remove src module, so tests use the installed module instead
50 mv ./ml_dtypes/tests ./tests
54 pythonImportsCheck = [ "ml_dtypes" ];
57 description = "Stand-alone implementation of several NumPy dtype extensions used in machine learning libraries";
58 homepage = "https://github.com/jax-ml/ml_dtypes";
59 changelog = "https://github.com/jax-ml/ml_dtypes/releases/tag/v${version}";
60 license = lib.licenses.asl20;
61 maintainers = with lib.maintainers; [