11 buildPythonPackage rec {
16 disabled = pythonOlder "3.9";
18 src = fetchFromGitHub {
21 rev = "refs/tags/v${version}";
22 hash = "sha256-epWunA5FULmCuTABl3uckFuNaSEpqJxtp0n0loCb6Q0=";
23 # Since this upstream patch (https://github.com/jax-ml/ml_dtypes/commit/1bfd097e794413b0d465fa34f2eff0f3828ff521),
24 # the attempts to use the nixpkgs packaged eigen dependency have failed.
25 # Hence, we rely on the bundled eigen library.
26 fetchSubmodules = true;
30 substituteInPlace pyproject.toml \
31 --replace "numpy~=1.21.2" "numpy" \
32 --replace "numpy~=1.23.3" "numpy" \
33 --replace "numpy~=1.26.0" "numpy" \
34 --replace "setuptools~=68.1.0" "setuptools"
41 propagatedBuildInputs = [
51 # remove src module, so tests use the installed module instead
52 mv ./ml_dtypes/tests ./tests
56 pythonImportsCheck = [
61 description = "A stand-alone implementation of several NumPy dtype extensions used in machine learning libraries";
62 homepage = "https://github.com/jax-ml/ml_dtypes";
63 changelog = "https://github.com/jax-ml/ml_dtypes/releases/tag/v${version}";
64 license = licenses.asl20;
65 maintainers = with maintainers; [ GaetanLepage samuela ];