3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/onnx/default.nix
Sandro 293a5455f3
python310Packages.ffcv: fix build (#170158)
* python310Packages.ffcv: fix pkg-config usage

Package does not use the pkgconfig python packages but ships its own method
which execs pkg-config

* python310Packages.onnx: ignore failing test

* python310Packages.pytorch-pfn-extras: fix build

* python310Packages.pytorch-pfn-extras: move comment out of multi line string

Co-authored-by: Samuel Ainsworth <skainsworth@gmail.com>

* Update pkgs/development/python-modules/pytorch-pfn-extras/default.nix

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>

Co-authored-by: Samuel Ainsworth <skainsworth@gmail.com>
2022-04-25 18:48:36 -07:00

82 lines
1.5 KiB
Nix

{ lib
, buildPythonPackage
, bash
, cmake
, fetchPypi
, isPy27
, nbval
, numpy
, protobuf
, pytestCheckHook
, six
, tabulate
, typing-extensions
}:
buildPythonPackage rec {
pname = "onnx";
version = "1.11.0";
format = "setuptools";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
sha256 = "sha256-7KIkx8LI7kByoHQ+SJioSpvfgpe15ZEKJjLkxBgv+yo=";
};
nativeBuildInputs = [
cmake
];
propagatedBuildInputs = [
protobuf
numpy
six
typing-extensions
];
checkInputs = [
nbval
pytestCheckHook
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"
substituteInPlace setup.py \
--replace "setup_requires.append('pytest-runner')" ""
'';
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 ];
};
}