Skip to content

Commit

Permalink
Add stub generation to python-dist.yml (#1234)
Browse files Browse the repository at this point in the history
  • Loading branch information
parker-research authored Feb 4, 2025
1 parent e0daf9c commit 10bcecb
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/python-dist.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: "Python Dist"
description: "Build and upload Python distributions to PyPI"

on:
workflow_dispatch:
release:
Expand All @@ -13,6 +15,25 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m venv venv/
./venv/bin/python -m pip install --upgrade pip
./venv/bin/python -m pip install build twine pybind11-stubgen
- name: Build and install pyslang (for stub generation)
run: |
./venv/bin/python -m pip install .
- name: Generate Python stubs
run: |
mkdir pyslang/pyslang/
./venv/bin/python -m pybind11_stubgen pyslang -o pyslang/ --root-suffix ''
- name: Verify that stub file was generated
run: |
test -f pyslang/pyslang/__init__.pyi
- name: Build SDist
run: pipx run build --sdist
- name: Check metadata
Expand All @@ -33,6 +54,25 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m venv venv/
./venv/bin/python -m pip install --upgrade pip
./venv/bin/python -m pip install build twine pybind11-stubgen
- name: Build and install pyslang (for stub generation)
run: |
./venv/bin/python -m pip install .
- name: Generate Python stubs
run: |
mkdir pyslang/pyslang/
./venv/bin/python -m pybind11_stubgen pyslang -o pyslang/ --root-suffix ''
- name: Verify that stub file was generated
run: |
test -f pyslang/pyslang/__init__.pyi
- uses: maxim-lobanov/setup-xcode@v1
if: matrix.os == 'macos-latest'
with:
Expand Down

0 comments on commit 10bcecb

Please sign in to comment.