git: 749e85c87ada - main - misc/py-onnx: update 1.16.2 → 1.17.0

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Wed, 26 Feb 2025 03:36:55 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=749e85c87ada57baba935122177391633e654533

commit 749e85c87ada57baba935122177391633e654533
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2025-02-26 03:25:16 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2025-02-26 03:36:49 +0000

    misc/py-onnx: update 1.16.2 → 1.17.0
---
 misc/py-onnx/Makefile                   | 11 +++--
 misc/py-onnx/distinfo                   |  6 +--
 misc/py-onnx/files/patch-CMakeLists.txt | 32 ++++++------
 misc/py-onnx/files/patch-pyproject.toml | 18 +++----
 misc/py-onnx/files/patch-setup.py       | 86 ++++++++++++++++-----------------
 5 files changed, 78 insertions(+), 75 deletions(-)

diff --git a/misc/py-onnx/Makefile b/misc/py-onnx/Makefile
index 38abade66abd..78c1d993940b 100644
--- a/misc/py-onnx/Makefile
+++ b/misc/py-onnx/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	onnx
-DISTVERSION=	1.16.2
-PORTREVISION=	6
+DISTVERSION=	1.17.0
 CATEGORIES=	misc # machine-learning
 MASTER_SITES=	PYPI \
 		https://github.com/abseil/abseil-cpp/archive/refs/tags/:abseil \
@@ -31,8 +30,10 @@ BUILD_DEPENDS=	bash:shells/bash \
 		${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
 #LIB_DEPENDS=	libabsl_base.so:devel/abseil \
 		libprotobuf.so:devel/protobuf # disable packaged protobuf
-RUN_DEPENDS=	${PYNUMPY} \
-		${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR} \
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}google-re2>0:devel/py-google-re2@${PY_FLAVOR} \
+		${PYNUMPY} \
+		${PYTHON_PKGNAMEPREFIX}pillow>0:graphics/py-pillow@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}protobuf>=3.20.2:devel/py-protobuf@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}typing-extensions>=3.6.2.1:devel/py-typing-extensions@${PY_FLAVOR}
 TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}parameterized>0:devel/py-parameterized@${PY_FLAVOR}
 
