Skip to content

Update Python API Stubs #3

Update Python API Stubs

Update Python API Stubs #3

name: Update Python API Stubs
permissions:
contents: write
pull-requests: write
on:
schedule:
- cron: "0 2 * * 1-5"
workflow_dispatch: # Allow manual triggering
jobs:
update-stubs:
runs-on: aks-linux-medium
timeout-minutes: 10
defaults:
run:
shell: bash
container:
image: 'openvinogithubactions.azurecr.io/openvino_provider:0.1.0'
volumes:
- /mount:/mount
- ${{ github.workspace }}:${{ github.workspace }}
outputs:
ov_wheel_source: ${{ steps.openvino_download.outputs.ov_wheel_source }}
ov_version: ${{ steps.openvino_download.outputs.ov_version }}
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@0ae58361cdfd39e2950bed97a1e26aa20c3d8955 # v4
with:
python-version: '3.10'
- name: Get latest OpenVINO artifacts
id: openvino_download
uses: openvinotoolkit/openvino/.github/actions/openvino_provider@master
with:
platform: 'ubuntu22'
revision: latest_available_commit
- name: Install OpenVINO and stubgen
run: |
python -m pip install openvino==${{ steps.openvino_download.outputs.ov_version }} ${{ steps.openvino_download.outputs.ov_wheel_source }}
STUBGEN_VERSION=$(grep pybind11-stubgen src/bindings/python/requirements_test.txt)
python -m pip install "$STUBGEN_VERSION"
- name: Regenerate Python API stubs
run: |
find ./ -name "*.pyi" -delete
python src/bindings/python/scripts/generate_pyapi_stubs.py
- name: Add and commit .pyi files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
find src/bindings/python -name "*.pyi" -exec git add {} \;
git diff --quiet && git diff --staged --quiet || git commit -m "Update Python API stub files"
- name: Create Pull Request
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update Python API stub files
title: "[PyOV] Update Python API stub files"
signoff: true
sign-commits: true
reviewers: openvinotoolkit/openvino-ie-python-api-maintainers
body: |
- Updated Python API stub (.pyi) files from the latest available artifacts
Auto-generated by GitHub Actions
branch: update-pyapi-stubs
base: master