[Python API] Move wheel folder to the python dir (#9125)
* [Python API] Move wheel folder to the python dir * codestyle files * one more codestyle * align with master * ignore some flake8 comments
This commit is contained in:
committed by
GitHub
parent
ddc4098473
commit
ab09135195
@@ -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
|
||||
|
||||
4
.github/workflows/py_checks.yml
vendored
4
.github/workflows/py_checks.yml
vendored
@@ -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:
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
23
src/bindings/python/setup.cfg
Normal file
23
src/bindings/python/setup.cfg
Normal file
@@ -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
|
||||
@@ -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.
|
||||
|
||||
@@ -167,6 +167,7 @@ class OVAny(OVAnyBase):
|
||||
any = OVAny(Test())
|
||||
print(any.value.data)
|
||||
@endcode
|
||||
|
||||
"""
|
||||
|
||||
def __getitem__(self, key: Union[str, int]) -> Any:
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user