9 pname = "paddle-bfloat";
13 inherit pname version;
14 format = "setuptools";
17 pname = "paddle_bfloat";
19 hash = "sha256-mrjQCtLsXOvqeHHMjuMx65FvMfZ2+wTh1ao9ZJE+9xw=";
23 sed '1i#include <memory>' -i bfloat16.cc # gcc12
24 # replace deprecated function for python3.11
25 substituteInPlace bfloat16.cc \
26 --replace "Py_TYPE(&NPyBfloat16_Descr) = &PyArrayDescr_Type" "Py_SET_TYPE(&NPyBfloat16_Descr, &PyArrayDescr_Type)"
29 disabled = pythonOlder "3.9" || pythonAtLeast "3.12";
31 propagatedBuildInputs = [
35 pythonImportsCheck = [ "paddle_bfloat" ];
37 # upstream has no tests
41 description = "Paddle numpy bfloat16 package";
42 homepage = "https://pypi.org/project/paddle-bfloat";
43 license = licenses.asl20;
44 maintainers = with maintainers; [ happysalada ];