Files
openvino/.github/workflows/py_checks.yml
Ilya Lavrenov 2e7284cfa0 Automatically detect ENABLE_PYTHON, ENABLE_WHEEL default values (#12551)
* Add ENABLE_WHEEL=ON by default

* Adjust CMake options for GitHub checks

* Add ov_check_pip_package and ov_check_pip_packages CMake functions

* revert options

* skip empty lines

* formatting

* fix condition

* check for patchelf

* Add numpy dependency to condition

* Fix error:

    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (gast 0.4.0 (c:\hostedtoolcache\windows\python\3.7.6\x64\lib\site-packages), Requirement.parse('gast==0.3.3; platform_system == "Windows"'), {'paddlepaddle'})

* set DENABLE_WHEEL=OFF for openvino-onnx docker

* Supported newer versions of shellcheck

* Don't use excluded sources

* Improved NCC process of clang search

* Fixes

* A lot of updates

* Fixes after 2 PRs merge

* Fixed build

* Fixes

* Relaxed cython version a bit

* Try non-pip cython as well

* Fixed MacOsX

* Disable pybind usage for MO tests as well

* Added descriptive warning messages

* Fixed compilation on Windows

* Support for cmake < 3.15

* FIxed Windows linkage

* Fixed review comments

Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com>
2022-08-16 14:43:30 +04:00

124 lines
4.3 KiB
YAML

name: Python API Checks
on:
workflow_dispatch:
push:
paths:
- 'src/bindings/python/**'
- 'samples/python/**'
pull_request:
paths:
- 'src/bindings/python/**'
- 'samples/python/**'
jobs:
linters:
runs-on: ubuntu-18.04
steps:
- name: Code checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Install dependencies
run: python -m pip install -r src/bindings/python/requirements_test.txt
# samples code-style
- name: Run flake8 on samples
run: python -m flake8 ./ --config=setup.cfg
working-directory: samples/python
- name: Create code style diff for samples
if: failure()
run: |
python -m black -l 160 -S ./
git diff > samples_diff.diff
working-directory: samples/python
- uses: actions/upload-artifact@v2
if: failure()
with:
name: samples_diff
path: samples_diff.diff
# IE Python API Flake code-style
- name: Run flake8 on IE Python API
run: python -m flake8 ./ --config=setup.cfg
working-directory: src/bindings/python/src/compatibility/openvino
- name: Create code style diff for IE Python API
if: failure()
run: |
python -m black -l 160 -S ./
git diff > ie_python_diff.diff
working-directory: src/bindings/python/src/compatibility/openvino
- uses: actions/upload-artifact@v2
if: failure()
with:
name: ie_python_diff
path: ie_python_diff.diff
# nGraph Python API Flake code-style
- name: Run flake8 on nGraph Python API
run: python -m flake8 ./src/compatibility/ngraph --config=setup.cfg
working-directory: src/bindings/python
- name: Create code style diff for nGraph Python API
if: failure()
run: |
python -m black -l 160 -S ./
git diff > pyngraph_diff.diff
working-directory: src/bindings/python/src/compatibility/ngraph
- uses: actions/upload-artifact@v2
if: failure()
with:
name: pyngraph_diff
path: pyngraph_diff.diff
# Python API 2.0 Flake code-style
- name: Run flake8 on Python API 2.0
run: python -m flake8 ./src/openvino --config=setup.cfg
working-directory: src/bindings/python
- name: Create code style diff for Python API 2.0
if: failure()
run: |
python -m black -l 160 -S ./
git diff > pyopenvino_diff.diff
working-directory: src/bindings/python/src/openvino
- uses: actions/upload-artifact@v2
if: failure()
with:
name: pyopenvino_diff
path: pyopenvino_diff.diff
# wheel Flake code-style
- name: Run flake8 on wheel
run: python -m flake8 ./ --config=../setup.cfg
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: src/bindings/python/wheel
- uses: actions/upload-artifact@v2
if: failure()
with:
name: wheel_diff
path: wheel_diff.diff
# Python API 2.0 tests Flake code-style
- name: Run flake8 on python tests
# ignore lack of docs in tests
run: python -m flake8 tests/ --config=setup.cfg
working-directory: src/bindings/python
# IE Python API mypy check
- name: Run mypy on IE Python API
run: python -m mypy ./ --config-file ./setup.cfg
working-directory: src/bindings/python/src/compatibility/openvino
# nGraph Python API mypy check
- name: Run mypy on nGraph Python API
run: python -m mypy ./src/compatibility/ngraph --config-file ./setup.cfg
working-directory: src/bindings/python
# Python API 2.0 mypy check
- name: Run mypy on Python API 2.0
run: python -m mypy ./src/openvino --config-file ./setup.cfg
working-directory: src/bindings/python
- name: Run Bandit
run: python -m bandit -r ./ -f screen
working-directory: src/bindings/python/src/compatibility/openvino