Skip to content

Commit

Permalink
misc/py-onnx: update 1.14.1 → 1.16.0
Browse files Browse the repository at this point in the history
Reported by:	portscout
  • Loading branch information
yurivict committed Apr 20, 2024
1 parent 1c7a816 commit 3a60351
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 25 deletions.
16 changes: 11 additions & 5 deletions misc/py-onnx/Makefile
@@ -1,6 +1,5 @@
PORTNAME= onnx
DISTVERSION= 1.14.1
PORTREVISION= 1
DISTVERSION= 1.16.0
CATEGORIES= misc # machine-learning
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
Expand All @@ -16,19 +15,26 @@ BUILD_DEPENDS= bash:shells/bash \
cmake:devel/cmake-core \
protoc-gen-mypy:devel/py-mypy-protobuf@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pybind11>0:devel/py-pybind11@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytest-runner>=0:devel/py-pytest-runner@${PY_FLAVOR}
LIB_DEPENDS= libprotobuf.so:devel/protobuf
${PYTHON_PKGNAMEPREFIX}pytest-runner>=0:devel/py-pytest-runner@${PY_FLAVOR} \
${PY_SETUPTOOLS} \
${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
LIB_DEPENDS= libabsl_base.so:devel/abseil \
libprotobuf.so:devel/protobuf
RUN_DEPENDS= ${PYNUMPY} \
${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${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}

USES= compiler:c++17-lang python shebangfix
USE_PYTHON= distutils concurrent autoplist
USE_PYTHON= pep517 concurrent autoplist pytest

CXXFLAGS+= -Dstat64=stat

SHEBANG_FILES= tools/protoc-gen-mypy.sh.in

TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
TEST_WRKSRC= ${WRKSRC}/onnx/test

BINARY_ALIAS= python=${PYTHON_CMD}

post-install:
Expand Down
6 changes: 3 additions & 3 deletions misc/py-onnx/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1693031876
SHA256 (onnx-1.14.1.tar.gz) = 70903afe163643bd71195c78cedcc3f4fa05a2af651fd950ef3acbb15175b2d1
SIZE (onnx-1.14.1.tar.gz) = 11328774
TIMESTAMP = 1713580433
SHA256 (onnx-1.16.0.tar.gz) = 237c6987c6c59d9f44b6136f5819af79574f8d96a760a1fa843bede11f3822f7
SIZE (onnx-1.16.0.tar.gz) = 12303017
13 changes: 2 additions & 11 deletions misc/py-onnx/files/patch-CMakeLists.txt
@@ -1,6 +1,6 @@
--- CMakeLists.txt.orig 2023-08-08 18:33:06 UTC
--- CMakeLists.txt.orig 2024-03-05 00:46:58 UTC
+++ CMakeLists.txt
@@ -18,7 +18,7 @@ project(onnx C CXX)
@@ -19,7 +19,7 @@ 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)

Expand All @@ -9,12 +9,3 @@
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)
@@ -58,7 +58,7 @@ endif()
# Required to use /std:c++17 or higher on Windows
# For other platforms, set C++11 as standard for the whole project
if(NOT MSVC)
- set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD 17)
else()
string(APPEND CMAKE_CXX_FLAGS " /std:c++17")
endif()
11 changes: 11 additions & 0 deletions misc/py-onnx/files/patch-pyproject.toml
@@ -0,0 +1,11 @@
--- pyproject.toml.orig 2024-03-05 06:23:47 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]
36 changes: 30 additions & 6 deletions misc/py-onnx/files/patch-setup.py
@@ -1,20 +1,44 @@
--- setup.py.orig 2023-04-12 23:29:42 UTC
--- setup.py.orig 2024-03-25 14:15:57 UTC
+++ setup.py
@@ -59,11 +59,12 @@ COVERAGE = bool(os.getenv("COVERAGE", "0") == "1")
@@ -65,11 +65,12 @@ try:
################################################################################

try:
- git_version = (
- _git_version = (
- subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=TOP_DIR)
- .decode("ascii")
- .strip()
- )
+ #git_version = (
+ #_git_version = (
+ # subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=TOP_DIR)
+ # .decode("ascii")
+ # .strip()
+ #)
+ git_version = None
+ _git_version = ""
except (OSError, subprocess.CalledProcessError):
git_version = None
_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"))

0 comments on commit 3a60351

Please sign in to comment.