Skip to content

Commit

Permalink
Don't use complex dependencies in Python API tests (openvinotoolkit#2…
Browse files Browse the repository at this point in the history
…3104)

### Details:
 - Removed frontend dependencies from Python API tests
 - Moved torchvision preprocessing tests to pytorch layer tests folder.

### Tickets:
 - *ticket-id*
  • Loading branch information
ilya-lavrenov authored Feb 28, 2024
1 parent 8d49595 commit 8a272e9
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
8 changes: 0 additions & 8 deletions src/bindings/python/requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
-c ./constraints.txt
protobuf
onnx
numpy
bandit
black
Expand Down Expand Up @@ -38,9 +36,3 @@ retrying
tox
types-pkg_resources
wheel
torch
torchvision; platform_machine == 'arm64' and python_version >= '3.8'
torchvision; platform_machine != 'arm64'
sympy; platform_machine == 'arm64' and python_version >= '3.8'
sympy; platform_machine != 'arm64'
pillow
5 changes: 5 additions & 0 deletions src/bindings/python/tests/test_runtime/test_compiled_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Copyright (C) 2018-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

import sys
import pytest
import numpy as np

Expand Down Expand Up @@ -29,6 +30,10 @@ def test_get_runtime_model(device):
assert isinstance(runtime_model, Model)


@pytest.mark.skipif(
condition=sys.version_info >= (3, 12),
reason="Fails on any Linux platform with Python 3.12. Ticket CVS-133903",
)
def test_export_import(device):
core = Core()

Expand Down
2 changes: 1 addition & 1 deletion src/frontends/paddle/tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PaddlePaddle - generate test models
-c ../../../../src/bindings/python/constraints.txt
-c ../../../bindings/python/constraints.txt
protobuf
numpy
six
Expand Down
1 change: 1 addition & 0 deletions tests/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pymongo>=3.12.0
PyYAML>=5.4.1
scipy>=1.7; python_version <= "3.8"
scipy>=1.11.1; python_version >= "3.9"
sympy>=1.10
wheel>=0.38.1
defusedxml>=0.7.1
fastjsonschema~=2.17.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ def test_normalize():
assert np.max(np.absolute(torch_result - ov_result)) < 4e-05


@pytest.mark.skipif(
condition=platform.machine() in ("arm", "armv7l", "aarch64", "arm64", "ARM64"),
reason="Ticket: 114816",
)
@pytest.mark.parametrize(
("target_size", "interpolation", "tolerance"),
[
Expand All @@ -78,8 +82,6 @@ def test_normalize():
],
)
def test_resize(target_size, interpolation, tolerance):
if platform.machine() in ["arm", "armv7l", "aarch64", "arm64", "ARM64"]:
pytest.skip("Ticket: 114816")
test_input = np.random.randint(255, size=target_size, dtype=np.uint8)
preprocess_pipeline = transforms.Compose(
[
Expand Down Expand Up @@ -219,9 +221,11 @@ def test_pipeline_1():
assert np.max(np.absolute(torch_result - ov_result)) < 4e-05


@pytest.mark.skipif(
condition=platform.machine() in ("arm", "armv7l", "aarch64", "arm64", "ARM64"),
reason="Ticket: 114816",
)
def test_pipeline_2():
if platform.machine() in ["arm", "armv7l", "aarch64", "arm64", "ARM64"]:
pytest.skip("Ticket: 114816")
test_input = np.random.randint(255, size=(224, 224, 3), dtype=np.uint8)
preprocess_pipeline = transforms.Compose(
[
Expand Down
6 changes: 5 additions & 1 deletion tests/layer_tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ numpy
onnxruntime
requests
torch
torchvision
torchvision; platform_machine == 'arm64' and python_version >= '3.8'
torchvision; platform_machine != 'arm64'
sympy; platform_machine == 'arm64' and python_version >= '3.8'
sympy; platform_machine != 'arm64'
transformers
packaging
pillow
pytest
tensorflow-addons; python_version <= '3.10'
jax; sys_platform == "linux" and platform_machine == "x86_64" # https://jax.readthedocs.io/en/latest/installation.html#pip-installation-cpu - wheels are for "x86_64" only
Expand Down

0 comments on commit 8a272e9

Please sign in to comment.