Skip to content

Commit

Permalink
[Python API] Move wheel folder to the python dir (openvinotoolkit#9125)
Browse files Browse the repository at this point in the history
* [Python API] Move wheel folder to the python dir

* codestyle files

* one more codestyle

* align with master

* ignore some flake8 comments
  • Loading branch information
akuporos authored Jan 11, 2022
1 parent ddc4098 commit ab09135
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .ci/azure/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
# For opencv-python: python3-setuptools and pip upgrade
python3 -m pip install --upgrade pip
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/requirements.txt
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/wheel/requirements-dev.txt
python3 -m pip install -r $(REPO_DIR)/src/bindings/python/wheel/requirements-dev.txt
# For running Python API tests
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/src/requirements-dev.txt
# For running Paddle frontend unit tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/py_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ jobs:
path: src_diff.diff
- name: Run Flake on wheel
run: python -m flake8 ./ --config=../setup.cfg
working-directory: inference-engine/ie_bridges/python/wheel
working-directory: src/bindings/python/wheel
- name: Create code style diff for wheel
if: failure()
run: |
python -m black -l 160 -S ./
git diff > wheel_diff.diff
working-directory: inference-engine/ie_bridges/python/wheel
working-directory: src/bindings/python/wheel
- uses: actions/upload-artifact@v2
if: failure()
with:
Expand Down
4 changes: 0 additions & 4 deletions inference-engine/ie_bridges/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ endfunction()
set (PYTHON_BRIDGE_SRC_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory (src/openvino/inference_engine)

if(ENABLE_WHEEL)
add_subdirectory(wheel)
endif()

if(TARGET _pyngraph)
add_dependencies(ie_api _pyngraph)
endif()
Expand Down
4 changes: 4 additions & 0 deletions src/bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ set(LIBRARY_OUTPUT_DIRECTORY_BIN ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})

add_subdirectory(src)

if(ENABLE_WHEEL)
add_subdirectory(wheel)
endif()

if(ENABLE_OV_CORE_UNIT_TESTS)
add_subdirectory(tests/mock/ov_mock_py_frontend)
add_dependencies(pyopenvino ov_mock_py_frontend)
Expand Down
23 changes: 23 additions & 0 deletions src/bindings/python/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[flake8]
filename = *.py, *.pyx
max-line-length = 160
ignore = E203
max-parameters-amount = 8
show_source = True
docstring-convention = google
enable-extensions = G
per-file-ignores =
*.pyx: E225, E226, E251, E999, E800, E265, E203, E266, E227, E211
tests/*: S101, T001
*__init__.py: F403, F405, F405

[pydocstyle]
convention = google

[mypy]
ignore_missing_imports = True
disable_error_code = attr-defined
show_column_numbers = True
show_error_context = True
show_absolute_path = True
pretty = True
3 changes: 1 addition & 2 deletions src/bindings/python/src/compatibility/ngraph/opset8/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,7 @@ def detection_output(

@nameable_op
def softmax(data: NodeInput, axis: int, name: Optional[str] = None) -> Node:
"""
Apply softmax operation on each element of input tensor.
"""Apply softmax operation on each element of input tensor.
@param data: The tensor providing input data.
@param axis: An axis along which Softmax should be calculated. Can be positive or negative.
Expand Down
1 change: 1 addition & 0 deletions src/bindings/python/src/openvino/runtime/ie_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def __init__(self):
any = OVAny(Test())
print(any.value.data)
@endcode
"""

def __getitem__(self, key: Union[str, int]) -> Any:
Expand Down
3 changes: 1 addition & 2 deletions src/bindings/python/src/openvino/runtime/opset8/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,8 +782,7 @@ def detection_output(

@nameable_op
def softmax(data: NodeInput, axis: int, name: Optional[str] = None) -> Node:
"""
Apply softmax operation on each element of input tensor.
"""Apply softmax operation on each element of input tensor.
@param data: The tensor providing input data.
@param axis: An axis along which Softmax should be calculated. Can be positive or negative.
Expand Down
4 changes: 2 additions & 2 deletions src/bindings/python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ commands=
{envbindir}/python setup.py bdist_wheel
{envbindir}/pip install --no-index --pre --find-links=dist/ openvino
flake8 {posargs:src/ setup.py}
flake8 --ignore=D100,D101,D102,D103,D104,D105,D107,W503 tests/ tests_compatibility/ # ignore lack of docs in tests
flake8 --ignore=D100,D101,D102,D103,D104,D105,D107,D212,W503 tests/ tests_compatibility/ # ignore lack of docs in tests
mypy --config-file=tox.ini {posargs:src/}
pytest --backend={env:NGRAPH_BACKEND} tests -v -k 'not _cuda' --ignore=tests/test_onnx/test_zoo_models.py --ignore=tests/test_utils --ignore=tests/test_inference_engine
pytest --backend={env:NGRAPH_BACKEND} tests_compatibility -v -k 'not _cuda' --ignore=tests_compatibility/test_onnx/test_zoo_models.py
Expand Down Expand Up @@ -46,7 +46,7 @@ max-complexity=7
# D412 - No blank lines allowed between a section header and its content
# F401 - module imported but unused
# W503 - line break before binary operator (prefer line breaks before op, not after)
ignore=D100,D104,D105,D107,D412,F401,W503
ignore=D100,D104,D105,D107,D410,D411,D412,F401,W503
[mypy]
ignore_missing_imports=True
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#

find_package(PythonInterp 3 REQUIRED)
set(PYTHON_VERSION python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
set(WHEEL_VERSION "${IE_VERSION}" CACHE STRING "Version of this release" FORCE)
set(WHEEL_BUILD "${IE_VERSION_BUILD}" CACHE STRING "Build number of this release" FORCE)
set(PYTHON_BRIDGE_CPACK_PATH "python")
set(PY_PACKAGES_DIR ${PYTHON_BRIDGE_CPACK_PATH}/${PYTHON_VERSION})
set(TBB_LIBS_DIR runtime/3rdparty/tbb/lib)
if(WIN32)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ab09135

Please sign in to comment.