Skip to content

Update Python API Stubs #156

Update Python API Stubs

Update Python API Stubs #156

name: Update Python API Stubs
permissions: read-all
on:
schedule:
- cron: "0 2 * * 1-5"
workflow_dispatch: # Allow manual triggering
jobs:
update-stubs:
runs-on: ubuntu-latest
if: github.repository == 'openvinotoolkit/openvino'
steps:
- name: Checkout repository
uses: ababushk/checkout@9bec46a94a83db82acd4303e7627d88db71402a5 # cherry_pick_retries
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v4
with:
python-version: '3.10'
- name: Install OpenVINO and stubgen
run: |
python -m pip install --pre -U openvino --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
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@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
token: ${{ secrets.EXTERNAL_LABELLER_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 nightly
Auto-generated by GitHub Actions
branch: update-pyapi-stubs
base: master