From 8adf1b68318a8a8bf24116a83b8a93eaba009814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 15 Oct 2024 15:02:56 -0700 Subject: [PATCH 1/2] python312Packages.onnx: clean up dependencies --- .../python-modules/onnx/default.nix | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/onnx/default.nix b/pkgs/development/python-modules/onnx/default.nix index f8bdd75368a1..a79342af3428 100644 --- a/pkgs/development/python-modules/onnx/default.nix +++ b/pkgs/development/python-modules/onnx/default.nix @@ -18,6 +18,7 @@ google-re2, pillow, protobuf, + setuptools, }: let @@ -26,45 +27,52 @@ in buildPythonPackage rec { pname = "onnx"; version = "1.16.2"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.8"; src = fetchFromGitHub { - owner = pname; - repo = pname; + owner = "onnx"; + repo = "onnx"; rev = "refs/tags/v${version}"; hash = "sha256-JmxnsHRrzj2QzPz3Yndw0MmgZJ8MDYxHjuQ7PQkQsDg="; }; build-system = [ cmake - pybind11 + protobuf + setuptools + ]; + + nativeBuildInputs = [ + protobuf_21 # for protoc ]; buildInputs = [ abseil-cpp - protobuf - google-re2 + protobuf_21 gtestStatic - pillow + pybind11 ]; dependencies = [ - protobuf_21 protobuf numpy typing-extensions ]; nativeCheckInputs = [ + google-re2 nbval parameterized + pillow pytestCheckHook tabulate ]; postPatch = '' + rm -r third_party + chmod +x tools/protoc-gen-mypy.sh.in patchShebangs tools/protoc-gen-mypy.sh.in From 073433e829b59a0d70009cc80f92570988a2e91d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 15 Oct 2024 15:15:22 -0700 Subject: [PATCH 2/2] python312Packages.onnx: 1.16.2 -> 1.17.0 Diff: https://github.com/onnx/onnx/compare/refs/tags/v1.16.2...v1.17.0 Changelog: https://github.com/onnx/onnx/releases/tag/v1.17.0 --- .../python-modules/onnx/default.nix | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/pkgs/development/python-modules/onnx/default.nix b/pkgs/development/python-modules/onnx/default.nix index a79342af3428..f4d91fe0ce62 100644 --- a/pkgs/development/python-modules/onnx/default.nix +++ b/pkgs/development/python-modules/onnx/default.nix @@ -26,7 +26,7 @@ let in buildPythonPackage rec { pname = "onnx"; - version = "1.16.2"; + version = "1.17.0"; pyproject = true; disabled = pythonOlder "3.8"; @@ -35,7 +35,7 @@ buildPythonPackage rec { owner = "onnx"; repo = "onnx"; rev = "refs/tags/v${version}"; - hash = "sha256-JmxnsHRrzj2QzPz3Yndw0MmgZJ8MDYxHjuQ7PQkQsDg="; + hash = "sha256-9oORW0YlQ6SphqfbjcYb0dTlHc+1gzy9quH/Lj6By8Q="; }; build-system = [ @@ -75,22 +75,13 @@ buildPythonPackage rec { chmod +x tools/protoc-gen-mypy.sh.in patchShebangs tools/protoc-gen-mypy.sh.in - - substituteInPlace setup.py \ - --replace 'setup_requires.append("pytest-runner")' "" - - # prevent from fetching & building own gtest - substituteInPlace CMakeLists.txt \ - --replace 'include(googletest)' "" - substituteInPlace cmake/unittest.cmake \ - --replace 'googletest)' ')' ''; preConfigure = '' # Set CMAKE_INSTALL_LIBDIR to lib explicitly, because otherwise it gets set # to lib64 and cmake incorrectly looks for the protobuf library in lib64 export CMAKE_ARGS="-DCMAKE_INSTALL_LIBDIR=lib -DONNX_USE_PROTOBUF_SHARED_LIBS=ON" - export CMAKE_ARGS+=" -Dgoogletest_STATIC_LIBRARIES=${gtestStatic}/lib/libgtest.a -Dgoogletest_INCLUDE_DIRS=${lib.getDev gtestStatic}/include" + export CMAKE_ARGS+=" -Dgoogletest_STATIC_LIBRARIES=${gtestStatic}/lib/libgtest.a" export ONNX_BUILD_TESTS=1 ''; @@ -115,7 +106,7 @@ buildPythonPackage rec { pytestFlagsArray = [ "onnx/test" - "onnx/examples" + "examples" ]; disabledTests = @@ -143,11 +134,6 @@ buildPythonPackage rec { "test_ops_tested" ]; - disabledTestPaths = [ - # Unexpected output fields from running code: {'stderr'} - "onnx/examples/np_array_tensorproto.ipynb" - ]; - __darwinAllowLocalNetworking = true; postCheck = '' @@ -158,6 +144,7 @@ buildPythonPackage rec { pythonImportsCheck = [ "onnx" ]; meta = with lib; { + changelog = "https://github.com/onnx/onnx/releases/tag/${lib.removePrefix "refs/tags/" src.rev}"; description = "Open Neural Network Exchange"; homepage = "https://onnx.ai"; license = licenses.asl20;