Skip to content

Update Python API Stubs #10

Update Python API Stubs

Update Python API Stubs #10

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: ubuntu-latest
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: 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 "action@github.com"
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 nightly
Auto-generated by GitHub Actions
branch: update-pyapi-stubs
base: master