Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[CI] [GHA] Enable testing of Python 3.12 on Ubuntu 24 (#26466)

Andrei Kashchikhin3f0bd0f5cd75
diff --git a/.github/workflows/job_python_unit_tests.yml b/.github/workflows/job_python_unit_tests.yml
index f793860958f..81767c7805f 100644
--- a/.github/workflows/job_python_unit_tests.yml
+++ b/.github/workflows/job_python_unit_tests.yml
@@ -16,12 +16,15 @@ on:
description: 'Components that are affected by changes in the commit defined by the Smart CI Action'
type: string
required: true
+ python-version:
+ description: 'Python version to setup. E.g., "3.11"'
+ type: string
+ required: true
permissions: read-all
env:
PIP_CACHE_PATH: /mount/caches/pip/linux
- PYTHON_VERSION: '3.11'
jobs:
Python_Unit_Tests:
@@ -77,10 +80,10 @@ jobs:
sparse-checkout-cone-mode: false
path: 'action_root'
- - name: Setup Python ${{ env.PYTHON_VERSION }}
+ - name: Setup Python ${{ inputs.python-version }}
uses: ./action_root/.github/actions/setup_python
with:
- version: ${{ env.PYTHON_VERSION }}
+ version: ${{ inputs.python-version }}
pip-cache-path: ${{ runner.os == 'Linux' && env.PIP_CACHE_PATH || '' }}
should-setup-pip-paths: ${{ runner.os == 'Linux' }}
self-hosted-runner: ${{ runner.os == 'Linux' }}
@@ -231,7 +234,7 @@ jobs:
PYTORCH_TRACING_MODE: TORCHFX
- name: ONNX Layer Tests
- if: fromJSON(inputs.affected-components).ONNX_FE.test
+ if: ${{ fromJSON(inputs.affected-components).ONNX_FE.test }}
run: |
# requires 'unit_tests' from 'tools/mo'
export PYTHONPATH=${INSTALL_TEST_DIR}/mo:$PYTHONPATH
@@ -296,7 +299,7 @@ jobs:
python3 ${OPENVINO_REPO}/docs/articles_en/assets/snippets/main.py
- name: Python API Tests -- numpy>=2.0.0
- if: ${{ fromJSON(inputs.affected-components).Python_API.test }}
+ if: ${{ fromJSON(inputs.affected-components).Python_API.test && inputs.python-version != '3.12' }} # Ticket: 152242
run: |
python3 -m pip uninstall -y numpy
python3 -m pip install "numpy>=2.0.0,<2.1.0"
diff --git a/.github/workflows/linux_arm64.yml b/.github/workflows/linux_arm64.yml
index a447c418977..41d0837e0e4 100644
--- a/.github/workflows/linux_arm64.yml
+++ b/.github/workflows/linux_arm64.yml
@@ -17,7 +17,6 @@ permissions: read-all
env:
PIP_CACHE_PATH: /mount/caches/pip/linux
- PYTHON_VERSION: '3.11'
jobs:
Smart_CI:
@@ -388,6 +387,7 @@ jobs:
runner: 'aks-linux-16-cores-arm'
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_20_04_arm64 }}", "volumes": ["/mount:/mount"]}'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
+ python-version: '3.11'
TensorFlow_Layer_Tests:
name: TensorFlow Layer Tests
diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml
index ca1d804a0c4..715380811d6 100644
--- a/.github/workflows/mac.yml
+++ b/.github/workflows/mac.yml
@@ -267,6 +267,7 @@ jobs:
with:
runner: 'macos-13'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
+ python-version: '3.11'
TensorFlow_Layer_Tests:
name: TensorFlow Layer Tests
diff --git a/.github/workflows/mac_arm64.yml b/.github/workflows/mac_arm64.yml
index efcbc56fb2c..2615fe16316 100644
--- a/.github/workflows/mac_arm64.yml
+++ b/.github/workflows/mac_arm64.yml
@@ -266,6 +266,7 @@ jobs:
with:
runner: 'macos-13-xlarge'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
+ python-version: '3.11'
TensorFlow_Layer_Tests:
name: TensorFlow Layer Tests
diff --git a/.github/workflows/ubuntu_22.yml b/.github/workflows/ubuntu_22.yml
index 187a42a3bf8..54410acdf71 100644
--- a/.github/workflows/ubuntu_22.yml
+++ b/.github/workflows/ubuntu_22.yml
@@ -296,6 +296,7 @@ jobs:
runner: 'aks-linux-4-cores-16gb'
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_22_04_x64 }}", "volumes": ["/mount:/mount"]}'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
+ python-version: '3.11'
TensorFlow_Layer_Tests:
name: TensorFlow Layer Tests
diff --git a/.github/workflows/ubuntu_24.yml b/.github/workflows/ubuntu_24.yml
index ce55afe426b..a0e1b314391 100644
--- a/.github/workflows/ubuntu_24.yml
+++ b/.github/workflows/ubuntu_24.yml
@@ -17,7 +17,6 @@ permissions: read-all
env:
PIP_CACHE_PATH: /mount/caches/pip/linux
- PYTHON_VERSION: '3.11'
jobs:
Smart_CI:
@@ -115,9 +114,19 @@ jobs:
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64 }}", "volumes": ["/mount:/mount"]}'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
+ Python_Unit_Tests:
+ name: Python unit tests
+ needs: [ Docker, Build, Smart_CI ]
+ uses: ./.github/workflows/job_python_unit_tests.yml
+ with:
+ runner: 'aks-linux-4-cores-16gb'
+ container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64 }}", "volumes": ["/mount:/mount"]}'
+ affected-components: ${{ needs.smart_ci.outputs.affected_components }}
+ python-version: '3.12'
+
Overall_Status:
name: ci/gha_overall_status_ubuntu_24
- needs: [Smart_CI, Build, Debian_Packages, Samples]
+ needs: [Smart_CI, Build, Debian_Packages, Samples, Python_Unit_Tests]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
diff --git a/tests/layer_tests/ovc_python_api_tests/test_ovc_cli_tool.py b/tests/layer_tests/ovc_python_api_tests/test_ovc_cli_tool.py
index 422c4bdb743..8ca07fd2334 100644
--- a/tests/layer_tests/ovc_python_api_tests/test_ovc_cli_tool.py
+++ b/tests/layer_tests/ovc_python_api_tests/test_ovc_cli_tool.py
@@ -141,6 +141,10 @@ class TestOVCTool(unittest.TestCase):
flag, msg = compare_functions(ov_model, create_ref_graph(), False)
assert flag, msg
+ @unittest.skipIf(
+ (sys.version_info[0], sys.version_info[1]) == (3, 12),
+ 'Ticket: 152216'
+ )
def test_ovc_tool_saved_model_dir(self):
from openvino.runtime import Core
core = Core()
@@ -154,6 +158,10 @@ class TestOVCTool(unittest.TestCase):
flag, msg = compare_functions(ov_model, ref_model, False)
assert flag, msg
+ @unittest.skipIf(
+ (sys.version_info[0], sys.version_info[1]) == (3, 12),
+ 'Ticket: 152216'
+ )
def test_ovc_tool_saved_model_dir_with_sep_at_path_end(self):
from openvino.runtime import Core
core = Core()
@@ -167,6 +175,10 @@ class TestOVCTool(unittest.TestCase):
flag, msg = compare_functions(ov_model, ref_model, False)
assert flag, msg
+ @unittest.skipIf(
+ (sys.version_info[0], sys.version_info[1]) == (3, 12),
+ 'Ticket: 152216'
+ )
def test_ovc_tool_non_existng_output_dir(self):
from openvino.runtime import Core
core = Core()
@@ -180,7 +192,10 @@ class TestOVCTool(unittest.TestCase):
flag, msg = compare_functions(ov_model, ref_model, False)
assert flag, msg
-
+ @unittest.skipIf(
+ (sys.version_info[0], sys.version_info[1]) == (3, 12),
+ 'Ticket: 152216'
+ )
def test_ovc_tool_verbose(self):
from openvino.runtime import Core
core = Core()
diff --git a/tests/layer_tests/ovc_python_api_tests/test_tf.py b/tests/layer_tests/ovc_python_api_tests/test_tf.py
index 8a89782c4d1..e1859297fe1 100644
--- a/tests/layer_tests/ovc_python_api_tests/test_tf.py
+++ b/tests/layer_tests/ovc_python_api_tests/test_tf.py
@@ -3,6 +3,7 @@
import numpy as np
import openvino.runtime as ov
import os
+import sys
import pytest
import tempfile
import tensorflow as tf
@@ -731,6 +732,10 @@ class TestMoConvertTF(CommonMOConvertTest):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.skipif(
+ condition=(sys.version_info[0], sys.version_info[1]) == (3, 12),
+ reason='Ticket: 152216'
+ )
def test_unnamed_saved_model_dir(self, ie_device, precision, ir_version, temp_dir):
saved_model_dir, graph_ref = create_tf_saved_model_dir(temp_dir)
@@ -1148,6 +1153,10 @@ class TestOutputTensorName(unittest.TestCase):
@pytest.mark.nightly
@pytest.mark.precommit
+ @pytest.mark.skipif(
+ condition=(sys.version_info[0], sys.version_info[1]) == (3, 12),
+ reason='Ticket: 152216'
+ )
def test_tf2_from_file_single_tensor_name(self):
tf.keras.backend.clear_session()
tf.compat.v1.reset_default_graph()
diff --git a/tools/mo/unit_tests/mo/ops/elementwise_test.py b/tools/mo/unit_tests/mo/ops/elementwise_test.py
index fafd47fdd6d..cd47b78c6b8 100644
--- a/tools/mo/unit_tests/mo/ops/elementwise_test.py
+++ b/tools/mo/unit_tests/mo/ops/elementwise_test.py
@@ -114,7 +114,7 @@ class TestElementwiseTypeAlignment(unittest.TestCase):
type_infer(graph)
const_node = Node(graph, 'const')
- self.assertEquals(const_node.out_port(0).get_data_type(), np.float32)
+ self.assertEqual(const_node.out_port(0).get_data_type(), np.float32)
def test_second_input_const(self):
edges = [
@@ -126,7 +126,7 @@ class TestElementwiseTypeAlignment(unittest.TestCase):
type_infer(graph)
const_node = Node(graph, 'const')
- self.assertEquals(const_node.out_port(0).get_data_type(), np.float32)
+ self.assertEqual(const_node.out_port(0).get_data_type(), np.float32)
def test_raises(self):
edges = [
@@ -148,4 +148,4 @@ class TestElementwiseTypeAlignment(unittest.TestCase):
type_infer(graph)
add_node = Node(graph, 'add')
- self.assertEquals(add_node.out_port(0).get_data_type(), np.float32)
+ self.assertEqual(add_node.out_port(0).get_data_type(), np.float32)