Skip to content

Commit

Permalink
🔧 attempt to setup 3.13t within normal CI*5
Browse files Browse the repository at this point in the history
  • Loading branch information
Ousret committed Nov 12, 2024
1 parent eb622f3 commit f7d6824
Showing 1 changed file with 18 additions and 63 deletions.
81 changes: 18 additions & 63 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ jobs:
python_version: 'pypy-3.9'
- target: aarch64
python_version: 'pypy-3.10'
- target: aarch64
python_version: '3.13t'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -164,11 +166,16 @@ jobs:
if: matrix.python_version == '3.13t'
run: git apply freethreaded.patch
- name: Build wheels
env:
PYTHON_GIL: 0
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: 'true'
- name: Fix Wheel Name
if: matrix.python_version == '3.13t'
run: mv dist\wassima-1.1.6-cp313-none-win_amd64.whl dist\wassima-1.1.6-cp313-cp313t-win_amd64.whl
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
Expand All @@ -184,84 +191,32 @@ jobs:
fail-fast: false
matrix:
target: [x86_64, aarch64, universal2]
python_version: ['3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10']
python_version: ['3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10', '3.13t']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
if: matrix.python_version != '3.13t'
with:
python-version: ${{ matrix.python_version }}
- uses: Quansight-Labs/setup-python@v5
if: matrix.python_version == '3.13t'
with:
python-version: '3.13t'
- name: FreeThreaded Patch
if: matrix.python_version == '3.13t'
run: git apply freethreaded.patch
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --interpreter ${{ matrix.python_version }}
args: --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

freethreaded:
needs:
- test
- lint
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-13 ] # windows-latest
qemu: [ '' ]
include:
# Split ubuntu job for the sake of speed-up
- os: ubuntu-latest
qemu: aarch64
- os: ubuntu-latest
qemu: ppc64le
- os: ubuntu-latest
qemu: s390x
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Set up QEMU
if: ${{ matrix.qemu }}
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
with:
platforms: arm64,s390x,ppc64le
id: qemu
- name: Prepare emulation
run: |
if [[ -n "${{ matrix.qemu }}" ]]; then
# Build emulated architectures only if QEMU is set,
# use default "auto" otherwise
echo "CIBW_ARCHS_LINUX=${{ matrix.qemu }}" >> $GITHUB_ENV
fi
shell: bash
- name: Setup Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0

- name: Build wheels
uses: pypa/cibuildwheel@7940a4c0e76eb2030e473a5f864f291f63ee879b # v2.21.3
env:
CIBW_BUILD_FRONTEND: build
CIBW_BEFORE_BUILD: git apply freethreaded.patch || true
CIBW_BEFORE_BUILD_WINDOWS: git apply freethreaded.patch || (exit 0)
CIBW_BUILD: cp313t*
CIBW_BEFORE_ALL_LINUX: curl -sSf https://sh.rustup.rs | sh -s -- -y
# CIBW_BEFORE_ALL_WINDOWS: rustup target add aarch64-pc-windows-msvc
CIBW_BEFORE_ALL_MACOS: rustup target add aarch64-apple-darwin
CIBW_ENVIRONMENT_LINUX: "PATH=$HOME/.cargo/bin:$PATH"
CIBW_ARCHS_MACOS: universal2
# CIBW_ARCHS_WINDOWS: AMD64 ARM64

- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.whl

sdist:
needs:
- test
Expand Down Expand Up @@ -305,7 +260,7 @@ jobs:
checksum:
name: compute hashes
runs-on: ubuntu-22.04
needs: [linux, windows, macos, sdist, universal, freethreaded]
needs: [linux, windows, macos, sdist, universal]
if: "startsWith(github.ref, 'refs/tags/')"
outputs:
hashes: ${{ steps.compute.outputs.hashes }}
Expand Down

0 comments on commit f7d6824

Please sign in to comment.