Files
nixpkgs/pkgs/development/python-modules/onnx/default.nix
T
Guillaume Girol 33afbf39f6 treewide: switch to nativeCheckInputs
checkInputs used to be added to nativeBuildInputs. Now we have
nativeCheckInputs to do that instead. Doing this treewide change allows
to keep hashes identical to before the introduction of
nativeCheckInputs.
2023-01-21 12:00:00 +00:00

86 lines
1.5 KiB
Nix

{ lib
, buildPythonPackage
, bash
, cmake
, fetchPypi
, isPy27
, nbval
, numpy
, protobuf
, pytestCheckHook
, six
, tabulate
, typing-extensions
, pythonRelaxDepsHook
, pytest-runner
}:
buildPythonPackage rec {
pname = "onnx";
version = "1.12.0";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
sha256 = "sha256-E7PnfSdSO52/TzDfyclZRVhZ1eNOkhxE9xLWm4Np7/k=";
};
nativeBuildInputs = [
cmake
pythonRelaxDepsHook
];
pythonRelaxDeps = [ "protobuf" ];
propagatedBuildInputs = [
protobuf
numpy
six
typing-extensions
];
nativeCheckInputs = [
nbval
pytestCheckHook
pytest-runner
tabulate
];
postPatch = ''
chmod +x tools/protoc-gen-mypy.sh.in
patchShebangs tools/protoc-gen-mypy.py
substituteInPlace tools/protoc-gen-mypy.sh.in \
--replace "/bin/bash" "${bash}/bin/bash"
'';
preBuild = ''
export MAX_JOBS=$NIX_BUILD_CORES
'';
disabledTestPaths = [
# Unexpected output fields from running code: {'stderr'}
"onnx/examples/np_array_tensorproto.ipynb"
];
# The executables are just utility scripts that aren't too important
postInstall = ''
rm -r $out/bin
'';
# The setup.py does all the configuration
dontUseCmakeConfigure = true;
pythonImportsCheck = [
"onnx"
];
meta = with lib; {
description = "Open Neural Network Exchange";
homepage = "https://onnx.ai";
license = licenses.asl20;
maintainers = with maintainers; [ acairncross ];
};
}