Skip to content

Commit d858362

Browse files
authored
Fix wheel build and prefer pyproject.toml (#68)
1 parent d42cc37 commit d858362

File tree

4 files changed

+59
-49
lines changed

4 files changed

+59
-49
lines changed

.github/workflows/build_wheels.yml

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,26 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
# macos-13 is an intel runner, macos-14 is apple silicon
23-
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
22+
os: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel]
2423
arch: [native]
25-
python: ["{cp38,pp*}"]
24+
python: ["{cp310,pp310,pp311}"]
2625
# Split aarch64 across jobs because it uses emulation (slow)
2726
include:
2827
- os: ubuntu-latest
2928
arch: i686
30-
python: "{cp38,pp*}"
29+
python: "{cp310,pp310,pp311}"
3130
- os: ubuntu-latest
3231
arch: aarch64
33-
python: "cp38"
32+
python: "cp310"
3433
- os: ubuntu-latest
3534
arch: aarch64
36-
python: "pp38"
35+
python: "pp310"
3736
- os: ubuntu-latest
3837
arch: aarch64
39-
python: "pp39"
38+
python: "pp3{10,11}"
4039
- os: ubuntu-latest
4140
arch: aarch64
42-
python: "pp310"
41+
python: "pp3{10,11}"
4342
steps:
4443
- uses: actions/checkout@v4
4544
with:
@@ -50,23 +49,10 @@ jobs:
5049
with:
5150
platforms: all
5251
if: runner.os == 'Linux' && matrix.arch == 'aarch64'
53-
- uses: pypa/cibuildwheel@v2.20.0
52+
- uses: pypa/cibuildwheel@v3.3.0
5453
env:
5554
CIBW_ARCHS: "${{ matrix.arch }}"
5655
CIBW_BUILD: "${{ matrix.python }}-*"
57-
CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux2014_x86_64:latest"
58-
CIBW_MANYLINUX_AARCH64_IMAGE: "quay.io/pypa/manylinux2014_aarch64:latest"
59-
CIBW_TEST_COMMAND: "python -c \"import rtmixer; print(rtmixer.__version__)\""
60-
# No portaudio on these platforms:
61-
CIBW_TEST_SKIP: "*_i686 *-musllinux_* *_aarch64"
62-
# To enable testing we'd have to bump up to the Almalinux 8-based image:
63-
# CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28"
64-
CIBW_BUILD_VERBOSITY: "3"
65-
CIBW_BEFORE_TEST_LINUX: "bash {project}/tools/cibw_before_test_linux.sh"
66-
# Use abi3audit to catch issues with Limited API wheels
67-
CIBW_REPAIR_WHEEL_COMMAND: "bash ./tools/cibw_repair_wheel_command.sh {dest_dir} {wheel} {delocate_archs}"
68-
CIBW_ENVIRONMENT_PASS_LINUX: "RUNNER_OS"
69-
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8"
7056
- uses: actions/upload-artifact@v4
7157
with:
7258
name: cibw-wheels-${{ matrix.os }}-${{ matrix.arch}}-${{ strategy.job-index }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ src/*.egg-info
55
__pycache__
66
.eggs
77
/dist/
8+
/wheelhouse/

pyproject.toml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,51 @@
11
[build-system]
2-
requires = ["setuptools", "wheel"]
2+
requires = ["setuptools", "wheel", "pa_ringbuffer", "cffi>=1.4.0"]
33
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
requires-python = ">=3.10"
7+
name = "rtmixer"
8+
dynamic = ["version"]
9+
readme = {content-type = "text/x-rst", file = "README.rst"}
10+
authors = [
11+
{email = "[email protected]", name = "Matthias Geier"},
12+
]
13+
description = 'Reliable low-latency audio playback and recording'
14+
license = 'MIT'
15+
keywords = [
16+
"sound", "audio", "PortAudio", "realtime", "low-latency"
17+
]
18+
dependencies = [
19+
'CFFI>=1', # for _cffi_backend
20+
'pa_ringbuffer', # for init()
21+
'sounddevice>0.3.9',
22+
]
23+
classifiers =[
24+
'Operating System :: OS Independent',
25+
'Programming Language :: Python',
26+
'Programming Language :: Python :: 3',
27+
'Topic :: Multimedia :: Sound/Audio',
28+
]
29+
30+
[project.urls]
31+
"Bug Tracker" = "https://github.com/spatialaudio/python-rtmixer/issues"
32+
Documentation = "https://python-rtmixer.readthedocs.io"
33+
Homepage = "https://python-rtmixer.readthedocs.io"
34+
"Source Code" = "https://github.com/spatialaudio/python-rtmixer"
35+
36+
[tool.cibuildwheel]
37+
enable = ["pypy", "pypy-eol"]
38+
manylinux-aarch64-image = "manylinux2014"
39+
manylinux-pypy_x86_64-image = "manylinux2014"
40+
manylinux-pypy_aarch64-image = "manylinux2014"
41+
manylinux-x86_64-image = "manylinux2014"
42+
test-command = "python -c \"import rtmixer; print(rtmixer.__version__)\""
43+
# No portaudio on these platforms:
44+
test-skip = "*_i686 *-musllinux_* *_aarch64"
45+
# To enable testing we'd have to bump up to the Almalinux 8-based image:
46+
# manylinux-aarch64-image = "manylinux_2_28"
47+
repair-wheel-command = "bash ./tools/cibw_repair_wheel_command.sh {dest_dir} {wheel} {delocate_archs}"
48+
49+
[tool.cibuildwheel.linux]
50+
before-test = "bash {project}/tools/cibw_before_test_linux.sh"
51+
environment = { RUNNER_OS="Linux" } # facilitate local testing

setup.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,40 +19,15 @@ def get_tag(self):
1919
if python.startswith("cp"):
2020
# on CPython, our wheels are abi3 and compatible back to 3.2,
2121
# but let's set it to our min version anyway
22-
return "cp38", "abi3", plat
22+
return "cp310", "abi3", plat
2323

2424
return python, abi, plat
2525

2626

2727
setup(
28-
name='rtmixer',
2928
version=__version__,
3029
package_dir={'': 'src'},
3130
py_modules=['rtmixer'],
3231
cffi_modules=['rtmixer_build.py:ffibuilder'], # sets Py_LIMITED_API for us
33-
python_requires='>=3.6',
34-
setup_requires=[
35-
'CFFI>=1.4.0',
36-
'pa_ringbuffer', # for cdef()
37-
],
38-
install_requires=[
39-
'CFFI>=1', # for _cffi_backend
40-
'pa_ringbuffer', # for init()
41-
'sounddevice>0.3.9',
42-
],
43-
author='Matthias Geier',
44-
author_email='[email protected]',
45-
description='Reliable low-latency audio playback and recording',
46-
long_description=open('README.rst').read(),
47-
license='MIT',
48-
keywords='sound audio PortAudio realtime low-latency'.split(),
49-
url='https://python-rtmixer.readthedocs.io/',
50-
platforms='any',
51-
classifiers=[
52-
'Operating System :: OS Independent',
53-
'Programming Language :: Python',
54-
'Programming Language :: Python :: 3',
55-
'Topic :: Multimedia :: Sound/Audio',
56-
],
5732
cmdclass={"bdist_wheel": bdist_wheel_abi3},
5833
)

0 commit comments

Comments
 (0)