misc/py-onnx: update 1.16.2 → 1.17.0

This commit is contained in:
Yuri Victorovich 2025-02-25 19:25:16 -08:00
parent 4ffe1ecfad
commit 749e85c87a
5 changed files with 78 additions and 75 deletions

View File

@ -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>

View File

@ -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

View File

@ -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)

View File

@ -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]

View File

@ -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"))