[MO] Add CMake install for Model Optimizer (28291) (#2831)
* [MO] Add CMake install for Model Optimizer * [MO] Update test for version.py * [MO] Add CMake install for Model Optimizer * [MO] Update test for version.py * [MO] Add CMake install for Model Optimizer * [MO] Update test for version.py * [MO] fix file permissions for install location
This commit is contained in:
parent
4ce6e3414c
commit
93342f0860
11
.github/workflows/mo.yml
vendored
11
.github/workflows/mo.yml
vendored
@ -12,6 +12,9 @@ jobs:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
@ -37,12 +40,20 @@ jobs:
|
||||
# MO requirements
|
||||
pip install -r requirements.txt
|
||||
pip install -r requirements_dev.txt
|
||||
# requrements for CMake
|
||||
sudo apt --assume-yes install libusb-1.0-0-dev
|
||||
working-directory: model-optimizer
|
||||
|
||||
- name: Pylint
|
||||
run: pylint -d C,R,W mo/ mo.py extensions/
|
||||
working-directory: model-optimizer
|
||||
|
||||
- name: CMake
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
|
||||
- name: UT
|
||||
run: |
|
||||
export PYTHONPATH=$PYTHONPATH:`pwd`
|
||||
|
@ -126,6 +126,7 @@ build_ngraph()
|
||||
|
||||
add_subdirectory(inference-engine)
|
||||
|
||||
add_subdirectory(model-optimizer)
|
||||
add_subdirectory(docs)
|
||||
|
||||
#
|
||||
|
43
model-optimizer/CMakeLists.txt
Normal file
43
model-optimizer/CMakeLists.txt
Normal file
@ -0,0 +1,43 @@
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
# install
|
||||
ie_cpack_add_component(model_optimizer REQUIRED)
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/automation/version.txt.in"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/version.txt"
|
||||
@ONLY)
|
||||
|
||||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
|
||||
DESTINATION deployment_tools/model_optimizer
|
||||
USE_SOURCE_PERMISSIONS
|
||||
COMPONENT model_optimizer
|
||||
PATTERN ".*" EXCLUDE
|
||||
PATTERN "automation" EXCLUDE
|
||||
PATTERN "requirements_dev.txt" EXCLUDE
|
||||
PATTERN "README.md" EXCLUDE
|
||||
PATTERN "CMakeLists.txt" EXCLUDE
|
||||
|
||||
PATTERN "extensions/front/caffe/CustomLayersMapping.xml" EXCLUDE
|
||||
PATTERN "mo/utils/convert.py" EXCLUDE
|
||||
PATTERN "mo/utils/unittest" EXCLUDE
|
||||
|
||||
REGEX ".*__pycache__.*" EXCLUDE
|
||||
REGEX ".*\\.pyc$" EXCLUDE
|
||||
REGEX ".*\\.swp" EXCLUDE
|
||||
REGEX ".*\\.DS_Store$" EXCLUDE
|
||||
REGEX ".*_test\.py$" EXCLUDE
|
||||
)
|
1
model-optimizer/automation/version.txt.in
Normal file
1
model-optimizer/automation/version.txt.in
Normal file
@ -0,0 +1 @@
|
||||
@CI_BUILD_NUMBER@
|
@ -24,7 +24,7 @@ from mo.utils.version import get_version
|
||||
|
||||
class TestingVersion(unittest.TestCase):
|
||||
def test_unknown_version(self):
|
||||
self.assertEqual(get_version(), "unknown version")
|
||||
self.assertNotEqual(get_version(), "unknown version")
|
||||
|
||||
@patch('os.path.isfile')
|
||||
@mock.patch('builtins.open', new_callable=mock_open, create=True, read_data='2021.1.0-1028-55e4d5673a8')
|
||||
|
Loading…
Reference in New Issue
Block a user