Skip to content

Commit f0ef2b2

Browse files
author
root
committed
simply the build_wheels.yaml
1 parent 9c23137 commit f0ef2b2

File tree

1 file changed

+63
-9
lines changed

1 file changed

+63
-9
lines changed

.github/workflows/build_wheels.yaml

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828

2929
- name: Install poetry
3030
uses: snok/install-poetry@v1
31+
with:
32+
version: 1.8.5
3133

3234
- name: Build sdist
3335
run: |
@@ -40,55 +42,107 @@ jobs:
4042
path: dist/*.tar.gz
4143

4244
build_wheels:
43-
name: "${{ matrix.os }} py${{ matrix.python-version }}"
45+
name: "${{ matrix.os }} ${{ matrix.arch }} py${{ matrix.python-version }}"
4446
runs-on: ${{ matrix.os }}
4547
strategy:
4648
fail-fast: false
4749
matrix:
48-
os: [ubuntu-latest, windows-latest, macos-latest]
50+
os: [ubuntu-20.04, windows-latest, macos-11, macos-13]
4951
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
50-
include:
52+
arch: [x86_64, x86, arm64, aarch64, ppc64le, s390x]
53+
exclude:
54+
# Windows exclusions
55+
- os: windows-latest
56+
arch: aarch64
57+
- os: windows-latest
58+
arch: ppc64le
59+
- os: windows-latest
60+
arch: s390x
61+
- os: windows-latest
62+
python-version: "3.8"
63+
arch: arm64
64+
# macOS exclusions
65+
- os: macos-11
66+
arch: x86
67+
- os: macos-11
68+
arch: aarch64
69+
- os: macos-11
70+
arch: ppc64le
71+
- os: macos-11
72+
arch: s390x
73+
- os: macos-13
74+
arch: x86
75+
- os: macos-13
76+
arch: aarch64
77+
- os: macos-13
78+
arch: ppc64le
5179
- os: macos-13
52-
python-version: "3.12"
53-
target: arm64
80+
arch: s390x
81+
# Ubuntu exclusions
82+
- os: ubuntu-20.04
83+
arch: arm64
84+
- os: ubuntu-20.04
85+
arch: x86
5486

5587
steps:
5688
- name: Check out repository
5789
uses: actions/checkout@v4
5890
with:
5991
fetch-depth: 0
6092

93+
- name: Set up QEMU
94+
if: runner.os == 'Linux' && matrix.arch != 'x86_64'
95+
uses: docker/setup-qemu-action@v3
96+
with:
97+
platforms: all
98+
6199
- name: Set up python ${{ matrix.python-version }}
62100
uses: actions/setup-python@v5
63101
with:
64102
python-version: ${{ matrix.python-version }}
65103

66104
- name: Install poetry
67105
uses: snok/install-poetry@v1
106+
with:
107+
version: 1.8.5
68108

69109
- name: Install dependencies
70110
run: |
71111
poetry self add "poetry-dynamic-versioning[plugin]"
72112
poetry install --only main
73113
74114
- name: Build wheel
115+
env:
116+
CIBW_ARCHS: ${{ matrix.arch }}
75117
run: poetry build --format=wheel
76118

77-
- name: Setup test environment
119+
- name: Setup clean test environment
120+
shell: bash
78121
run: |
122+
python -m venv venv
123+
if [ "${{ runner.os }}" = "Windows" ]; then
124+
source venv/Scripts/activate
125+
else
126+
source venv/bin/activate
127+
fi
79128
python -m pip install --upgrade pip
80129
python -m pip install pytest pandas
81130
python -m pip install dist/*.whl
82131
83132
- name: Run tests
133+
shell: bash
84134
run: |
85-
cd tests
86-
python -m pytest
135+
if [ "${{ runner.os }}" = "Windows" ]; then
136+
source venv/Scripts/activate
137+
else
138+
source venv/bin/activate
139+
fi
140+
python -m pytest tests/
87141
88142
- name: Upload wheel
89143
uses: actions/upload-artifact@v4
90144
with:
91-
name: wheels-${{ matrix.os }}-py${{ matrix.python-version }}${{ matrix.target && format('-{0}', matrix.target) || '' }}
145+
name: wheels-${{ matrix.os }}-${{ matrix.arch }}-py${{ matrix.python-version }}
92146
path: dist/*.whl
93147

94148
upload_to_pypi:

0 commit comments

Comments
 (0)