public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: aanokhov <artyom.anokhov@intel.com>
To: git-commits@fedoraproject.org
Subject: [rpms/openvino] origin/pr/7/head: Add python3-openvino subpackage with Python bindings
Date: Wed, 10 Jun 2026 16:59:30 GMT	[thread overview]
Message-ID: <178111077068.1.16880199807822753805.rpms-openvino-62715ed6e54c@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/openvino
Branch : origin/pr/7/head
Commit : 62715ed6e54c8cf00bf83b925511045b9fe88b1f
Author : aanokhov <artyom.anokhov@intel.com>
Date   : 2026-06-05T10:31:41+00:00
Stats  : +53/-5 in 1 file(s)
URL    : https://src.fedoraproject.org/rpms/openvino/c/62715ed6e54c8cf00bf83b925511045b9fe88b1f?branch=origin/pr/7/head

Log:
Add python3-openvino subpackage with Python bindings

---
diff --git a/openvino.spec b/openvino.spec
index 8c80bd5..918f7f4 100644
--- a/openvino.spec
+++ b/openvino.spec
@@ -33,6 +33,7 @@ Source3:        https://github.com/oneapi-src/oneDNN/archive/929fe4e5629be2a5e89
 Patch0: protobuf_version.patch
 Patch1: xbyak-gflags-system-modules.patch
 Patch2: samples-system-gflags-json.patch
+Patch3: pybind11-call_guard-compat.patch
 
 ExclusiveArch:  x86_64
 
@@ -53,6 +54,11 @@ BuildRequires:  pkgconfig(OpenCL)
 BuildRequires:  xbyak-devel
 BuildRequires:  gflags-devel
 BuildRequires:  zlib-devel
+BuildRequires:  python3-devel
+BuildRequires:  pybind11-devel
+BuildRequires:  python3-setuptools
+BuildRequires:  python3-wheel
+BuildRequires:  python3-numpy
 
 Requires:       lib%{name}-ir-frontend = %{version}-%{release}
 Requires:       lib%{name}-pytorch-frontend = %{version}-%{release}
@@ -220,6 +226,17 @@ This package provides C and C++ source code samples demonstrating how to
 use OpenVINO runtime and APIs.
 
 
+%package -n python3-%{name}
+Summary:        OpenVINO Python API
+Requires:       %{name}%{?_isa} = %{version}-%{release}
+Requires:       python3-numpy
+
+%description -n python3-%{name}
+OpenVINO Python API allowing users to use the OpenVINO library in their Python
+code. Python API provides bindings to basic and advanced APIs from OpenVINO
+runtime.
+
+
 %prep
 %autosetup -p1
 
@@ -234,6 +251,11 @@ cp -r mlas-d1bc25ec4660cddd87804fcf03b2411b5dfb2e94/* src/plugins/intel_cpu/thir
 tar xf %{SOURCE3}
 cp -r oneDNN-929fe4e5629be2a5e89f1ba13b13458b965ffe57/* src/plugins/intel_gpu/thirdparty/onednn_gpu
 
+# Python bindings: remove openvino-telemetry (not in Fedora)
+# It is present in both pyproject.toml (root) and src/bindings/python/requirements.txt
+sed -i '/openvino-telemetry/d' pyproject.toml
+sed -i '/openvino-telemetry/d' src/bindings/python/requirements.txt
+
 
 %build
 %cmake \
@@ -256,7 +278,9 @@ cp -r oneDNN-929fe4e5629be2a5e89f1ba13b13458b965ffe57/* src/plugins/intel_gpu/th
       -DENABLE_INTEL_NPU=OFF \
       -DENABLE_TEMPLATE=OFF \
       -DENABLE_PROXY=OFF \
-      -DENABLE_PYTHON=OFF \
+      -DENABLE_PYTHON=ON \
+      -DPython3_EXECUTABLE=%{python3} \
+      -DENABLE_WHEEL=OFF \
       -DENABLE_JS=OFF \
       -DENABLE_SAMPLES=ON \
       -DENABLE_TESTS=OFF \
@@ -283,12 +307,31 @@ rm -rf %{buildroot}%{_prefix}/install_dependencies \
 rm -rf %{buildroot}%{_datadir}/licenses/*
 rm -rf %{buildroot}%{_datadir}/doc
 
+# Install Python components directly (CPACK_GENERATOR=RPM marks them EXCLUDE_FROM_ALL
+# for the default cmake install, but explicit --component bypasses that)
+cmake --install %{__cmake_builddir} --prefix %{buildroot}%{_prefix} \
+      --component pyopenvino_python%{python3_version}
+cmake --install %{__cmake_builddir} --prefix %{buildroot}%{_prefix} \
+      --component ovc
+cmake --install %{__cmake_builddir} --prefix %{buildroot}%{_prefix} \
+      --component benchmark_app
+
+# Generate dist-info metadata (dist_info does not trigger cmake sub-builds)
+WHEEL_VERSION=%{version} \
+    %{python3} setup.py dist_info -o %{buildroot}%{python3_sitearch}
+
+# Remove openvino-telemetry (not packaged in Fedora)
+rm -rf %{buildroot}%{python3_sitearch}/openvino_telemetry*
+rm -vf %{buildroot}%{python3_sitearch}/requirements.txt
+rm -vf %{buildroot}%{python3_sitearch}/%{name}/preprocess/torchvision/requirements.txt
+
 
 %check
-# Verify the core OpenVINO shared libraries load without unresolved symbols
-export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
-ldd %{buildroot}%{_libdir}/libopenvino.so.%{version}
-ldd %{buildroot}%{_libdir}/libopenvino_c.so.%{version}
+LD_LIBRARY_PATH=%{buildroot}%{_libdir} PYTHONPATH=%{buildroot}%{python3_sitearch} \
+    %{python3} samples/python/hello_query_device/hello_query_device.py
+LD_LIBRARY_PATH=%{buildroot}%{_libdir} PYTHONPATH=%{buildroot}%{python3_sitearch} \
+    %{python3} samples/python/model_creation_sample/model_creation_sample.py \
+    samples/python/model_creation_sample/lenet.bin CPU
 
 
 %ldconfig_scriptlets
@@ -365,5 +408,10 @@ ldd %{buildroot}%{_libdir}/libopenvino_c.so.%{version}
 %{_datadir}/openvino/samples/
 
 
+%files -n python3-%{name}
+%{python3_sitearch}/%{name}
+%{python3_sitearch}/%{name}-%{version}.dist-info
+
+
 %changelog
 %autochangelog

                 reply	other threads:[~2026-06-10 16:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178111077068.1.16880199807822753805.rpms-openvino-62715ed6e54c@fedoraproject.org \
    --to=artyom.anokhov@intel.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox