| 
									
										
										
										
											2019-10-16 00:31:30 +01:00
										 |  |  | { lib | 
					
						
							|  |  |  | , buildPythonPackage | 
					
						
							|  |  |  | , fetchPypi | 
					
						
							|  |  |  | , pythonOlder | 
					
						
							|  |  |  | , isPy27 | 
					
						
							|  |  |  | , cmake | 
					
						
							|  |  |  | , protobuf | 
					
						
							|  |  |  | , numpy | 
					
						
							|  |  |  | , six | 
					
						
							|  |  |  | , typing-extensions | 
					
						
							| 
									
										
										
										
											2021-04-23 19:59:09 +01:00
										 |  |  | , pytestCheckHook | 
					
						
							| 
									
										
										
										
											2019-10-16 00:31:30 +01:00
										 |  |  | , nbval | 
					
						
							|  |  |  | , tabulate | 
					
						
							|  |  |  | }: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | buildPythonPackage rec { | 
					
						
							|  |  |  |   pname = "onnx"; | 
					
						
							| 
									
										
										
										
											2021-04-23 19:59:09 +01:00
										 |  |  |   version = "1.9.0"; | 
					
						
							| 
									
										
										
										
											2019-10-16 00:31:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-23 19:59:09 +01:00
										 |  |  |   # Python 2 is not supported as of Onnx v1.8 | 
					
						
							| 
									
										
										
										
											2019-10-16 00:31:30 +01:00
										 |  |  |   disabled = isPy27; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   src = fetchPypi { | 
					
						
							|  |  |  |     inherit pname version; | 
					
						
							| 
									
										
										
										
											2021-04-23 19:59:09 +01:00
										 |  |  |     sha256 = "0yjv2axz2vc2ysniwislsp53fsb8f61y1warrr2ppn2d9ijml1d9"; | 
					
						
							| 
									
										
										
										
											2019-10-16 00:31:30 +01:00
										 |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   nativeBuildInputs = [ cmake ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   propagatedBuildInputs = [ | 
					
						
							|  |  |  |     protobuf | 
					
						
							|  |  |  |     numpy | 
					
						
							|  |  |  |     six | 
					
						
							|  |  |  |     typing-extensions | 
					
						
							| 
									
										
										
										
											2021-04-23 19:59:09 +01:00
										 |  |  |   ]; | 
					
						
							| 
									
										
										
										
											2019-10-16 00:31:30 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   checkInputs = [ | 
					
						
							| 
									
										
										
										
											2021-04-23 19:59:09 +01:00
										 |  |  |     pytestCheckHook | 
					
						
							| 
									
										
										
										
											2019-10-16 00:31:30 +01:00
										 |  |  |     nbval | 
					
						
							|  |  |  |     tabulate | 
					
						
							|  |  |  |   ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   postPatch = ''
 | 
					
						
							| 
									
										
										
										
											2021-03-19 17:03:02 -03:00
										 |  |  |     chmod +x tools/protoc-gen-mypy.sh.in | 
					
						
							|  |  |  |     patchShebangs tools/protoc-gen-mypy.sh.in tools/protoc-gen-mypy.py | 
					
						
							| 
									
										
										
										
											2021-04-25 23:17:07 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     substituteInPlace setup.py \ | 
					
						
							|  |  |  |       --replace "setup_requires.append('pytest-runner')" "" | 
					
						
							| 
									
										
										
										
											2019-10-16 00:31:30 +01:00
										 |  |  |   '';
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-11 19:46:44 +01:00
										 |  |  |   preBuild = ''
 | 
					
						
							|  |  |  |     export MAX_JOBS=$NIX_BUILD_CORES | 
					
						
							|  |  |  |   '';
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-16 00:31:30 +01:00
										 |  |  |   # The executables are just utility scripts that aren't too important | 
					
						
							|  |  |  |   postInstall = ''
 | 
					
						
							|  |  |  |     rm -r $out/bin | 
					
						
							|  |  |  |   '';
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-11 19:46:44 +01:00
										 |  |  |   # The setup.py does all the configuration | 
					
						
							|  |  |  |   dontUseCmakeConfigure = true; | 
					
						
							| 
									
										
										
										
											2019-10-16 00:31:30 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   meta = { | 
					
						
							| 
									
										
										
										
											2020-03-31 21:11:51 -04:00
										 |  |  |     homepage    = "http://onnx.ai"; | 
					
						
							| 
									
										
										
										
											2019-10-16 00:31:30 +01:00
										 |  |  |     description = "Open Neural Network Exchange"; | 
					
						
							|  |  |  |     license     = lib.licenses.mit; | 
					
						
							|  |  |  |     maintainers = [ lib.maintainers.acairncross ]; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | } |