public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/onnx] test-1.21.0: Fix python build
@ 2026-06-08 15:18 Diego Herrera
0 siblings, 0 replies; only message in thread
From: Diego Herrera @ 2026-06-08 15:18 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/onnx
Branch : test-1.21.0
Commit : f85f6db1cf0334a195d7feb037f6feb970b4c27b
Author : Diego Herrera <dherrera@redhat.com>
Date : 2023-08-05T01:38:37-04:00
Stats : +39/-15 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/onnx/c/f85f6db1cf0334a195d7feb037f6feb970b4c27b?branch=test-1.21.0
Log:
Fix python build
---
diff --git a/onnx.spec b/onnx.spec
index a87ae83..1a05144 100644
--- a/onnx.spec
+++ b/onnx.spec
@@ -2,7 +2,7 @@
Name: onnx
Version: 1.14.0
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Open standard for machine learning interoperability
License: Apache-2.0
@@ -15,7 +15,9 @@ Patch0: onnx-install.patch
# Add what is missing to run tox, disable tests that require network
Patch1: onnx-tox.patch
# Use system protobuf and require parameterized
-Patch2: onnx-requirements.patch
+Patch2: onnx-requirements.patch
+# Let pyproject_wheel use binaries from cmake_build
+Patch3: python-cmake-fix.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2212096
ExcludeArch: s390x
@@ -68,32 +70,28 @@ Requires: %{name}-libs = %{version}-%{release}
-DBUILD_ONNX_PYTHON=ON \
-DPYTHON_EXECUTABLE=%{python3} \
-DPY_EXT_SUFFIX=%{python3_ext_suffix} \
- -DPY_SITEARCH=%{python3_sitearch}
+ -DPY_SITEARCH=%{python3_sitearch} \
+ -DCMAKE_SKIP_RPATH:BOOL=ON
# Generate protobuf header and source files
%cmake_build -- gen_onnx_proto
# Add missing ONNX_API
(cd "%__cmake_builddir"; patch -p1 < "%{_sourcedir}/add-export-protobuf-headers.patch")
# Build
%cmake_build
+# Build python libs
+%pyproject_wheel
%install
%cmake_install
# Need to remove empty directories
find "%{buildroot}/%{_includedir}" -type d -empty -delete
find "%{buildroot}/%{python3_sitearch}" -type d -empty -delete
-# This file is normally generated by setup.py
-cat > "%{buildroot}/%{python3_sitearch}/%{name}/version.py" <<EOF
-version = "%{version}"
-git_version = "%{git_version}"
-EOF
-# Executable modules
-chmod a+x "%{buildroot}/%{python3_sitearch}/%{name}/gen_proto.py"
-chmod a+x "%{buildroot}/%{python3_sitearch}/%{name}/defs/gen_doc.py"
-%py3_shebang_fix "%{buildroot}/%{python3_sitearch}/%{name}/gen_proto.py"
-%py3_shebang_fix "%{buildroot}/%{python3_sitearch}/%{name}/defs/gen_doc.py"
# Install *.proto files
install -p "./onnx/"*.proto -t "%{buildroot}/%{_includedir}/onnx/"
+%pyproject_install
+%pyproject_save_files onnx
+
%check
export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}
%tox
@@ -110,10 +108,15 @@ export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}
%{_libdir}/cmake/ONNX
%{_includedir}/%{name}/
-%files -n python3-onnx
-%{python3_sitearch}/%{name}/
+%files -n python3-onnx -f %{pyproject_files}
+%{_bindir}/backend-test-tools
+%{_bindir}/check-model
+%{_bindir}/check-node
%changelog
+* Sat Aug 5 2023 Diego Herrera C <dherrera@redhat.com> - 1.14.0-5
+- Build python libs using the proper macros.
+
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.14.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
diff --git a/python-cmake-fix.patch b/python-cmake-fix.patch
new file mode 100644
index 0000000..a2d2127
--- /dev/null
+++ b/python-cmake-fix.patch
@@ -0,0 +1,21 @@
+diff -urN onnx-1.14.0-orig/setup.py onnx-1.14.0/setup.py
+--- onnx-1.14.0-orig/setup.py 2023-08-04 19:00:31.727728785 -0400
++++ onnx-1.14.0/setup.py 2023-08-04 21:03:41.810893151 -0400
+@@ -25,7 +25,7 @@
+ TOP_DIR = os.path.realpath(os.path.dirname(__file__))
+ SRC_DIR = os.path.join(TOP_DIR, "onnx")
+ TP_DIR = os.path.join(TOP_DIR, "third_party")
+-CMAKE_BUILD_DIR = os.path.join(TOP_DIR, ".setuptools-cmake-build")
++CMAKE_BUILD_DIR = os.path.join(TOP_DIR, "redhat-linux-build")
+ PACKAGE_NAME = "onnx"
+
+ WINDOWS = os.name == "nt"
+@@ -147,7 +147,7 @@
+
+ user_options = [("jobs=", "j", "Specifies the number of jobs to use with make")]
+
+- built = False
++ built = True
+
+ def initialize_options(self):
+ self.jobs = None
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-08 15:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-08 15:18 [rpms/onnx] test-1.21.0: Fix python build Diego Herrera
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox