Skip to content
Merged
6 changes: 5 additions & 1 deletion cmake/developer_package/packaging/packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ endfunction()
function(ov_get_pyversion pyversion)
find_package(Python3 QUIET COMPONENTS Interpreter Develoment.Module)
if(Python3_Interpreter_FOUND)
set(${pyversion} "python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}" PARENT_SCOPE)
set(_pyversion "python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}")
if(Python3_SOABI AND Python3_SOABI MATCHES "cpython-[0-9]+t-")
set(_pyversion "${_pyversion}t")
endif()
set(${pyversion} "${_pyversion}" PARENT_SCOPE)
else()
set(${pyversion} "NOT-FOUND" PARENT_SCOPE)
endif()
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
WHEEL_PACKAGE_DIR = "openvino"
WHEEL_LIBS_INSTALL_DIR = f"{WHEEL_PACKAGE_DIR}/libs"
WHEEL_LIBS_PACKAGE = "openvino.libs"
PYTHON_VERSION = f"python{sys.version_info.major}.{sys.version_info.minor}"

suffix = 't' if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else ''
PYTHON_VERSION = f"python{sys.version_info.major}.{sys.version_info.minor}{suffix}"

LIBS_DIR = "bin" if platform.system() == "Windows" else "lib"

Expand Down
3 changes: 3 additions & 0 deletions src/bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ add_subdirectory(src/pyopenvino)
macro(ov_define_setup_py_packaging_vars)
# Python3_VERSION_MAJOR and Python3_VERSION_MINOR are defined inside pybind11
set(pyversion python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR})
if(Python3_SOABI AND Python3_SOABI MATCHES "cpython-[0-9]+t-")
set(pyversion "${pyversion}t")
endif()

# define version (syncronize with tools/openvino_dev/CMakeLists.txt)
if(DEFINED ENV{CI_BUILD_DEV_TAG} AND NOT "$ENV{CI_BUILD_DEV_TAG}" STREQUAL "")
Expand Down
3 changes: 3 additions & 0 deletions src/bindings/python/src/pyopenvino/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ endif()

# Python3_VERSION_MAJOR and Python3_VERSION_MINOR are defined by FindPython3
set(pyversion python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR})
if(Python3_SOABI AND Python3_SOABI MATCHES "cpython-[0-9]+t-")
set(pyversion "${pyversion}t")
endif()

if(OV_GENERATOR_MULTI_CONFIG)
set(PYTHON_BRIDGE_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$<CONFIG>/python/openvino)
Expand Down
Loading