Files
nixpkgs/pkgs/development/python-modules/onnx/default.nix
T
Connor Baker 7d25a7919c onnx: 1.19.0 -> 1.19.1
Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
2025-11-26 13:46:58 +00:00

83 lines
1.4 KiB
Nix

{
buildPythonPackage,
onnx, # pkgs.onnx
# dependencies
ml-dtypes,
numpy,
protobuf,
typing-extensions,
# tests
parameterized,
pillow,
pytestCheckHook,
writableTmpDirAsHomeHook,
}:
buildPythonPackage {
inherit (onnx)
pname
src # Needed for testing.
version
;
format = "wheel";
dontUseWheelUnpack = true;
postUnpack = ''
cp -rv "${onnx.dist}" "$sourceRoot/dist"
chmod +w "$sourceRoot/dist"
'';
buildInputs = [
# onnx must be included to avoid shrinking during fixupPhase removing the RUNPATH entry on
# onnx_cpp2py_export.cpython-*.so.
onnx
];
dependencies = [
ml-dtypes
numpy
protobuf
typing-extensions
];
nativeCheckInputs = [
parameterized
pillow
pytestCheckHook
writableTmpDirAsHomeHook
];
# The executables are just utility scripts that aren't too important
postInstall = ''
rm -rv $out/bin
'';
# detecting source dir as a python package confuses pytest
preCheck = ''
rm onnx/__init__.py
'';
enabledTestPaths = [
"onnx/test"
"examples"
];
__darwinAllowLocalNetworking = true;
pythonImportsCheck = [ "onnx" ];
meta = {
# Explicitly inherit from ONNX's meta to avoid pulling in attributes added by stdenv.mkDerivation.
inherit (onnx.meta)
changelog
description
homepage
license
maintainers
;
};
}