2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-04-27 09:35:20 +00:00
|
|
|
, bash
|
2021-12-06 16:07:01 +00:00
|
|
|
, cmake
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
|
|
|
, isPy27
|
2021-12-06 16:07:01 +00:00
|
|
|
, nbval
|
2020-04-24 23:36:52 +00:00
|
|
|
, numpy
|
2021-12-06 16:07:01 +00:00
|
|
|
, protobuf
|
2021-04-26 19:14:03 +00:00
|
|
|
, pytestCheckHook
|
2021-12-06 16:07:01 +00:00
|
|
|
, six
|
2020-04-24 23:36:52 +00:00
|
|
|
, tabulate
|
2021-12-06 16:07:01 +00:00
|
|
|
, typing-extensions
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "onnx";
|
2022-04-15 01:41:22 +00:00
|
|
|
version = "1.11.0";
|
2021-12-06 16:07:01 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-04-15 01:41:22 +00:00
|
|
|
sha256 = "sha256-7KIkx8LI7kByoHQ+SJioSpvfgpe15ZEKJjLkxBgv+yo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
protobuf
|
|
|
|
numpy
|
|
|
|
six
|
|
|
|
typing-extensions
|
2021-04-26 19:14:03 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
nbval
|
2021-12-06 16:07:01 +00:00
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
tabulate
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-03-20 04:20:00 +00:00
|
|
|
chmod +x tools/protoc-gen-mypy.sh.in
|
2022-04-27 09:35:20 +00:00
|
|
|
patchShebangs tools/protoc-gen-mypy.py
|
|
|
|
substituteInPlace tools/protoc-gen-mypy.sh.in \
|
|
|
|
--replace "/bin/bash" "${bash}/bin/bash"
|
2021-04-26 19:14:03 +00:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "setup_requires.append('pytest-runner')" ""
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
preBuild = ''
|
|
|
|
export MAX_JOBS=$NIX_BUILD_CORES
|
|
|
|
'';
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# Unexpected output fields from running code: {'stderr'}
|
|
|
|
"onnx/examples/np_array_tensorproto.ipynb"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# The executables are just utility scripts that aren't too important
|
|
|
|
postInstall = ''
|
|
|
|
rm -r $out/bin
|
|
|
|
'';
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
# The setup.py does all the configuration
|
|
|
|
dontUseCmakeConfigure = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"onnx"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Open Neural Network Exchange";
|
2022-01-03 16:56:52 +00:00
|
|
|
homepage = "https://onnx.ai";
|
2021-12-06 16:07:01 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ acairncross ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|