Skip to content

Commit 220d1d5

Browse files
committed
Release workflow updates
* Add musllinux support * Build 32-bit packages for Windows (fixes MagicStack#834) * Don't ship Cython-generated *.c files in wheels
1 parent 18f2aa4 commit 220d1d5

File tree

6 files changed

+45
-20
lines changed

6 files changed

+45
-20
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

+8-16
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,13 @@ 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"]
79+
exclude:
80+
- os: macos-latest
81+
cibw_arch: "auto32"
82+
- os: ubuntu-latest
83+
cibw_arch: "auto32"
7984

8085
defaults:
8186
run:
@@ -90,24 +95,11 @@ jobs:
9095
fetch-depth: 50
9196
submodules: true
9297

93-
- uses: pypa/cibuildwheel@v2.1.1
98+
- uses: pypa/cibuildwheel@v2.2.2
9499
env:
95100
CIBW_BUILD_VERBOSITY: 1
96101
CIBW_BUILD: ${{ matrix.cibw_python }}
97102
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"
111103

112104
- uses: actions/upload-artifact@v2
113105
with:

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ clean:
1212
rm -fr dist/ doc/_build/
1313
rm -fr asyncpg/pgproto/*.c asyncpg/pgproto/*.html
1414
rm -fr asyncpg/pgproto/codecs/*.html
15+
rm -fr asyncpg/pgproto/*.so
1516
rm -fr asyncpg/protocol/*.c asyncpg/protocol/*.html
1617
rm -fr asyncpg/protocol/*.so build *.egg-info
1718
rm -fr asyncpg/protocol/codecs/*.html

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",

tests/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ def suite():
1818

1919

2020
if __name__ == '__main__':
21-
runner = unittest.runner.TextTestRunner()
21+
runner = unittest.runner.TextTestRunner(verbosity=2)
2222
result = runner.run(suite())
2323
sys.exit(not result.wasSuccessful())

0 commit comments

Comments
 (0)