Skip to content

Commit

Permalink
[ci] feat: enable building for Python 3.12 (#182)
Browse files Browse the repository at this point in the history
* Add Python 3.12 to meta-data classifiers in `pyproject.toml` and enable it to be built by cibuildwheel in CI.
* Add `py312` tag in `tox ini`, remove ` py37`.
* Update cibuildwheel version used in CI to 2.16.x.
* Only use meson custom install script to byte-compile Python modules if meson <= 1.2.0.
* Update latest Python version mentioned in windows install docs.

Signed-off-by: Christopher Arndt <[email protected]>
  • Loading branch information
SpotlightKid authored Oct 23, 2023
1 parent b23f00d commit e9661a4
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr_to_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
if: matrix.os == 'windows-latest'

- name: Build wheels
uses: pypa/cibuildwheel@v2.13
uses: pypa/cibuildwheel@v2.16
env:
# Skip trying to test arm64 builds on Intel Macs
CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64"
Expand All @@ -76,7 +76,7 @@ jobs:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.13
uses: pypa/cibuildwheel@v2.16
env:
CIBW_ARCHS: ${{ matrix.arch }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push_to_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
if: matrix.os == 'windows-latest'

- name: Build wheels
uses: pypa/cibuildwheel@v2.13
uses: pypa/cibuildwheel@v2.16
env:
# Skip trying to test arm64 builds on Intel Macs
CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64"
Expand All @@ -76,7 +76,7 @@ jobs:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.13
uses: pypa/cibuildwheel@v2.16
env:
CIBW_ARCHS: ${{ matrix.arch }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
if: matrix.os == 'windows-latest'

- name: Build wheels
uses: pypa/cibuildwheel@v2.13
uses: pypa/cibuildwheel@v2.16
env:
# Skip trying to test arm64 builds on Intel Macs
CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64"
Expand All @@ -79,7 +79,7 @@ jobs:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.13
uses: pypa/cibuildwheel@v2.16
env:
CIBW_ARCHS: ${{ matrix.arch }}

Expand Down
4 changes: 2 additions & 2 deletions INSTALL-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Please follow all the steps below in the exact order.

You probably need administrator rights for some or all of the following steps.

1. Install the latest release of Python (3.11 at the time of writing, at least
1. Install the latest release of Python (3.12 at the time of writing, at least
3.8+) from <https://www.python.org/downloads/windows/> to the default
location (e.g. `C:\Python311`). You can install either or both the 32-bit
location (e.g. `C:\Python312`). You can install either or both the 32-bit
and the 64-bit version.

In the installer, enable the option to install [pip]. Optionally, *for only
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ subdir('src')
# Build & install C++ extension module and Python package
subdir('rtmidi')

if not get_option('wheel')
if meson.version().version_compare('<1.2.0') and not get_option('wheel')
postinstall_script = files('meson_postinstall.py')
meson.add_install_script(python, postinstall_script)
endif
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Multimedia :: Sound/Audio :: MIDI",
"Topic :: Software Development :: Libraries :: Python Modules",
]
Expand Down Expand Up @@ -66,6 +67,7 @@ target-version = [
"py39",
"py310",
"py311",
"py312",
]

[tool.isort]
Expand Down Expand Up @@ -97,7 +99,7 @@ test-command = "pytest -v -m ci {package}/tests"

# Install system library
[tool.cibuildwheel.linux]
build = "cp3{8,9,10,11}-manylinux*"
build = "cp3{8,9,10,11,12}-manylinux*"
archs = ["auto64"]
before-all = [
"dnf -y install alsa-lib-devel alsa-utils",
Expand All @@ -110,9 +112,9 @@ before-all = [
]

[tool.cibuildwheel.macos]
build = "cp3{8,9,10,11}-macosx*"
build = "cp3{8,9,10,11,12}-macosx*"
archs = ["x86_64", "arm64"]

[tool.cibuildwheel.windows]
build = "cp3{8,9,10,11}-win*"
build = "cp3{8,9,10,11,12}-win*"
archs = ["AMD64"]
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = flake8, py37, py38, py39, py310, py311
envlist = flake8, py38, py39, py310, py311, py312
skip_missing_interpreters = True
isolated_build = True

Expand Down

0 comments on commit e9661a4

Please sign in to comment.