Skip to content

Commit a4ec8a1

Browse files
committed
Release workflow updates
* Add musllinux support * Build 32-bit packages (fixes #834) * Don't ship Cython-generated *.c files in wheels
1 parent 4049167 commit a4ec8a1

File tree

4 files changed

+38
-19
lines changed

4 files changed

+38
-19
lines changed

.github/workflows/install-postgres.sh

+4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ elif [ "${ID}" = "centos" ]; then
3838
"postgresql${PGVERSION}-server" \
3939
"postgresql${PGVERSION}-contrib"
4040
ln -s "/usr/pgsql-${PGVERSION}/bin/pg_config" "/usr/local/bin/pg_config"
41+
elif [ "${ID}" = "alpine" ]; then
42+
apk add shadow postgresql postgresql-dev postgresql-contrib
4143
else
4244
echo "install-postgres.sh: Unsupported distro: ${distro}" >&2
4345
exit 1
4446
fi
47+
48+
useradd -m -s /bin/bash apgtest

.github/workflows/release.yml

+3-16
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ jobs:
7474
strategy:
7575
matrix:
7676
os: [ubuntu-latest, macos-latest, windows-latest]
77-
cibw_python: ["cp37-*", "cp38-*", "cp39-*", "cp310-*"]
78-
cibw_arch: ["auto64"]
77+
cibw_python: ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*"]
78+
cibw_arch: ["auto64", "auto32"]
7979

8080
defaults:
8181
run:
@@ -90,24 +90,11 @@ jobs:
9090
fetch-depth: 50
9191
submodules: true
9292

93-
- uses: pypa/cibuildwheel@v2.1.1
93+
- uses: pypa/cibuildwheel@v2.2.2
9494
env:
9595
CIBW_BUILD_VERBOSITY: 1
9696
CIBW_BUILD: ${{ matrix.cibw_python }}
9797
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"
11198

11299
- uses: actions/upload-artifact@v2
113100
with:

pyproject.toml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[project]
2+
requires-python = ">=3.6"
3+
4+
[build-system]
5+
requires = ["setuptools>=42", "wheel"]
6+
build-backend = "setuptools.build_meta"
7+
8+
[tool.cibuildwheel]
9+
build-frontend = "build"
10+
test-extras = "test"
11+
12+
[tool.cibuildwheel.macos]
13+
test-command = "python {project}/tests/__init__.py"
14+
15+
[tool.cibuildwheel.windows]
16+
test-command = "python {project}\\tests\\__init__.py"
17+
18+
[tool.cibuildwheel.linux]
19+
before-all = ".github/workflows/install-postgres.sh"
20+
test-command = """\
21+
PY=`which python` \
22+
&& chmod -R go+rX "$(dirname $(dirname $(dirname $PY)))" \
23+
&& su -l apgtest -c "$PY {project}/tests/__init__.py" \
24+
"""

setup.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,13 @@ def finalize_options(self):
274274
author_email='[email protected]',
275275
url='https://github.com/MagicStack/asyncpg',
276276
license='Apache License, Version 2.0',
277-
packages=['asyncpg'],
278-
provides=['asyncpg'],
279-
include_package_data=True,
277+
packages=setuptools.find_packages(
278+
exclude=['tests', 'tools'],
279+
),
280+
package_data={
281+
# Cython sources needed for tracebacks
282+
"": ["*.pyx", "*.pxd", "*.pxi"],
283+
},
280284
ext_modules=[
281285
setuptools.extension.Extension(
282286
"asyncpg.pgproto.pgproto",

0 commit comments

Comments
 (0)