Skip to content

Commit

Permalink
fix azure ci
Browse files Browse the repository at this point in the history
  • Loading branch information
akuporos committed Sep 17, 2021
1 parent 784c63f commit a977ddc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
5 changes: 4 additions & 1 deletion .ci/azure/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ jobs:
continueOnError: false

# Skip test_onnx/test_zoo_models and test_onnx/test_backend due to long execution time
- script: . $(SETUPVARS) -pyver 3.8 && python3 -m pytest -s $(INSTALL_TEST_DIR)/pyngraph --junitxml=TEST-Pyngraph.xml --ignore=$(INSTALL_TEST_DIR)/pyngraph/tests/test_onnx/test_zoo_models.py --ignore=$(INSTALL_TEST_DIR)/pyngraph/tests/test_onnx/test_backend.py
- script: |
export DATA_PATH=$(MODELS_PATH)
export MODELS_PATH=$(MODELS_PATH)
. $(SETUPVARS) -pyver 3.8 && python3 -m pytest -s $(INSTALL_TEST_DIR)/pyngraph --junitxml=TEST-Pyngraph.xml --ignore=$(INSTALL_TEST_DIR)/pyngraph/tests/test_onnx/test_zoo_models.py --ignore=$(INSTALL_TEST_DIR)/pyngraph/tests/test_onnx/test_backend.py
displayName: 'nGraph Python Bindings Tests'
continueOnError: false
Expand Down
2 changes: 2 additions & 0 deletions runtime/bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ project(OpenVINOPython DESCRIPTION "OpenVINO Runtime Python bindings")

add_subdirectory(thirdparty/pybind11 EXCLUDE_FROM_ALL)

find_package(PythonLibs 3 REQUIRED)

if(PYTHONLIBS_VERSION_STRING MATCHES "^([0-9]+)\.([0-9]+).*")
set(PYTHON_VERSION python${CMAKE_MATCH_1}.${CMAKE_MATCH_2})
else()
Expand Down
25 changes: 10 additions & 15 deletions runtime/bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
from distutils.command.build import build as _build

__version__ = os.environ.get("NGRAPH_VERSION", "0.0.0.dev0")
PYNGRAPH_ROOT_DIR = os.path.abspath(os.path.dirname(__file__))
OPENVINO_ROOT_DIR = os.path.normpath(os.path.join(PYNGRAPH_ROOT_DIR, "../../.."))
PYTHON_API_ROOT_DIR = os.path.abspath(os.path.dirname(__file__))
PYNGRAPH_ROOT_DIR = os.path.normpath(os.path.join(PYTHON_API_ROOT_DIR, "src", "compatibility"))
OPENVINO_ROOT_DIR = os.path.normpath(os.path.join(PYTHON_API_ROOT_DIR, "../../.."))
# Change current working directory to runtime/bindings/python
os.chdir(PYNGRAPH_ROOT_DIR)

NGRAPH_LIBS = ["ngraph", "onnx_ngraph_frontend", "inference_engine"]
NGRAPH_LIBS = ["ngraph", "onnx_ngraph_frontend"]

packages = [
"ngraph",
Expand All @@ -40,18 +41,16 @@
"ngraph.impl.op.util",
"ngraph.impl.passes",
"ngraph.frontend",
"openvino",
"openvino.inference_engine"
]


data_files = []

with open(os.path.join(PYNGRAPH_ROOT_DIR, "requirements.txt")) as req:
with open(os.path.join(PYTHON_API_ROOT_DIR, "requirements.txt")) as req:
requirements = req.read().splitlines()

cmdclass = {}
for super_class in [_build, _install, _develop]:

class command(super_class):
"""Add user options for build, install and develop commands."""

Expand All @@ -61,6 +60,7 @@ class command(super_class):
("jobs=", None, "Specifies the number of jobs to use with make."),
("cmake-args=", None, "Additional options to be passed to CMake.")
]

def initialize_options(self):
"""Set default values for all the options that this command supports."""
super().initialize_options()
Expand Down Expand Up @@ -130,8 +130,6 @@ def finalize_options(self):
def run(self):
"""Run CMake build for modules."""
for extension in self.extensions:
if extension.name == "pyopenvino":
self.build_cmake(extension)
if extension.name == "_pyngraph":
self.build_cmake(extension)

Expand All @@ -143,8 +141,6 @@ def build_cmake(self, extension: Extension):
build_dir = pathlib.Path(self.build_temp)

extension_path = pathlib.Path(self.get_ext_fullpath(extension.name))
if extension.name == "pyopenvino":
extension_path = pathlib.Path(os.path.join(extension_path.parent.absolute(), "openvino"))

os.makedirs(build_dir, exist_ok=True)
os.makedirs(extension_path.parent.absolute(), exist_ok=True)
Expand All @@ -161,8 +157,7 @@ def build_cmake(self, extension: Extension):
ext_args = self.cmake_args.split() if self.cmake_args else []
self.spawn(["cmake", "-S" + root_dir, "-B" + self.build_temp,
"-DCMAKE_BUILD_TYPE={}".format(self.config),
"-DPYTHON_EXECUTABLE={}".format(sys.executable),
"-DNGRAPH_PYTHON_BUILD_ENABLE=ON",
"-DENABLE_PYTHON=ON",
"-DNGRAPH_ONNX_FRONTEND_ENABLE=ON"] + ext_args)

self.announce("Building binaries", level=3)
Expand Down Expand Up @@ -222,8 +217,8 @@ def run(self):
author="Intel Corporation",
url="https://github.com/openvinotoolkit/openvino",
license="License :: OSI Approved :: Apache Software License",
ext_modules=[CMakeExtension(name="_pyngraph"), CMakeExtension(name="pyopenvino")],
package_dir={"": "src/compatibility"},
ext_modules=[CMakeExtension(name="_pyngraph")],
package_dir={"": ""},
packages=packages,
install_requires=requirements,
data_files=data_files,
Expand Down
1 change: 0 additions & 1 deletion runtime/bindings/python/src/pyopenvino/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ if(OpenVINO_SOURCE_DIR)
add_custom_command(TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../openvino ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${PROJECT_NAME}.*.so ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
)
endif()

Expand Down

0 comments on commit a977ddc

Please sign in to comment.