linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / python-modules / onnx / default.nix
blob90683a84f46aaf29c9556c7302192f3c01fd3e3e
1 { lib
2 , buildPythonPackage
3 , fetchPypi
4 , pythonOlder
5 , isPy27
6 , cmake
7 , protobuf
8 , numpy
9 , six
10 , typing-extensions
11 , typing
12 , pytestrunner
13 , pytest
14 , nbval
15 , tabulate
18 buildPythonPackage rec {
19   pname = "onnx";
20   version = "1.8.1";
22   # Due to Protobuf packaging issues this build of Onnx with Python 2 gives
23   # errors on import.
24   # Also support for Python 2 will be deprecated from Onnx v1.8.
25   disabled = isPy27;
27   src = fetchPypi {
28     inherit pname version;
29     sha256 = "9d65c52009a90499f8c25fdfe5acda3ac88efe0788eb1d5f2575a989277145fb";
30   };
32   nativeBuildInputs = [ cmake ];
34   propagatedBuildInputs = [
35     protobuf
36     numpy
37     six
38     typing-extensions
39   ] ++ lib.optional (pythonOlder "3.5") [ typing ];
41   checkInputs = [
42     pytestrunner
43     pytest
44     nbval
45     tabulate
46   ];
48   postPatch = ''
49     chmod +x tools/protoc-gen-mypy.sh.in
50     patchShebangs tools/protoc-gen-mypy.sh.in tools/protoc-gen-mypy.py
51   '';
53   preBuild = ''
54     export MAX_JOBS=$NIX_BUILD_CORES
55   '';
57   # The executables are just utility scripts that aren't too important
58   postInstall = ''
59     rm -r $out/bin
60   '';
62   # The setup.py does all the configuration
63   dontUseCmakeConfigure = true;
65   meta = {
66     homepage    = "http://onnx.ai";
67     description = "Open Neural Network Exchange";
68     license     = lib.licenses.mit;
69     maintainers = [ lib.maintainers.acairncross ];
70   };