Skip to content

Commit 7bd6c49

Browse files
authored
Add arm64 mac and linux wheels (#954)
1 parent 9825bbb commit 7bd6c49

File tree

3 files changed

+45
-18
lines changed

3 files changed

+45
-18
lines changed

.github/workflows/install-postgres.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,16 @@ if [ "${ID}" = "debian" -o "${ID}" = "ubuntu" ]; then
2727
apt-get install -y --no-install-recommends \
2828
"postgresql-${PGVERSION}" \
2929
"postgresql-contrib-${PGVERSION}"
30+
elif [ "${ID}" = "almalinux" ]; then
31+
yum install -y \
32+
"postgresql-server" \
33+
"postgresql-devel" \
34+
"postgresql-contrib"
3035
elif [ "${ID}" = "centos" ]; then
31-
el="EL-${VERSION_ID}-$(arch)"
36+
el="EL-${VERSION_ID%.*}-$(arch)"
3237
baseurl="https://download.postgresql.org/pub/repos/yum/reporpms"
3338
yum install -y "${baseurl}/${el}/pgdg-redhat-repo-latest.noarch.rpm"
34-
if [ ${VERSION_ID} -ge 8 ]; then
39+
if [ ${VERSION_ID%.*} -ge 8 ]; then
3540
dnf -qy module disable postgresql
3641
fi
3742
yum install -y \

.github/workflows/release.yml

+37-15
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
submodules: true
5757

5858
- name: Set up Python
59-
uses: actions/setup-python@v2
59+
uses: actions/setup-python@v4
6060

6161
- name: Build source distribution
6262
run: |
@@ -68,19 +68,35 @@ jobs:
6868
name: dist
6969
path: dist/*.tar.*
7070

71-
build-wheels:
71+
build-wheels-matrix:
7272
needs: validate-release-request
73+
runs-on: ubuntu-latest
74+
outputs:
75+
include: ${{ steps.set-matrix.outputs.include }}
76+
steps:
77+
- uses: actions/checkout@v2
78+
- uses: actions/setup-python@v4
79+
- run: pip install cibuildwheel==2.10.2
80+
- id: set-matrix
81+
run: |
82+
MATRIX_INCLUDE=$(
83+
{
84+
cibuildwheel --print-build-identifiers --platform linux --arch x86_64,aarch64 | grep cp | jq -Rc '{"only": inputs, "os": "ubuntu-latest"}' \
85+
&& cibuildwheel --print-build-identifiers --platform macos --arch x86_64,arm64 | grep cp | jq -Rc '{"only": inputs, "os": "macos-latest"}' \
86+
&& cibuildwheel --print-build-identifiers --platform windows --arch x86,AMD64 | grep cp | jq -Rc '{"only": inputs, "os": "windows-latest"}'
87+
} | jq -sc
88+
)
89+
echo ::set-output name=include::"$MATRIX_INCLUDE"
90+
91+
build-wheels:
92+
needs: build-wheels-matrix
7393
runs-on: ${{ matrix.os }}
94+
continue-on-error: true
95+
name: Build ${{ matrix.only }}
96+
7497
strategy:
7598
matrix:
76-
os: [ubuntu-latest, macos-latest, windows-latest]
77-
cibw_python: ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*"]
78-
cibw_arch: ["auto64", "auto32"]
79-
exclude:
80-
- os: macos-latest
81-
cibw_arch: "auto32"
82-
- os: ubuntu-latest
83-
cibw_arch: "auto32"
99+
include: ${{ fromJson(needs.build-wheels-matrix.outputs.include) }}
84100

85101
defaults:
86102
run:
@@ -94,20 +110,26 @@ jobs:
94110
with:
95111
fetch-depth: 50
96112
submodules: true
113+
114+
- name: Set up QEMU
115+
if: runner.os == 'Linux'
116+
uses: docker/setup-qemu-action@v2
97117

98-
- uses: pypa/[email protected]
118+
- uses: pypa/[email protected]
119+
with:
120+
only: ${{ matrix.only }}
99121
env:
100122
CIBW_BUILD_VERBOSITY: 1
101-
CIBW_BUILD: ${{ matrix.cibw_python }}
102-
CIBW_ARCHS: ${{ matrix.cibw_arch }}
123+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
124+
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
103125

104126
- uses: actions/upload-artifact@v2
105127
with:
106128
name: dist
107129
path: wheelhouse/*.whl
108130

109131
publish-docs:
110-
needs: validate-release-request
132+
needs: [build-sdist, build-wheels]
111133
runs-on: ubuntu-latest
112134

113135
env:
@@ -121,7 +143,7 @@ jobs:
121143
submodules: true
122144

123145
- name: Set up Python
124-
uses: actions/setup-python@v2
146+
uses: actions/setup-python@v4
125147
with:
126148
python-version: 3.8
127149

tests/test_introspection.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from asyncpg import connection as apg_con
1313

1414

15-
MAX_RUNTIME = 0.1
15+
MAX_RUNTIME = 0.25
1616

1717

1818
class SlowIntrospectionConnection(apg_con.Connection):

0 commit comments

Comments
 (0)