Skip to content

Commit e37da55

Browse files
committed
Building and releasing stubs
1 parent 347f89d commit e37da55

File tree

5 files changed

+54
-1
lines changed

5 files changed

+54
-1
lines changed

.github/workflows/pypi.yml

+52
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,45 @@ on:
77
workflow_dispatch:
88

99
jobs:
10+
build_stubs:
11+
name: Build VCL Stubs
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
python: ['3.11']
16+
include:
17+
- os: [windows-latest]
18+
arch: ["AMD64"]
19+
20+
steps:
21+
- name: Check out repository
22+
uses: actions/checkout@v3
23+
24+
- name: Build and Install VCL
25+
run: |
26+
python -m pip install setuptools --upgrade
27+
python -m pip install wheel --upgrade
28+
python setup.py install
29+
30+
- name: Install mypy
31+
run: |
32+
python -m pip install git+https://github.com/lmbelo/mypy.git
33+
34+
- name: Build Stubs
35+
run: |
36+
python -m mypy.stubgen -m delphivcl -o .\delphivcl --include-docstrings
37+
ren .\delphivcl\delphivcl.pyi __init__.pyi
38+
39+
- name: Cache Stubs
40+
id: cache-stubs
41+
uses: actions/cache@v3
42+
with:
43+
path: .\delphivcl\__init__.pyi
44+
key: ${{ runner.os }}-stubs
45+
1046
build_wheels_win_32:
1147
name: Build Windows x86 wheels for Python ${{ matrix.python }}
48+
needs: [build_stubs]
1249
runs-on: ${{ matrix.os }}
1350
strategy:
1451
matrix:
@@ -21,6 +58,13 @@ jobs:
2158
uses: actions/checkout@v3
2259
with:
2360
fetch-depth: 0
61+
62+
- name: Restore Cached Stubs
63+
id: cache-stubs
64+
uses: actions/cache@v3
65+
with:
66+
path: .\delphivcl\__init__.pyi
67+
key: ${{ runner.os }}-stubs
2468

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

4387
build_wheels_win_64:
4488
name: Build Windows x64 wheels for Python ${{ matrix.python }}
89+
needs: [build_stubs]
4590
runs-on: ${{ matrix.os }}
4691
strategy:
4792
matrix:
@@ -54,6 +99,13 @@ jobs:
5499
uses: actions/checkout@v3
55100
with:
56101
fetch-depth: 0
102+
103+
- name: Restore Cached Stubs
104+
id: cache-stubs
105+
uses: actions/cache@v3
106+
with:
107+
path: .\delphivcl\__init__.pyi
108+
key: ${{ runner.os }}-stubs
57109

58110
- name: Set up Python ${{ matrix.python }}
59111
uses: actions/setup-python@v3

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
recursive-include delphivcl *.pyd
2+
recursive-include delphivcl *.pyi
23
recursive-include delphivcl docs.xml

lib/Win32/DelphiVCL.pyd

5.5 KB
Binary file not shown.

lib/Win64/DelphiVCL.pyd

8.5 KB
Binary file not shown.

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ cmdclass =
5454
bdist_wheel = build.BDistWheel
5555

5656
[options.package_data]
57-
* = *.pyd, *.xml
57+
* = *.pyd, *.pyi, *.xml

0 commit comments

Comments
 (0)