@@ -61,4 +62,6 @@ post-patch: # replace protobuf-24+ with protobuf-lite-22.3
 post-install:
 	@${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/onnx/onnx_cpp2py_export*.so
 
+# tests as of 1.17.0: 4 failed, 4564 passed, 3044 skipped, 26 warnings in 60.66s (0:01:00), see https://github.com/onnx/onnx/issues/6733
+
 .include <bsd.port.mk>
diff --git a/misc/py-onnx/distinfo b/misc/py-onnx/distinfo
index 6399e329e869..5b916472921a 100644
--- a/misc/py-onnx/distinfo
+++ b/misc/py-onnx/distinfo
@@ -1,6 +1,6 @@
-TIMESTAMP = 1724811108
-SHA256 (onnx/onnx-1.16.2.tar.gz) = b33a282b038813c4b69e73ea65c2909768e8dd6cc10619b70632335daf094646
-SIZE (onnx/onnx-1.16.2.tar.gz) = 12308861
+TIMESTAMP = 1740531228
+SHA256 (onnx/onnx-1.17.0.tar.gz) = 48ca1a91ff73c1d5e3ea2eef20ae5d0e709bb8a2355ed798ffc2169753013fd3
+SIZE (onnx/onnx-1.17.0.tar.gz) = 12165120
 SHA256 (onnx/20230125.3.tar.gz) = 5366d7e7fa7ba0d915014d387b66d0d002c03236448e1ba9ef98122c13b35c36
 SIZE (onnx/20230125.3.tar.gz) = 2119655
 SHA256 (onnx/protobuf-22.3.tar.gz) = 4101e11ef41afa91cac1bd95483cb781626781ae1a331501ed8379f2d82ca9bc
diff --git a/misc/py-onnx/files/patch-CMakeLists.txt b/misc/py-onnx/files/patch-CMakeLists.txt
index 21f7bfc0b494..142cb68b67f9 100644
--- a/misc/py-onnx/files/patch-CMakeLists.txt
+++ b/misc/py-onnx/files/patch-CMakeLists.txt
@@ -1,19 +1,19 @@
 - use downloaded protobuf-22.3
 
---- CMakeLists.txt.orig	2024-03-05 00:46:58 UTC
+--- CMakeLists.txt.orig	2024-09-30 20:12:15 UTC
 +++ CMakeLists.txt
-@@ -19,12 +19,12 @@ option(ONNX_USE_PROTOBUF_SHARED_LIBS "Build ONNX using
- option(ONNX_BUILD_BENCHMARKS "Build ONNX micro-benchmarks" OFF)
- option(ONNX_USE_PROTOBUF_SHARED_LIBS "Build ONNX using protobuf shared library. Sets PROTOBUF_USE_DLLS CMAKE Flag and Protobuf_USE_STATIC_LIBS. " OFF)
- 
--option(BUILD_ONNX_PYTHON "Build Python binaries" OFF)
-+option(BUILD_ONNX_PYTHON "Build Python binaries" ON)
- option(ONNX_GEN_PB_TYPE_STUBS "Generate protobuf python type stubs" ON)
- option(ONNX_WERROR "Build with Werror" OFF)
- option(ONNX_COVERAGE "Build with coverage instrumentation" OFF)
- option(ONNX_BUILD_TESTS "Build ONNX C++ APIs Tests" OFF)
--option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." OFF)
-+option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." ON) # workaround for the failure, see https://github.com/onnx/optimizer/issues/38#issuecomment-817058821
- option(ONNX_DISABLE_EXCEPTIONS "Disable exception handling." OFF)
- option(ONNX_DISABLE_STATIC_REGISTRATION "Disable static registration for onnx operator schemas." OFF)
- option(ONNX_USE_UNITY_BUILD "Enable Unity (Jumbo) build for" OFF)
+@@ -18,12 +18,12 @@ option(ONNX_USE_PROTOBUF_SHARED_LIBS "Build ONNX using
+ project(onnx C CXX)
+ option(ONNX_USE_PROTOBUF_SHARED_LIBS "Build ONNX using protobuf shared library. Sets PROTOBUF_USE_DLLS CMAKE Flag and Protobuf_USE_STATIC_LIBS. " OFF)
+ 
+-option(BUILD_ONNX_PYTHON "Build Python binaries" OFF)
++option(BUILD_ONNX_PYTHON "Build Python binaries" ON)
+ option(ONNX_GEN_PB_TYPE_STUBS "Generate protobuf python type stubs" ON)
+ option(ONNX_WERROR "Build with Werror" OFF)
+ option(ONNX_COVERAGE "Build with coverage instrumentation" OFF)
+ option(ONNX_BUILD_TESTS "Build ONNX C++ APIs Tests" OFF)
+-option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." OFF)
++option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." ON) # workaround for the failure, see https://github.com/onnx/optimizer/issues/38#issuecomment-817058821
+ option(ONNX_DISABLE_EXCEPTIONS "Disable exception handling." OFF)
+ option(ONNX_DISABLE_STATIC_REGISTRATION "Disable static registration for onnx operator schemas." OFF)
+ option(ONNX_USE_UNITY_BUILD "Enable Unity (Jumbo) build for" OFF)
diff --git a/misc/py-onnx/files/patch-pyproject.toml b/misc/py-onnx/files/patch-pyproject.toml
index 03d073137dca..e60e1d33454d 100644
--- a/misc/py-onnx/files/patch-pyproject.toml
+++ b/misc/py-onnx/files/patch-pyproject.toml
@@ -1,11 +1,11 @@
---- pyproject.toml.orig	2024-03-05 06:23:47 UTC
+--- pyproject.toml.orig	2024-09-30 20:12:15 UTC
 +++ pyproject.toml
 @@ -1,7 +1,7 @@
- # SPDX-License-Identifier: Apache-2.0
- 
- [build-system]
--requires = ["setuptools>=64", "protobuf>=3.20.2", "cmake"]
-+requires = ["setuptools", "protobuf>=3.20.2"]
- build-backend = "setuptools.build_meta"
- 
- [project]
+ # SPDX-License-Identifier: Apache-2.0
+ 
+ [build-system]
+-requires = ["setuptools>=64", "protobuf>=3.20.2", "cmake"]
++requires = ["setuptools", "protobuf>=3.20.2"]
+ build-backend = "setuptools.build_meta"
+ 
+ [project]
diff --git a/misc/py-onnx/files/patch-setup.py b/misc/py-onnx/files/patch-setup.py
index 0c28f53ef277..cf72ca00fe1b 100644
--- a/misc/py-onnx/files/patch-setup.py
+++ b/misc/py-onnx/files/patch-setup.py
@@ -1,44 +1,44 @@
---- setup.py.orig	2024-03-25 14:15:57 UTC
+--- setup.py.orig	2024-09-30 20:12:15 UTC
 +++ setup.py
-@@ -65,11 +65,12 @@ try:
- ################################################################################
- 
- try:
--    _git_version = (
--        subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=TOP_DIR)
--        .decode("ascii")
--        .strip()
--    )
-+    #_git_version = (
-+    #    subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=TOP_DIR)
-+    #    .decode("ascii")
-+    #    .strip()
-+    #)
-+    _git_version = ""
- except (OSError, subprocess.CalledProcessError):
-     _git_version = ""
- 
-@@ -227,10 +228,7 @@ class BuildPy(setuptools.command.build_py.build_py):
- 
- class BuildPy(setuptools.command.build_py.build_py):
-     def run(self):
--        if self.editable_mode:
--            dst_dir = TOP_DIR
--        else:
--            dst_dir = self.build_lib
-+        dst_dir = self.build_lib
-         create_version(dst_dir)
-         return super().run()
- 
-@@ -273,10 +271,7 @@ class BuildExt(setuptools.command.build_ext.build_ext)
-             self.copy_file(src, dst)
- 
-         # Copy over the generated python files to build/source dir depending on editable mode
--        if self.editable_mode:
--            dst_dir = TOP_DIR
--        else:
--            dst_dir = build_lib
-+        dst_dir = build_lib
- 
-         generated_py_files = glob.glob(os.path.join(CMAKE_BUILD_DIR, "onnx", "*.py"))
-         generated_pyi_files = glob.glob(os.path.join(CMAKE_BUILD_DIR, "onnx", "*.pyi"))
+@@ -66,11 +66,12 @@ try:
+ ################################################################################
+ 
+ try:
+-    _git_version = (
+-        subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=TOP_DIR)
+-        .decode("ascii")
+-        .strip()
+-    )
++    #_git_version = (
++    #    subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=TOP_DIR)
++    #    .decode("ascii")
++    #    .strip()
++    #)
++    _git_version = ""
+ except (OSError, subprocess.CalledProcessError):
+     _git_version = ""
+ 
+@@ -228,10 +229,7 @@ class BuildPy(setuptools.command.build_py.build_py):
+ 
+ class BuildPy(setuptools.command.build_py.build_py):
+     def run(self):
+-        if self.editable_mode:
+-            dst_dir = TOP_DIR
+-        else:
+-            dst_dir = self.build_lib
++        dst_dir = self.build_lib
+         create_version(dst_dir)
+         return super().run()
+ 
+@@ -274,10 +272,7 @@ class BuildExt(setuptools.command.build_ext.build_ext)
+             self.copy_file(src, dst)
+ 
+         # Copy over the generated python files to build/source dir depending on editable mode
+-        if self.editable_mode:
+-            dst_dir = TOP_DIR
+-        else:
+-            dst_dir = build_lib
++        dst_dir = build_lib
+ 
+         generated_py_files = glob.glob(os.path.join(CMAKE_BUILD_DIR, "onnx", "*.py"))
+         generated_pyi_files = glob.glob(os.path.join(CMAKE_BUILD_DIR, "onnx", "*.pyi"))