Skip to content

Commit

Permalink
Building and releasing stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
lmbelo committed Sep 22, 2023
1 parent 347f89d commit 6f1e748
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,45 @@ on:
workflow_dispatch:

jobs:
build_stubs:
name: Build VCL Stubs
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: ['3.11']
include:
- os: [windows-latest]
arch: ["AMD64"]

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Build and Install VCL
run: |
python -m pip install setuptools --upgrade
python -m pip install wheel --upgrade
python setup.py install
- name: Install mypy
run: |
python -m pip install git+https://github.com/lmbelo/mypy.git
- name: Build Stubs
run: |
python -m mypy.stubgen -m delphivcl -o .\delphivcl --include-docstrings
ren .\delphivcl\delphivcl.pyi __init__.pyi
- name: Cache Stubs
id: cache-stubs
uses: actions/cache@v3
with:
path: .\delphivcl\__init__.pyi
key: ${{ runner.os }}-stubs

build_wheels_win_32:
name: Build Windows x86 wheels for Python ${{ matrix.python }}
needs: [build_stubs]
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -21,6 +58,13 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Restore Cached Stubs
id: cache-stubs
uses: actions/cache@v3
with:
path: .\delphivcl\__init__.pyi
key: ${{ runner.os }}-stubs

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v3
Expand All @@ -42,6 +86,7 @@ jobs:

build_wheels_win_64:
name: Build Windows x64 wheels for Python ${{ matrix.python }}
needs: [build_stubs]
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -54,6 +99,13 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Restore Cached Stubs
id: cache-stubs
uses: actions/cache@v3
with:
path: .\delphivcl\__init__.pyi
key: ${{ runner.os }}-stubs

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v3
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
recursive-include delphivcl *.pyd
recursive-include delphivcl *.pyi
recursive-include delphivcl docs.xml
Binary file modified lib/Win32/DelphiVCL.pyd
Binary file not shown.
Binary file modified lib/Win64/DelphiVCL.pyd
Binary file not shown.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ cmdclass =
bdist_wheel = build.BDistWheel

[options.package_data]
* = *.pyd, *.xml
* = *.pyd, *.pyi, *.xml

0 comments on commit 6f1e748

Please sign in to comment.