Skip to content

Commit ac6a2fc

Browse files
authored
Update CI matrix, aarch64 builds (#595)
This does the following changes: * Updates the Python versions for the OSX builds to the latest ones * Removes the version pin on wheel * setuptools 48.0.0 broke asyncpg, distutils is deprecated now, I've rewrote it to setuptools entirely * CI pipelines now have names * aarch64 tests against the latest python and postgresql are now done * manylinux2014 wheels for aarch64 are also built now * bumped Ubuntu to focal (20.04) * bumped Cython to fix compatibility with python 3.10 * CI builds now actually install the built wheel and not the latest pypi release * version test is skipped for dev builds as the git commit hash mixes up the version number * resolved all travis config warnings * postgres 9.2-9.4 are EOL and removed from the tests The manylinux containers from pypa only work on the architecture they are made for, so a aarch64 manylinux wheel can only be built on aarch64. Therefore, two containers now perform the builds. It might be worth thinking about letting the aarch64 container handle the upload alone for all wheels as it is ages slower than the x86 one anyways. I've tested pretty much everything except the S3 bucket and pypi push, the wheels themselves get built and the other pipelines pass.
1 parent aa67d61 commit ac6a2fc

6 files changed

+175
-106
lines changed

.ci/build-manylinux-wheels.sh

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,25 @@
22

33
set -e -x
44

5+
# iproute isn't included in CentOS 7
6+
yum install -y iproute
7+
58
# Compile wheels
69
PYTHON="/opt/python/${PYTHON_VERSION}/bin/python"
710
PIP="/opt/python/${PYTHON_VERSION}/bin/pip"
8-
${PIP} install --upgrade setuptools pip wheel~=0.31.1
11+
${PIP} install --upgrade setuptools pip wheel
912
cd /io
1013
make clean
1114
${PYTHON} setup.py bdist_wheel
1215

1316
# Bundle external shared libraries into the wheels.
1417
forwhlin /io/dist/*.whl;do
15-
auditwheel repair $whl -w /io/dist/
18+
auditwheel repair $whl -w /tmp/
19+
${PIP} install /tmp/*.whl
20+
mv /tmp/*.whl /io/dist/
1621
rm /io/dist/*-linux_*.whl
1722
done
1823

19-
${PIP} install ${PYMODULE} -f "file:///io/dist"
20-
2124
# Grab docker host, where Postgres should be running.
2225
export PGHOST=$(ip route | awk '/default/ { print $3 }'| uniq)
2326
export PGUSER="postgres"

.ci/travis-build-wheels.sh

+14-5
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,16 @@ if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
4545
s='m' if tuple('${pyver}'.split('.')) < ('3', '8') \
4646
else ''))")
4747

48-
49-
forarchin x86_64 i686;do
50-
ML_IMAGE="quay.io/pypa/manylinux1_${arch}"
48+
if [[ "$(uname -m)"="x86_64" ]];then
49+
ARCHES="x86_64 i686"
50+
MANYLINUX_VERSION="1"
51+
elif [[ "$(uname -m)"="aarch64" ]];then
52+
ARCHES="aarch64"
53+
MANYLINUX_VERSION="2014"
54+
fi
55+
56+
forarchin$ARCHES;do
57+
ML_IMAGE="quay.io/pypa/manylinux${MANYLINUX_VERSION}_${arch}"
5158
docker pull "${ML_IMAGE}"
5259
docker run --rm \
5360
-v "${_root}":/io \
@@ -64,9 +71,11 @@ elif [ "${TRAVIS_OS_NAME}" == "osx" ]; then
6471
export PGINSTALLATION="/usr/local/opt/postgresql@${PGVERSION}/bin"
6572

6673
make clean
67-
python setup.py bdist_wheel
74+
python setup.py bdist_wheel --dist-dir /tmp/
6875

69-
pip install ${PYMODULE} -f "file:///${_root}/dist"
76+
pip install /tmp/*.whl
77+
mkdir -p "${_root}/dist"
78+
mv /tmp/*.whl "${_root}/dist/"
7079
make -C "${_root}" ASYNCPG_VERSION="${PACKAGE_VERSION}" testinstalled
7180

7281
_upload_wheels

.ci/travis-release.sh

+11-7
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@ if [ "${PACKAGE_VERSION}" == "${PYPI_VERSION}" ]; then
1818
fi
1919

2020
# Check if all expected wheels have been built and uploaded.
21-
release_platforms=(
22-
"macosx_10_??_x86_64"
23-
"manylinux1_i686"
24-
"manylinux1_x86_64"
25-
"win32"
26-
"win_amd64"
27-
)
21+
if [[ "$(uname -m)"="x86_64" ]];then
22+
release_platforms=(
23+
"macosx_10_??_x86_64"
24+
"manylinux1_i686"
25+
"manylinux1_x86_64"
26+
"win32"
27+
"win_amd64"
28+
)
29+
elif [[ "$(uname -m)"="aarch64" ]];then
30+
release_platforms="manylinux2014_aarch64"
31+
fi
2832

2933
P="${PYMODULE}-${PACKAGE_VERSION}"
3034
expected_wheels=()

.travis.yml

+134-82
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ env:
1818

1919
- DOCS_PUSH_KEY_LABEL=0760b951e99c
2020

21-
addons:
22-
apt:
23-
sources:
24-
- sourceline: 'deb https://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main'
25-
key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
26-
2721
branches:
2822
# Avoid building PR branches.
2923
only:
@@ -32,132 +26,190 @@ branches:
3226
- releases
3327
- /^v\d+(\.\d+)*$/
3428

35-
matrix:
29+
jobs:
3630
fast_finish:
3731
true
3832

3933
include:
4034
# Do quick test runs for each supported version of PostgreSQL
4135
# minus the latest.
42-
- os: linux
43-
dist: xenial
44-
language: python
45-
python: "3.6"
46-
env: BUILD=quicktests PGVERSION=9.2
47-
addons:
48-
apt: {packages: [postgresql-9.2, postgresql-contrib-9.2]}
49-
50-
- os: linux
51-
dist: xenial
52-
language: python
53-
python: "3.6"
54-
env: BUILD=quicktests PGVERSION=9.3
55-
addons:
56-
apt: {packages: [postgresql-9.3, postgresql-contrib-9.3]}
57-
58-
- os: linux
59-
dist: xenial
36+
- name: "Quicktest psql 9.5"
37+
os: linux
38+
dist: focal
6039
language: python
61-
python: "3.6"
62-
env: BUILD=quicktests PGVERSION=9.4
63-
addons:
64-
apt: {packages: [postgresql-9.4, postgresql-contrib-9.4]}
65-
66-
- os: linux
67-
dist: xenial
68-
language: python
69-
python: "3.6"
40+
python: "3.8"
7041
env: BUILD=quicktests PGVERSION=9.5
7142
addons:
72-
apt: {packages: [postgresql-9.5, postgresql-contrib-9.5]}
73-
74-
- os: linux
75-
dist: xenial
43+
apt:
44+
sources:
45+
- sourceline: 'deb https://apt.postgresql.org/pub/repos/apt/ focal-pgdg main'
46+
key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
47+
packages:
48+
- postgresql-9.5
49+
- postgresql-contrib-9.5
50+
51+
- name: "Quicktest psql 9.6"
52+
os: linux
53+
dist: focal
7654
language: python
77-
python: "3.6"
55+
python: "3.8"
7856
env: BUILD=quicktests PGVERSION=9.6
7957
addons:
80-
apt: {packages: [postgresql-9.6, postgresql-contrib-9.6]}
81-
82-
- os: linux
83-
dist: xenial
58+
apt:
59+
sources:
60+
- sourceline: 'deb https://apt.postgresql.org/pub/repos/apt/ focal-pgdg main'
61+
key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
62+
packages:
63+
- postgresql-9.6
64+
- postgresql-contrib-9.6
65+
66+
- name: "Quicktest psql 10"
67+
os: linux
68+
dist: focal
8469
language: python
85-
python: "3.6"
70+
python: "3.8"
8671
env: BUILD=quicktests PGVERSION=10
8772
addons:
88-
apt: {packages: [postgresql-10]}
89-
90-
- os: linux
91-
dist: xenial
73+
apt:
74+
sources:
75+
- sourceline: 'deb https://apt.postgresql.org/pub/repos/apt/ focal-pgdg main'
76+
key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
77+
packages:
78+
- postgresql-10
79+
80+
- name: "Quicktest psql 11"
81+
os: linux
82+
dist: focal
9283
language: python
93-
python: "3.6"
84+
python: "3.8"
9485
env: BUILD=quicktests PGVERSION=11
9586
addons:
96-
apt: {packages: [postgresql-11]}
87+
apt:
88+
sources:
89+
- sourceline: 'deb https://apt.postgresql.org/pub/repos/apt/ focal-pgdg main'
90+
key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
91+
packages:
92+
- postgresql-11
9793

9894
# Do a full test run on the latest supported version of PostgreSQL
9995
# on each supported version of Python.
100-
- os: linux
101-
dist: xenial
102-
sudo: required
96+
- name: "Test py 3.5"
97+
os: linux
98+
dist: focal
10399
language: python
104100
python: "3.5"
105101
env: BUILD=tests PGVERSION=12
106102
addons:
107-
apt: {packages: [postgresql-12]}
108-
109-
- os: linux
110-
dist: xenial
111-
sudo: required
103+
apt:
104+
sources:
105+
- sourceline: 'deb https://apt.postgresql.org/pub/repos/apt/ focal-pgdg main'
106+
key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
107+
packages:
108+
- postgresql-12
109+
110+
- name: "Test py 3.6"
111+
os: linux
112+
dist: focal
112113
language: python
113114
python: "3.6"
114115
env: BUILD=tests PGVERSION=12
115116
addons:
116-
apt: {packages: [postgresql-12]}
117-
118-
- os: linux
119-
dist: xenial
120-
sudo: true
117+
apt:
118+
sources:
119+
- sourceline: 'deb https://apt.postgresql.org/pub/repos/apt/ focal-pgdg main'
120+
key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
121+
packages:
122+
- postgresql-12
123+
124+
- name: "Test py 3.7"
125+
os: linux
126+
dist: focal
121127
language: python
122128
python: "3.7"
123129
env: BUILD=tests PGVERSION=12
124130
addons:
125-
apt: {packages: [postgresql-12]}
126-
127-
- os: linux
128-
dist: xenial
129-
sudo: true
131+
apt:
132+
sources:
133+
- sourceline: 'deb https://apt.postgresql.org/pub/repos/apt/ focal-pgdg main'
134+
key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
135+
packages:
136+
- postgresql-12
137+
138+
- name: "Test py 3.8"
139+
os: linux
140+
dist: focal
130141
language: python
131142
python: "3.8"
132143
env: BUILD=tests PGVERSION=12
133144
addons:
134-
apt: {packages: [postgresql-12]}
145+
apt:
146+
sources:
147+
- sourceline: 'deb https://apt.postgresql.org/pub/repos/apt/ focal-pgdg main'
148+
key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
149+
packages:
150+
- postgresql-12
151+
152+
# Only test on recent aarch64 distribution
153+
# 3.7 is the latest supported by Travis
154+
# https://docs.travis-ci.com/user/languages/python/#python-versions
155+
# The shipped Postgres 9.X collides with the 12 on aarch64
156+
# until fixed, use official ubuntu repos
157+
- name: "Test aarch64 py 3.8-dev"
158+
os: linux
159+
arch: arm64
160+
dist: focal
161+
language: python
162+
python: "3.8-dev"
163+
env: BUILD=tests PGVERSION=12
164+
addons:
165+
postgresql: "12"
135166

136167
# Build manylinux wheels. Each wheel will be tested,
137168
# so there is no need for BUILD=tests here.
138169
# Also use this job to publish the releases and build
139170
# the documentation.
140-
- os: linux
141-
dist: bionic
142-
sudo: required
171+
- name: "x86 wheels and docs"
172+
os: linux
173+
dist: focal
143174
language: python
144-
python: "3.6"
175+
python: "3.8"
145176
env: BUILD=wheels,docs,release PGVERSION=12
146177
services: [docker]
147178
addons:
148-
apt: {packages: [postgresql-12]}
179+
apt:
180+
sources:
181+
- sourceline: 'deb https://apt.postgresql.org/pub/repos/apt/ focal-pgdg main'
182+
key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
183+
packages:
184+
- postgresql-12
185+
186+
# Same for the aarch64 manylinux wheel
187+
- name: "aarch64 wheels"
188+
os: linux
189+
arch: arm64
190+
dist: focal
191+
language: python
192+
python: "3.8-dev"
193+
env: BUILD=wheels,release PGVERSION=12
194+
services: [docker]
195+
addons:
196+
postgresql: "12"
149197

150-
- os: osx
151-
env: BUILD=tests,wheels PYTHON_VERSION=3.5.7 PGVERSION=10
198+
- name: "OSX py 3.5"
199+
os: osx
200+
env: BUILD=tests,wheels PYTHON_VERSION=3.5.9 PGVERSION=12
152201

153-
- os: osx
154-
env: BUILD=tests,wheels PYTHON_VERSION=3.6.9 PGVERSION=10
202+
- name: "OSX py 3.6"
203+
os: osx
204+
env: BUILD=tests,wheels PYTHON_VERSION=3.6.10 PGVERSION=12
155205

156-
- os: osx
157-
env: BUILD=tests,wheels PYTHON_VERSION=3.7.4 PGVERSION=10
206+
- name: "OSX py 3.7"
207+
os: osx
208+
env: BUILD=tests,wheels PYTHON_VERSION=3.7.7 PGVERSION=12
158209

159-
- os: osx
160-
env: BUILD=tests,wheels PYTHON_VERSION=3.8.0 PGVERSION=10
210+
- name: "OSX py 3.8"
211+
os: osx
212+
env: BUILD=tests,wheels PYTHON_VERSION=3.8.3 PGVERSION=12
161213

162214
cache:
163215
pip

0 commit comments

Comments
 (0)
close