@@ -66,21 +66,16 @@ jobs:
6666uses : actions/upload-artifact@v2 
6767 with :
6868 name : dist 
69-  path : dist/ 
69+  path : dist/*.tar.*  
7070
7171 build-wheels :
7272 needs : validate-release-request 
7373 runs-on : ${{ matrix.os }} 
7474 strategy :
7575 matrix :
76-  python-version : [3.6, 3.7, 3.8, 3.9, 3.10.0.rc.1] 
7776 os : [ubuntu-latest, macos-latest, windows-latest] 
78-  arch : [x86_64] 
79-  exclude :
80-  - os : windows-latest 
81-  arch : aarch64 
82-  - os : macos-latest 
83-  arch : aarch64 
77+  cibw_python : ["cp37-*", "cp38-*", "cp39-*", "cp310-*"] 
78+  cibw_arch : ["auto64"] 
8479
8580 defaults :
8681 run :
@@ -95,121 +90,29 @@ jobs:
9590 fetch-depth : 50 
9691 submodules : true 
9792
98-  - name : Set up QEMU 
99-  if : matrix.arch == 'aarch64' 
100-  uses : docker/setup-qemu-action@v1 
101- 
102-  - name : Set up Python ${{ matrix.python-version }} 
103-  uses : actions/setup-python@v2 
104-  with :
105-  python-version : ${{ matrix.python-version }} 
106- 
107-  - name : Install Python Deps 
108-  run : | 
109-  python -m pip install --upgrade setuptools pip wheel 
110- 
111- name : Build Wheels (linux) 
112-  if : startsWith(matrix.os, 'ubuntu') 
93+  - uses : pypa/cibuildwheel@v2.1.1 
11394 env :
114-  PYTHON_VERSION : ${{ matrix.python-version }} 
115-  ARCH : ${{ matrix.arch }} 
116-  run : | 
117-  case "${ARCH}" in 
118-  x86_64) 
119-  mlimg=manylinux1_x86_64 
120-  ;; 
121-  aarch64) 
122-  mlimg=manylinux2014_aarch64 
123-  ;; 
124-  *) 
125-  echo "Unsupported wheel arch: ${ARCH}" >&2 
126-  exit 1 
127-  ;; 
128-  esac 
129- 
130-  docker run --rm \ 
131-  -v "${GITHUB_WORKSPACE}":/github/workspace:rw \ 
132-  --workdir=/github/workspace \ 
133-  -e GITHUB_WORKSPACE=/github/workspace \ 
134-  -e PYTHON_VERSION="${PYTHON_VERSION}" \ 
135-  --entrypoint=/github/workspace/.github/workflows/build-manylinux-wheels.sh \ 
136-  quay.io/pypa/${mlimg} 
137- 
138- name : Build Wheels (non-linux) 
139-  if : " !startsWith(matrix.os, 'ubuntu')" 
140-  run : | 
141-  make clean 
142-  python setup.py bdist_wheel 
143- 
144- name : Test Wheels (native) 
145-  if : | 
146-  !contains(github.event.pull_request.labels.*.name, 'skip wheel tests') 
147-  && matrix.arch == 'x86_64' 
148- env :
149-  OS : ${{ matrix.os }} 
150-  run : | 
151-  if [ "${OS}" = "windows-latest" ]; then 
152-  export PGINSTALLATION="${PGBIN}" 
153-  fi 
154-  "${GITHUB_WORKSPACE}/.github/workflows/test-wheels.sh" 
155- 
156- name : Test Wheels (emulated) 
157-  if : | 
158-  !contains(github.event.pull_request.labels.*.name, 'skip wheel tests') 
159-  && matrix.arch != 'x86_64' 
160- env :
161-  PYTHON_VERSION : ${{ matrix.python-version }} 
162-  PGVERSION : 13 
163-  DISTRO_NAME : focal 
164-  ARCH : ${{ matrix.arch }} 
165-  run : | 
166-  sudo env DISTRO_NAME="${DISTRO_NAME}" PGVERSION="${PGVERSION}" \ 
167-  .github/workflows/install-postgres.sh 
168-  # Allow docker guest to connect to the database 
169-  echo "port = 5433" | \ 
170-  sudo tee --append /etc/postgresql/${PGVERSION}/main/postgresql.conf 
171-  echo "listen_addresses = '*'" | \ 
172-  sudo tee --append /etc/postgresql/${PGVERSION}/main/postgresql.conf 
173-  echo "host all all 172.17.0.0/16 trust" | \ 
174-  sudo tee --append /etc/postgresql/${PGVERSION}/main/pg_hba.conf 
175-  if [ "${PGVERSION}" -ge "11" ]; then 
176-  # Disable JIT to avoid unpredictable timings in tests. 
177-  echo "jit = off" | \ 
178-  sudo tee --append /etc/postgresql/${PGVERSION}/main/postgresql.conf 
179-  fi 
180-  sudo pg_ctlcluster ${PGVERSION} main restart 
181- 
182-  case "${ARCH}" in 
183-  aarch64) 
184-  img="docker.io/arm64v8/python:${PYTHON_VERSION}-buster" 
185-  ;; 
186-  *) 
187-  echo "Unsupported wheel arch: ${ARCH}" >&2 
188-  exit 1 
189-  ;; 
190-  esac 
191- 
192-  docker run --rm \ 
193-  -v "${GITHUB_WORKSPACE}":/github/workspace:rw \ 
194-  -e GITHUB_WORKSPACE=/github/workspace \ 
195-  -e PYTHON_VERSION="${PYTHON_VERSION}" \ 
196-  --workdir=/github/workspace/ \ 
197-  ${img} \ 
198-  /bin/bash -ex -c ' \ 
199-  echo GITHUB_WORKSPACE=${GITHUB_WORKSPACE} >> /etc/environment \ 
200-  && echo PGHOST=$(ip route | grep default | cut -f3 -d" " | uniq) \ 
201-  >> /etc/environment \ 
202-  && echo PGPORT=5433 >> /etc/environment \ 
203-  && echo PGUSER=postgres >> /etc/environment \ 
204-  && echo ENVIRON_FILE /etc/environment >> /etc/login.defs \ 
205-  && useradd -m -s /bin/bash test \ 
206-  && su -l test /github/workspace/.github/workflows/test-wheels.sh \ 
207-  ' 
95+  CIBW_BUILD_VERBOSITY : 1 
96+  CIBW_BUILD : ${{ matrix.cibw_python }} 
97+  CIBW_ARCHS : ${{ matrix.cibw_arch }} 
98+  CIBW_BEFORE_ALL_LINUX : > 
99+  yum -y install libffi-devel 
100+  && env PGVERSION=12 .github/workflows/install-postgres.sh 
101+  && useradd -m -s /bin/bash apgtest 
102+ CIBW_TEST_EXTRAS : " test" 
103+  CIBW_TEST_COMMAND : > 
104+  python {project}/tests/__init__.py 
105+ CIBW_TEST_COMMAND_WINDOWS : > 
106+  python {project}\tests\__init__.py 
107+ CIBW_TEST_COMMAND_LINUX : > 
108+  PY=`which python` 
109+  && chmod -R go+rX "$(dirname $(dirname $(dirname $PY)))" 
110+  && su -p -l apgtest -c "$PY {project}/tests/__init__.py" 
208111
209112uses : actions/upload-artifact@v2 
210113 with :
211114 name : dist 
212-  path : dist/ 
115+  path : wheelhouse/*.whl 
213116
214117 publish-docs :
215118 needs : validate-release-request 
0 commit comments