Skip to content

Commit 0ed3347

Browse files
authored
chore!: drop support for C++ code (#359)
* C++ removed from examples * C++ removed from src * C++ removed from tests * C++ removed from workflows * C++ removed from documentation * Update contribution docs * Restore accuracy tests workflow
1 parent 20dcce7 commit 0ed3347

265 files changed

Lines changed: 45 additions & 10651 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ updates:
1111
patterns:
1212
- "*"
1313
- package-ecosystem: pip
14-
directory: /src/python
14+
directory: /src
1515
schedule:
1616
interval: weekly
1717
target-branch: "master"

.github/labeler.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
# See help here: https://github.com/marketplace/actions/labeler
22

3-
cpp:
4-
- changed-files:
5-
- any-glob-to-any-file:
6-
- src/cpp/**
7-
83
python:
94
- changed-files:
105
- any-glob-to-any-file:
11-
- src/python/**
6+
- src/**
127

138
tests:
149
- changed-files:

.github/workflows/codeql.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ jobs:
2525
build-mode: none
2626
- language: python
2727
build-mode: none
28-
- language: c-cpp
29-
build-mode: none
3028

3129
steps:
3230
- name: Checkout repository

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
with:
2323
python-version: "3.10"
2424
- name: Install dependencies
25-
run: pip install 'src/python/.[docs]'
25+
run: pip install 'src/.[docs]'
2626
- name: Install and Generate Doxygen
2727
uses: mattnotmitt/doxygen-action@b84fe17600245bb5db3d6c247cc274ea98c15a3b # v1.12.0
2828
- name: Build Docs

.github/workflows/pre_commit.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ jobs:
2929
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3030
with:
3131
node-version: 22
32-
- name: Install clang-format
33-
run: sudo apt-get install -y clang-format-13
3432
- name: Install dependencies
35-
run: pip install 'src/python/.[full]'
33+
run: pip install 'src/.[full]'
3634
- name: Run pre-commit checks
3735
run: pre-commit run --all-files
3836
Unit-Tests:
@@ -47,9 +45,9 @@ jobs:
4745
with:
4846
python-version: "3.10"
4947
- name: Install dependencies
50-
run: pip install 'src/python/.[tests,ovms]'
48+
run: pip install 'src/.[tests,ovms]'
5149
- name: Run python unit tests
52-
run: pytest tests/python/unit
50+
run: pytest tests/unit
5351
Zizmor-Scan-PR:
5452
runs-on: ubuntu-latest
5553
permissions:
@@ -81,5 +79,5 @@ jobs:
8179
scan-scope: "changed"
8280
severity-level: "LOW"
8381
confidence-level: "LOW"
84-
config_file: "src/python/pyproject.toml"
82+
config_file: "src/pyproject.toml"
8583
fail-on-findings: true

.github/workflows/publish.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ jobs:
2525
python -m pip install --upgrade build
2626
- name: Build sdist
2727
run: |
28-
python -m build --sdist src/python/
28+
python -m build --sdist src/
2929
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
3030
with:
3131
name: artifact-sdist
32-
path: src/python/dist/*.tar.gz
32+
path: src/dist/*.tar.gz
3333
- name: Build wheel
3434
run: |
35-
python -m build --wheel src/python/
35+
python -m build --wheel src/
3636
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
3737
with:
3838
name: artifact-wheel
39-
path: src/python/dist/*.whl
39+
path: src/dist/*.whl
4040

4141
publish_package:
4242
name: Publish package

.github/workflows/security-scan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
scan-scope: "all"
4848
severity-level: "LOW"
4949
confidence-level: "LOW"
50-
config_file: "src/python/pyproject.toml"
50+
config_file: "src/pyproject.toml"
5151
fail-on-findings: false # reports only
5252

5353
trivy-scan:
@@ -68,7 +68,7 @@ jobs:
6868
run: python -m pip install pip-tools
6969

7070
- name: Freeze dependencies
71-
run: pip-compile --extra=full -o requirements.txt $(pwd)/src/python/pyproject.toml
71+
run: pip-compile --extra=full -o requirements.txt $(pwd)/src/pyproject.toml
7272

7373
- name: Run Trivy scan
7474
id: trivy

.github/workflows/test_accuracy.yml

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,12 @@ jobs:
2727
run: |
2828
source venv/bin/activate
2929
python -m pip install --upgrade pip
30-
pip install src/python/[tests,build] --extra-index-url https://download.pytorch.org/whl/cpu
30+
pip install src/[tests,build] --extra-index-url https://download.pytorch.org/whl/cpu
3131
- name: Prepare test data
3232
run: |
3333
source venv/bin/activate
34-
python tests/python/accuracy/prepare_data.py -d data
34+
python tests/accuracy/prepare_data.py -d data
3535
- name: Run Python Test
3636
run: |
3737
source venv/bin/activate
38-
pytest -v --data=./data tests/python/accuracy/test_accuracy.py
39-
- name: Install CPP dependencies
40-
run: |
41-
sudo bash src/cpp/install_dependencies.sh
42-
- name: Build CPP Test
43-
run: |
44-
mkdir build && cd build
45-
pip install nanobind==2.4.0
46-
pip install typing_extensions==4.12.2
47-
cmake ../tests/cpp/accuracy/
48-
make -j
49-
- name: Build CPP-PY Bindings
50-
run: |
51-
source venv/bin/activate
52-
pip install src/cpp/py_bindings
53-
- name: Run CPP Test
54-
run: |
55-
build/test_accuracy -d data -p tests/python/accuracy/public_scope.json
56-
- name: Run CPP-PY Bindings Test
57-
run: |
58-
source venv/bin/activate
59-
pip list
60-
pytest --data=./data --config=./tests/python/accuracy/public_scope.json tests/cpp/accuracy/test_bindings.py
38+
pytest -v --data=./data tests/accuracy/test_accuracy.py

.github/workflows/test_precommit.yml

Lines changed: 6 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -29,107 +29,15 @@ jobs:
2929
run: |
3030
source venv/bin/activate
3131
python -m pip install --upgrade pip
32-
pip install src/python/[tests,ovms] --extra-index-url https://download.pytorch.org/whl/cpu
32+
pip install src/[tests,ovms] --extra-index-url https://download.pytorch.org/whl/cpu
3333
- name: Prepare test data
3434
run: |
3535
source venv/bin/activate
36-
python tests/cpp/precommit/prepare_data.py -d data -p tests/cpp/precommit/public_scope.json
36+
python tests/precommit/prepare_data.py -d data -p tests/precommit/public_scope.json
3737
- name: Run test
3838
run: |
3939
source venv/bin/activate
40-
pytest --data=./data tests/python/functional
41-
CPP-Code-Quality:
42-
name: CPP-Code-Quality
43-
runs-on: ubuntu-latest
44-
steps:
45-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
46-
with:
47-
persist-credentials: false
48-
- name: cppcheck
49-
uses: chmorgan/cppcheck-action@88696b3fd4a3ced3df76a2f7dc44b251d8232bcb # v1.4
50-
with:
51-
github_token: ${{ secrets.GITHUB_TOKEN}}
52-
# missingInclude: cppcheck can't find stl, openvino, opencv
53-
other_options: --suppress=missingInclude -Isrc/cpp/models/include -Isrc/cpp/utils/include -Isrc/cpp/pipelines/include --check-config
54-
CPP-Precommit:
55-
runs-on: ubuntu-22.04
56-
steps:
57-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
58-
with:
59-
persist-credentials: false
60-
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
61-
with:
62-
python-version: "3.10"
63-
cache: pip
64-
- name: Create and start a virtual environment
65-
run: |
66-
python -m venv venv
67-
source venv/bin/activate
68-
- name: Install dependencies
69-
run: |
70-
source venv/bin/activate
71-
python -m pip install --upgrade pip
72-
pip install src/python/[tests,build] --extra-index-url https://download.pytorch.org/whl/cpu
73-
74-
sudo bash src/cpp/install_dependencies.sh
75-
- name: Prepare test data
76-
run: |
77-
source venv/bin/activate
78-
python tests/cpp/precommit/prepare_data.py -d data -p tests/cpp/precommit/public_scope.json
79-
- name: Build
80-
run: |
81-
mkdir build && cd build
82-
pip install nanobind==2.4.0
83-
pip install typing_extensions==4.12.2
84-
cmake ../tests/cpp/precommit/
85-
cmake --build . -j $((`nproc`*2+2))
86-
- name: Run test
87-
run: |
88-
build/test_sanity -d data -p tests/cpp/precommit/public_scope.json && build/test_model_config -d data
89-
CPP-Windows-Precommit:
90-
runs-on: windows-latest
91-
steps:
92-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
93-
with:
94-
persist-credentials: false
95-
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
96-
with:
97-
python-version: "3.10"
98-
cache: pip
99-
- name: Create and start a virtual environment
100-
shell: bash
101-
run: |
102-
python -m venv venv
103-
source venv/Scripts/activate
104-
- name: Install dependencies
105-
shell: bash
106-
run: |
107-
source venv/Scripts/activate
108-
python -m pip install --upgrade pip
109-
pip install src/python/[tests,build] --extra-index-url https://download.pytorch.org/whl/cpu
110-
curl https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.6/windows/w_openvino_toolkit_windows_2024.6.0.17404.4c0f47d2335_x86_64.zip --output w_openvino_toolkit_windows.zip
111-
unzip w_openvino_toolkit_windows.zip
112-
rm w_openvino_toolkit_windows.zip
113-
curl -L https://github.com/opencv/opencv/releases/download/4.10.0/opencv-4.10.0-windows.exe --output opencv-4.10.0-windows.exe
114-
./opencv-4.10.0-windows.exe -oopencv -y
115-
rm opencv-4.10.0-windows.exe
116-
- name: Prepare test data
117-
shell: bash
118-
run: |
119-
source venv/Scripts/activate
120-
python tests/cpp/precommit/prepare_data.py -d data -p tests/cpp/precommit/public_scope.json
121-
- name: Build
122-
shell: bash
123-
run: |
124-
mkdir build && cd build
125-
MSYS_NO_PATHCONV=1 cmake ../examples/cpp/ -DOpenVINO_DIR=$GITHUB_WORKSPACE/w_openvino_toolkit_windows_2024.6.0.17404.4c0f47d2335_x86_64/runtime/cmake -DOpenCV_DIR=$GITHUB_WORKSPACE/opencv/opencv/build -DCMAKE_CXX_FLAGS=/WX
126-
cmake --build . --config Release -j $((`nproc`*2+2))
127-
- name: Run sync sample
128-
shell: cmd
129-
# .\w_openvino_toolkit_windows_2023.0.0.10926.b4452d56304_x86_64\setupvars.bat exits with 0 code without moving to a next command. Set PATH manually
130-
run: |
131-
set PATH=opencv\opencv\build\x64\vc16\bin;w_openvino_toolkit_windows_2024.6.0.17404.4c0f47d2335_x86_64\runtime\bin\intel64\Release;w_openvino_toolkit_windows_2024.6.0.17404.4c0f47d2335_x86_64\runtime\3rdparty\tbb\bin;%PATH%
132-
.\build\Release\synchronous_api.exe .\data\otx_models\detection_model_with_xai_head.xml .\data\BloodImage_00007.jpg
40+
pytest --data=./data tests/functional
13341
serving_api:
13442
strategy:
13543
fail-fast: false
@@ -153,8 +61,8 @@ jobs:
15361
- name: serving_api
15462
run: |
15563
python -m pip install --upgrade pip
156-
python -m pip install src/python/[ovms,tests]
157-
python tests/cpp/precommit/prepare_data.py -d data -p tests/cpp/precommit/public_scope.json
64+
python -m pip install src/[ovms,tests]
65+
python tests/precommit/prepare_data.py -d data -p tests/precommit/public_scope.json
15866
python -c "from model_api.models import DetectionModel; DetectionModel.create_model('./data/otx_models/detection_model_with_xai_head.xml').save('ovms_models/ssd_mobilenet_v1_fpn_coco/1/ssd_mobilenet_v1_fpn_coco.xml')"
15967
docker run -d --rm -v $GITHUB_WORKSPACE/ovms_models/:/models -p 8000:8000 openvino/model_server:latest --model_path /models/ssd_mobilenet_v1_fpn_coco/ --model_name ssd_mobilenet_v1_fpn_coco --rest_port 8000 --log_level DEBUG --target_device CPU
160-
python examples/python/serving_api/run.py data/coco128/images/train2017/000000000009.jpg # detects 4 objects
68+
python examples/serving_api/run.py data/coco128/images/train2017/000000000009.jpg # detects 4 objects

0 commit comments

Comments
 (0)