Skip to content

Commit 9aae9e9

Browse files
committed
Update cibuildwheels to 2.21.3 and gh actions to checkout, artifacts to v4 and and python to v5
v3 are going to be removed soon (nov 30): https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/
1 parent bfa4e6f commit 9aae9e9

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

.github/workflows/wheels.yml

+16-11
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
name: Build SDist
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919
with:
2020
submodules: true
2121

@@ -39,25 +39,30 @@ jobs:
3939
os: [ubuntu-latest, windows-latest, macos-latest]
4040

4141
steps:
42-
- uses: actions/checkout@v3
42+
- uses: actions/checkout@v4
4343
with:
4444
submodules: true
45+
# Used to host cibuildwheel
46+
- uses: actions/setup-python@v5
4547

46-
- uses: pypa/[email protected]
48+
- name: Install cibuildwheel
49+
run: python -m pip install cibuildwheel==2.21.3
50+
51+
- name: Build wheels
52+
run: python -m cibuildwheel --output-dir wheelhouse
4753
env:
4854
CIBW_ARCHS_MACOS: auto universal2
49-
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
50-
CIBW_REPAIR_WHEEL_COMMAND_LINUX: ""
51-
# Repair windows wheel
52-
# CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
53-
# CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}"
55+
# for windows setup.py repairwheel step should solve it
5456

5557
- name: Verify clean directory
5658
run: git diff --exit-code
5759
shell: bash
5860

61+
- name: List files
62+
run: ls wheelhouse
63+
5964
- name: Upload wheels
60-
uses: actions/upload-artifact@v3
65+
uses: actions/upload-artifact@v3 # v4 does not support overwriting artifacts anymore.
6166
with:
6267
path: wheelhouse/*.whl
6368

@@ -69,11 +74,11 @@ jobs:
6974
if: github.event_name == 'release' && github.event.action == 'published'
7075

7176
steps:
72-
- uses: actions/setup-python@v4
77+
- uses: actions/setup-python@v5
7378
with:
7479
python-version: "3.x"
7580

76-
- uses: actions/download-artifact@v3
81+
- uses: actions/download-artifact@v4
7782
with:
7883
name: artifact
7984
path: dist

pyproject.toml

-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ test-skip = ["*universal2:arm64"]
3535
# Setuptools bug causes collision between pypy and cpython artifacts
3636
before-build = "rm -rf {project}/build"
3737

38-
#repair-wheel-command = "wheelrepair \"{wheel}\" -O build/ ; mv build/*.whl {wheel}" # TODO: figure out if this works alread after adding it to setup.py
39-
4038
[tool.ruff]
4139
extend-select = [
4240
"B", # flake8-bugbear

setup.py

+5
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ def copy_extensions_to_source(self):
145145
class RepairWheel(bdist_wheel):
146146
def run(self):
147147
super().run()
148+
if os.environ.get('CIBUILDWHEEL', '0') == '0' or sys.platform.startswith('win'):
149+
# for linux and macos we use the default wheel repair command from cibuildwheel, for windows we need to do it manually as there is no repair command
150+
self.repair_wheel()
151+
152+
def repair_wheel(self):
148153
# on windows the dlls are in D:\a\pywhispercpp\pywhispercpp\build\temp.win-amd64-cpython-311\Release\_pywhispercpp\bin\Release\whisper.dll
149154
global dll_folder
150155
print("dll_folder in repairwheel",dll_folder)

0 commit comments

Comments
 (0)