-
Notifications
You must be signed in to change notification settings - Fork 5
122 lines (102 loc) · 3.47 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Copyright (c) Meta Platforms, Inc. and affiliates.
name: Build and Test
on:
push:
branches:
- main
# This build configuration uses a matrix to build and test multiple Python versions.
# Each version is actioned across on multiple operating systems (Ubuntu, Windows, macOS).
# For standard Python builds, we use pre-built binary releases for efficiency.
# However, since nogil-enabled Python binaries are not readily available,
# we build Python from source with nogil (free threaded) builds.
# This approach allows us to test our extension with different Python configurations.
# Our goals are to ensure compatibility and reliability across various environments,
# and to create platform-specific wheels for distribution on PyPi.
jobs:
cibuildwheel:
strategy:
fail-fast: false
matrix:
include:
- wheel: "linux-3.12"
os: ubuntu-latest
CIBW_BUILD: "cp312-*"
- wheel: "linux-3.13"
os: ubuntu-latest
CIBW_BUILD: "cp313-*"
- wheel: "linux-3.13t"
os: ubuntu-latest
CIBW_BUILD: "cp313t-*"
CIBW_ENABLE: "cpython-freethreading"
- wheel: "windows-3.13"
os: windows-latest
CIBW_BUILD: "cp313-*"
- wheel: "windows-3.13t"
os: windows-latest
CIBW_BUILD: "cp313t-*"
CIBW_ENABLE: "cpython-freethreading"
- wheel: "macos-3.13"
os: macos-latest
CIBW_BUILD: "cp313-*"
- wheel: "macos-3.13t"
os: macos-latest
CIBW_BUILD: "cp313t-*"
CIBW_ENABLE: "cpython-freethreading"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.22.0
- name: Build Python wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: ${{ matrix.CIBW_BUILD }}
CIBW_ENABLE: ${{ matrix.CIBW_ENABLE }}
CIBW_TEST_COMMAND: python -m ft_utils.tests.test_run_all
- name: Upload Python wheels
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.wheel }}.zip
path: wheelhouse/*.whl
deadsnakes:
strategy:
fail-fast: false
matrix:
include:
- wheel: "linux-3.14"
python-version: "3.14-dev"
nogil: false
- wheel: "linux-3.14t"
python-version: "3.14-dev"
nogil: true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: deadsnakes/[email protected]
with:
python-version: ${{ matrix.python-version }}
nogil: ${{ matrix.nogil }}
- name: Install build dependencies
run: python -m pip install --upgrade setuptools wheel
- name: Build Python wheels
run: python setup.py bdist_wheel
- name: Install wheels
run: python -m pip install build/dist/*.whl
- name: Test Python wheels
run: |
mkdir test_dir
cd test_dir
python -V
python -m ft_utils.tests.test_run_all
- name: Upload Python wheels
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.wheel }}.zip
path: build/dist/*.whl