From 853da97e9feacd209d4df33d49fb24e2005a9388 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Thu, 13 Feb 2025 20:04:03 -0800 Subject: [PATCH] Improve aarch64 and mac builds (#380) --- .github/workflows/build_wheels.yml | 11 +++-------- pyproject.toml | 6 +----- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index d841a30..14e3d57 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -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}}-*" @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 9d861d5..340d690 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", @@ -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]'""" -