Skip to content

Commit

Permalink
Update cibuildwheels to 2.21.3 and gh actions to checkout, artifacts …
Browse files Browse the repository at this point in the history
…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/
  • Loading branch information
PiotrCzapla committed Oct 18, 2024
1 parent bfa4e6f commit 263f3c5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -39,25 +39,31 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
# Used to host cibuildwheel
- uses: actions/setup-python@v5

- uses: pypa/[email protected]
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.21.3

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS_MACOS: auto universal2
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
CIBW_REPAIR_WHEEL_COMMAND_LINUX: ""
# Repair windows wheel
# CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
# CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}"
# use default repair command on linux and macos
# for windows setup.py repairwheel step should solve it

- name: Verify clean directory
run: git diff --exit-code
shell: bash

- name: List files
run: ls -la wheelhouse

- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v3 # v4 does not support overwriting artifacts anymore.
with:
path: wheelhouse/*.whl

Expand All @@ -69,11 +75,11 @@ jobs:
if: github.event_name == 'release' && github.event.action == 'published'

steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ test-skip = ["*universal2:arm64"]
# Setuptools bug causes collision between pypy and cpython artifacts
before-build = "rm -rf {project}/build"

#repair-wheel-command = "wheelrepair \"{wheel}\" -O build/ ; mv build/*.whl {wheel}" # TODO: figure out if this works alread after adding it to setup.py

[tool.ruff]
extend-select = [
"B", # flake8-bugbear
Expand Down
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ def copy_extensions_to_source(self):
class RepairWheel(bdist_wheel):
def run(self):
super().run()
if os.environ.get('CIBUILDWHEEL', '0') == '0' or sys.platform.startswith('win'):
# 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
self.repair_wheel()

def repair_wheel(self):
# on windows the dlls are in D:\a\pywhispercpp\pywhispercpp\build\temp.win-amd64-cpython-311\Release\_pywhispercpp\bin\Release\whisper.dll
global dll_folder
print("dll_folder in repairwheel",dll_folder)
Expand Down

0 comments on commit 263f3c5

Please sign in to comment.