Skip to content

Commit

Permalink
Improve aarch64 and mac builds (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja authored Feb 14, 2025
1 parent 9fa2832 commit 853da97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: pypa/cibuildwheel@v2.21.2
- uses: pypa/cibuildwheel@v2.22.0
env:
CIBW_BUILD: "cp${{ matrix.python-version}}-*"

Expand All @@ -38,19 +38,14 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ubuntu-24.04-arm]
python-version: [39, 310, 311, 312, 313]

steps:
- uses: actions/checkout@v4

- name: Setup up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64

- name: Build wheels
uses: pypa/cibuildwheel@v2.21.2
uses: pypa/cibuildwheel@v2.22.0
env:
CIBW_BUILD: "cp${{ matrix.python-version}}-*"
CIBW_ARCHS: aarch64
Expand Down
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ build-verbosity = 1
linux.before-all = "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y"
linux.environment = { PATH = "$PATH:$HOME/.cargo/bin" }
macos.before-all = "rustup target add aarch64-apple-darwin x86_64-apple-darwin"
macos.environment = { MACOSX_DEPLOYMENT_TARGET = "10.12" }

skip = [
"*-manylinux_i686",
Expand All @@ -39,8 +40,3 @@ test-skip = "*-macosx_arm64"

before-test = "pip install pytest hypothesis"
test-command = "pytest {project}/tests --import-mode=append"

[[tool.cibuildwheel.overrides]]
select = "*linux_aarch64"
test-command = """python -c 'import tiktoken; enc = tiktoken.get_encoding("gpt2"); assert enc.encode("hello world") == [31373, 995]'"""

0 comments on commit 853da97

Please sign in to comment.