Skip to content

Commit

Permalink
Preparation for python debian package (#13800)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov committed Nov 3, 2022
1 parent a9a064b commit a5a9698
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 29 deletions.
6 changes: 1 addition & 5 deletions cmake/developer_package/packaging/debian.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ macro(ov_debian_cpack_set_dirs)
set(OV_CPACK_NGRAPH_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/ngraph${OpenVINO_VERSION})
set(OV_CPACK_OPENVINO_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/openvino${OpenVINO_VERSION})
set(OV_CPACK_DOCDIR ${CMAKE_INSTALL_DATADIR}/doc/openvino-${OpenVINO_VERSION})

ov_get_pyversion(pyversion)
if(pyversion)
set(OV_CPACK_PYTHONDIR ${CMAKE_INSTALL_LIBDIR}/${pyversion}/site-packages)
endif()
set(OV_CPACK_PYTHONDIR lib/python3/dist-packages)

# non-native stuff
set(OV_CPACK_SHAREDIR ${CMAKE_INSTALL_DATADIR}/openvino) # internal
Expand Down
33 changes: 24 additions & 9 deletions cmake/packaging/debian.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,28 @@ macro(ov_cpack_settings)

if(ENABLE_PYTHON)
ov_get_pyversion(pyversion)
set(python_component "${OV_CPACK_COMP_PYTHON_OPENVINO}_${pyversion}")
string(TOUPPER "${pyversion}" pyversion)

set(CPACK_COMPONENT_PYOPENVINO_${pyversion}_DESCRIPTION "OpenVINO Python bindings")
if(installed_plugins)
set(CPACK_COMPONENT_PYOPENVINO_${pyversion}_DEPENDS "${installed_plugins}")
else()
set(CPACK_COMPONENT_PYOPENVINO_${pyversion}_DEPENDS "${OV_CPACK_COMP_CORE}")
endif()
set(CPACK_COMPONENT_PYOPENVINO_${pyversion}_DEPENDS "${OV_CPACK_COMP_CORE}")
list(APPEND CPACK_COMPONENT_PYOPENVINO_${pyversion}_DEPENDS ${installed_plugins})
list(APPEND CPACK_COMPONENT_PYOPENVINO_${pyversion}_DEPENDS ${frontends})

set(CPACK_DEBIAN_PYOPENVINO_${pyversion}_PACKAGE_NAME "libopenvino-python-${cpack_name_ver}")
set(CPACK_DEBIAN_PYOPENVINO_${pyversion}_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}")
set(CPACK_DEBIAN_PYOPENVINO_${pyversion}_PACKAGE_DEPENDS "python3")

# TODO: fix all the warnings
ov_debian_add_lintian_suppression(${python_component}
# usr/lib/python3/dist-packages/requirements.txt
"unknown-file-in-python-module-directory"
# usr/lib/python3/dist-packages/openvino/inference_engine/__init__.py
"executable-not-elf-or-script"
# all directories
"non-standard-dir-perm"
# all python files
"non-standard-file-perm")
endif()

#
Expand All @@ -308,10 +320,13 @@ macro(ov_cpack_settings)
set(CPACK_DEBIAN_SAMPLES_PACKAGE_ARCHITECTURE "all")

# python_samples
set(CPACK_COMPONENT_PYTHON_SAMPLES_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit Python Samples")
set(CPACK_DEBIAN_PYTHON_SAMPLES_PACKAGE_NAME "openvino-samples-python-${cpack_name_ver}")
set(CPACK_DEBIAN_PYTHON_SAMPLES_PACKAGE_DEPENDS "python3")
set(CPACK_DEBIAN_PYTHON_SAMPLES_PACKAGE_ARCHITECTURE "all")
if(ENABLE_PYTHON)
set(CPACK_COMPONENT_PYTHON_SAMPLES_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit Python Samples")
set(CPACK_COMPONENT_PYTHON_SAMPLES_DEPENDS "${python_component}")
set(CPACK_DEBIAN_PYTHON_SAMPLES_PACKAGE_NAME "openvino-samples-python-${cpack_name_ver}")
set(CPACK_DEBIAN_PYTHON_SAMPLES_PACKAGE_DEPENDS "python3")
set(CPACK_DEBIAN_PYTHON_SAMPLES_PACKAGE_ARCHITECTURE "all")
endif()

#
# Add umbrella packages
Expand Down
30 changes: 16 additions & 14 deletions cmake/packaging/rpm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ macro(ov_cpack_settings)
# hetero
if(ENABLE_HETERO)
set(CPACK_COMPONENT_HETERO_DESCRIPTION "OpenVINO Hetero plugin")
set(CPACK_COMPONENT_HETERO_DEPENDS "core")
set(CPACK_COMPONENT_HETERO_DEPENDS "${OV_CPACK_COMP_CORE}")
set(CPACK_RPM_HETERO_PACKAGE_NAME "libopenvino-hetero-plugin-${cpack_name_ver}")
_ov_add_plugin(hetero ON)
endif()

# auto batch
if(ENABLE_AUTO_BATCH)
set(CPACK_COMPONENT_BATCH_DESCRIPTION "OpenVINO Automatic Batching plugin")
set(CPACK_COMPONENT_BATCH_DEPENDS "core")
set(CPACK_COMPONENT_BATCH_DEPENDS "${OV_CPACK_COMP_CORE}")
set(CPACK_RPM_BATCH_PACKAGE_NAME "libopenvino-auto-batch-plugin-${cpack_name_ver}")
_ov_add_plugin(batch ON)
endif()
Expand All @@ -149,12 +149,12 @@ macro(ov_cpack_settings)
else()
set(CPACK_COMPONENT_MULTI_DESCRIPTION "OpenVINO Multi plugin")
endif()
set(CPACK_COMPONENT_MULTI_DEPENDS "core")
set(CPACK_COMPONENT_MULTI_DEPENDS "${OV_CPACK_COMP_CORE}")
set(CPACK_RPM_MULTI_PACKAGE_NAME "libopenvino-auto-plugin-${cpack_name_ver}")
_ov_add_plugin(multi ON)
elseif(ENABLE_AUTO)
set(CPACK_COMPONENT_AUTO_DESCRIPTION "OpenVINO Auto plugin")
set(CPACK_COMPONENT_AUTO_DEPENDS "core")
set(CPACK_COMPONENT_AUTO_DEPENDS "${OV_CPACK_COMP_CORE}")
set(CPACK_RPM_AUTO_PACKAGE_NAME "libopenvino-auto-plugin-${cpack_name_ver}")
_ov_add_plugin(auto ON)
endif()
Expand All @@ -166,15 +166,15 @@ macro(ov_cpack_settings)
else()
set(CPACK_COMPONENT_CPU_DESCRIPTION "ARM CPU")
endif()
set(CPACK_COMPONENT_CPU_DEPENDS "core")
set(CPACK_COMPONENT_CPU_DEPENDS "${OV_CPACK_COMP_CORE}")
set(CPACK_RPM_CPU_PACKAGE_NAME "libopenvino-intel-cpu-plugin-${cpack_name_ver}")
_ov_add_plugin(cpu OFF)
endif()

# intel-gpu
if(ENABLE_INTEL_GPU)
set(CPACK_COMPONENT_GPU_DESCRIPTION "Intel® Processor Graphics")
set(CPACK_COMPONENT_GPU_DEPENDS "core")
set(CPACK_COMPONENT_GPU_DEPENDS "${OV_CPACK_COMP_CORE}")
set(CPACK_RPM_GPU_PACKAGE_NAME "libopenvino-intel-gpu-plugin-${cpack_name_ver}")
# auto batch exhances GPU
# set(CPACK_RPM_BATCH_PACKAGE_ENHANCES "${CPACK_RPM_GPU_PACKAGE_NAME} = (${cpack_full_ver})")
Expand All @@ -184,15 +184,15 @@ macro(ov_cpack_settings)
# intel-myriad
if(ENABLE_INTEL_MYRIAD)
set(CPACK_COMPONENT_MYRIAD_DESCRIPTION "Intel® Movidius™ VPU")
set(CPACK_COMPONENT_MYRIAD_DEPENDS "core")
set(CPACK_COMPONENT_MYRIAD_DEPENDS "${OV_CPACK_COMP_CORE}")
set(CPACK_RPM_MYRIAD_PACKAGE_NAME "libopenvino-intel-vpu-plugin-${cpack_name_ver}")
_ov_add_plugin(myriad OFF)
endif()

# intel-gna
if(ENABLE_INTEL_GNA AND "gna" IN_LIST CPACK_COMPONENTS_ALL)
set(CPACK_COMPONENT_GNA_DESCRIPTION "Intel® Gaussian Neural Accelerator")
set(CPACK_COMPONENT_GNA_DEPENDS "core")
set(CPACK_COMPONENT_GNA_DEPENDS "${OV_CPACK_COMP_CORE}")
set(CPACK_RPM_GNA_PACKAGE_NAME "libopenvino-intel-gna-plugin-${cpack_name_ver}")
_ov_add_plugin(gna OFF)
endif()
Expand Down Expand Up @@ -264,14 +264,15 @@ macro(ov_cpack_settings)

if(ENABLE_PYTHON)
ov_get_pyversion(pyversion)
set(python_component "${OV_CPACK_COMP_PYTHON_OPENVINO}_${pyversion}")
string(TOUPPER "${pyversion}" pyversion)

set(CPACK_COMPONENT_PYOPENVINO_${pyversion}_DESCRIPTION "OpenVINO Python bindings")
if(installed_plugins)
set(CPACK_COMPONENT_PYOPENVINO_${pyversion}_DEPENDS "${installed_plugins}")
else()
set(CPACK_COMPONENT_PYOPENVINO_${pyversion}_DEPENDS "core")
endif()
set(CPACK_COMPONENT_PYOPENVINO_${pyversion}_DEPENDS "${OV_CPACK_COMP_CORE}")
list(APPEND CPACK_COMPONENT_PYOPENVINO_${pyversion}_DEPENDS ${installed_plugins})
list(APPEND CPACK_COMPONENT_PYOPENVINO_${pyversion}_DEPENDS ${frontends})
set(CPACK_RPM_PYOPENVINO_${pyversion}_PACKAGE_REQUIRES "python3")

set(CPACK_RPM_PYOPENVINO_${pyversion}_PACKAGE_NAME "libopenvino-python-${cpack_name_ver}")
endif()

Expand Down Expand Up @@ -303,6 +304,7 @@ macro(ov_cpack_settings)
# python_samples
if(ENABLE_PYTHON)
set(CPACK_COMPONENT_PYTHON_SAMPLES_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit Python Samples")
set(CPACK_COMPONENT_PYTHON_SAMPLES_DEPENDS "${python_component}")
set(CPACK_RPM_PYTHON_SAMPLES_PACKAGE_NAME "openvino-samples-python-${cpack_name_ver}")
set(CPACK_RPM_PYTHON_SAMPLES_PACKAGE_REQUIRES "python3")
set(CPACK_RPM_PYTHON_SAMPLES_PACKAGE_ARCHITECTURE "noarch")
Expand All @@ -317,7 +319,7 @@ macro(ov_cpack_settings)
if(installed_plugins)
set(CPACK_COMPONENT_LIBRARIES_DEPENDS "${installed_plugins}")
else()
set(CPACK_COMPONENT_LIBRARIES_DEPENDS "core")
set(CPACK_COMPONENT_LIBRARIES_DEPENDS "${OV_CPACK_COMP_CORE}")
endif()
set(CPACK_RPM_LIBRARIES_PACKAGE_NAME "openvino-libraries-${cpack_name_ver}")
set(CPACK_RPM_LIBRARIES_PACKAGE_ARCHITECTURE "noarch")
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/python/wheel/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
setuptools>=53.0.0
wheel>=0.36.2
patchelf; sys_platform == 'linux'
patchelf; sys_platform == 'linux' and platform_machine == 'x86_64'

0 comments on commit a5a9698

Please sign in to comment.