From cad27eacfbd676ecf762ffaf85e31e6a1833fc3b Mon Sep 17 00:00:00 2001 From: Christopher Arndt Date: Mon, 10 Feb 2025 18:09:37 +0100 Subject: [PATCH] feat: Python 3.13 support and builds, drop Python 3.8 support - Set minimum required Python version 3.9 in `pyproject.toml`. - Added Python 3.13 to `cibuildwheel` build list in `pyproject.toml` and removed 3.8. - Added Python 3.13 to meta-data classifiers in `pyproject.toml` and removed 3.8. - Added Python 3.13 to `tox.ini` and removed 3.8. - Updated minimum supported Python version mentioned in readme etc. - Updated latest Python version mentioned in windows install docs. - ci: Use GitHub Action Linux arm runners, remove dedicated pipeline for aarch64. - ci: Let cibuildwheel install needed Python versions. Signed-off-by: Christopher Arndt --- .github/workflows/pr_to_master.yml | 45 ++-------------------------- .github/workflows/push_to_master.yml | 45 ++-------------------------- .github/workflows/release.yml | 45 ++-------------------------- INSTALL-windows.md | 6 ++-- README.md | 2 +- pyproject.toml | 13 ++++---- src/_rtmidi.pyx | 2 +- tox.ini | 2 +- 8 files changed, 22 insertions(+), 138 deletions(-) diff --git a/.github/workflows/pr_to_master.yml b/.github/workflows/pr_to_master.yml index 629ae68e..a6fbf52c 100644 --- a/.github/workflows/pr_to_master.yml +++ b/.github/workflows/pr_to_master.yml @@ -40,7 +40,7 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest] steps: - uses: actions/checkout@v4 @@ -50,51 +50,12 @@ jobs: - uses: ilammy/msvc-dev-cmd@v1 if: matrix.os == 'windows-latest' - - name: Install Python - uses: actions/setup-python@v5 - with: - python-version: | - 3.9 - 3.10 - 3.11 - 3.12 - pypy3.9 - pypy3.10 - - name: Build wheels - uses: pypa/cibuildwheel@v2.16 + uses: pypa/cibuildwheel@v2.22 env: # Skip trying to test arm64 builds on Intel Macs CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64" - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: bdist-${{ matrix.os }} - path: wheelhouse/*.whl - compression-level: 0 - - build_arch_wheels: - name: Build wheels on Linux ${{ matrix.arch }} - runs-on: ubuntu-20.04 - strategy: - matrix: - arch: [aarch64] - steps: - - - uses: actions/checkout@v4 - with: - submodules: true - - - uses: docker/setup-qemu-action@v3 - with: - platforms: all - - - name: Build wheels - uses: pypa/cibuildwheel@v2.16 - env: - CIBW_ARCHS: ${{ matrix.arch }} - - name: Verify clean directory run: git diff --exit-code shell: bash @@ -102,6 +63,6 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: bdist-linux-${{ matrix.arch }} + name: bdist-${{ matrix.os }} path: wheelhouse/*.whl compression-level: 0 diff --git a/.github/workflows/push_to_master.yml b/.github/workflows/push_to_master.yml index 6651db63..39131ae6 100644 --- a/.github/workflows/push_to_master.yml +++ b/.github/workflows/push_to_master.yml @@ -40,7 +40,7 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest] steps: - uses: actions/checkout@v4 @@ -50,51 +50,12 @@ jobs: - uses: ilammy/msvc-dev-cmd@v1 if: matrix.os == 'windows-latest' - - name: Install Python - uses: actions/setup-python@v5 - with: - python-version: | - 3.9 - 3.10 - 3.11 - 3.12 - pypy3.9 - pypy3.10 - - name: Build wheels - uses: pypa/cibuildwheel@v2.16 + uses: pypa/cibuildwheel@v2.22 env: # Skip trying to test arm64 builds on Intel Macs CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64" - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: bdist-${{ matrix.os }} - path: wheelhouse/*.whl - compression-level: 0 - - build_arch_wheels: - name: Build wheels on Linux ${{ matrix.arch }} - runs-on: ubuntu-20.04 - strategy: - matrix: - arch: [aarch64] - steps: - - - uses: actions/checkout@v4 - with: - submodules: true - - - uses: docker/setup-qemu-action@v3 - with: - platforms: all - - - name: Build wheels - uses: pypa/cibuildwheel@v2.16 - env: - CIBW_ARCHS: ${{ matrix.arch }} - - name: Verify clean directory run: git diff --exit-code shell: bash @@ -102,7 +63,7 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: bdist-linux-${{ matrix.arch }} + name: bdist-${{ matrix.os }} path: wheelhouse/*.whl compression-level: 0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d303e6d9..7f1dc649 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,7 +43,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest] steps: - uses: actions/checkout@v @@ -53,51 +53,12 @@ jobs: - uses: ilammy/msvc-dev-cmd@v1 if: matrix.os == 'windows-latest' - - name: Install Python - uses: actions/setup-python@v5 - with: - python-version: | - 3.9 - 3.10 - 3.11 - 3.12 - pypy3.9 - pypy3.10 - - name: Build wheels - uses: pypa/cibuildwheel@v2.16 + uses: pypa/cibuildwheel@v2.22 env: # Skip trying to test arm64 builds on Intel Macs CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64" - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: bdist-${{ matrix.os }} - path: wheelhouse/*.whl - compression-level: 0 - - build_arch_wheels: - name: Build wheels on Linux ${{ matrix.arch }} - runs-on: ubuntu-20.04 - strategy: - matrix: - arch: [aarch64] - steps: - - - uses: actions/checkout@v4 - with: - submodules: true - - - uses: docker/setup-qemu-action@v3 - with: - platforms: all - - - name: Build wheels - uses: pypa/cibuildwheel@v2.16 - env: - CIBW_ARCHS: ${{ matrix.arch }} - - name: Verify clean directory run: git diff --exit-code shell: bash @@ -105,7 +66,7 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: bdist-linux-${{ matrix.arch }} + name: bdist-${{ matrix.os }} path: wheelhouse/*.whl compression-level: 0 diff --git a/INSTALL-windows.md b/INSTALL-windows.md index 4debd572..674ca290 100644 --- a/INSTALL-windows.md +++ b/INSTALL-windows.md @@ -1,7 +1,7 @@ # How to install python-rtmidi from source on Windows These instructions should work for installing `python-rtmidi` from source with -Python 3.8+ in the 64-bit or 32-bit versions (you can run the latter on Windows +Python 3.9+ in the 64-bit or 32-bit versions (you can run the latter on Windows 64-bit versions with no problems). Please follow all the steps below in the exact order. @@ -10,8 +10,8 @@ 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.12 at the time of writing, at least - 3.8+) from to the default +1. Install the latest release of Python (3.13 at the time of writing, at least + 3.9+) from to the default location (e.g. `C:\Python312`). You can install either or both the 32-bit and the 64-bit version. diff --git a/README.md b/README.md index 7460de95..504e7311 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Windows (MultiMedia System) operating systems. provides a thin wrapper around the RtMidi C++ interface. The API is basically the same as the C++ one but with the naming scheme of classes, methods and parameters adapted to the Python PEP-8 conventions and requirements of the -Python package naming structure. **python-rtmidi** supports Python 3 (3.8+). +Python package naming structure. **python-rtmidi** supports Python 3 (3.9+). The [documentation] provides installation instructions, a history of changes per release and an API reference. diff --git a/pyproject.toml b/pyproject.toml index e28c53f3..187145b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,11 +28,11 @@ classifiers = [ "Operating System :: MacOS :: MacOS X", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Multimedia :: Sound/Audio :: MIDI", "Topic :: Software Development :: Libraries :: Python Modules", ] @@ -63,11 +63,11 @@ file = "LICENSE.md" [tool.black] line-length = 99 target-version = [ - "py38", "py39", "py310", "py311", "py312", + "py313", ] [tool.isort] @@ -96,10 +96,11 @@ manylinux-aarch64-image = "manylinux_2_28" test-requires = "pytest" test-command = "pytest -v -m ci {package}/tests" -# Install system library [tool.cibuildwheel.linux] -build = ["cp3{9,10,11,12}-manylinux*", "pp3{9,10}-manylinux*"] +build = ["cp3{9,10,11,12,13}-manylinux*", "pp3{9,10,11}-manylinux*"] archs = ["auto64"] +enable = ["pypy"] +# Install system libraries before-all = [ "dnf -y install alsa-lib-devel alsa-utils", "curl -o jack2-1.9.22.tar.gz https://codeload.github.com/jackaudio/jack2/tar.gz/refs/tags/v1.9.22", @@ -112,9 +113,9 @@ before-all = [ repair-wheel-command = "auditwheel repair --exclude libasound.so.2 --lib-sdir . -w {dest_dir} {wheel}" [tool.cibuildwheel.macos] -build = "cp3{9,10,11,12}-macosx*" +build = "cp3{9,10,11,12,13}-macosx*" archs = ["x86_64", "arm64"] [tool.cibuildwheel.windows] -build = "cp3{9,10,11,12}-win*" +build = "cp3{9,10,11,12,13}-win*" archs = ["AMD64"] diff --git a/src/_rtmidi.pyx b/src/_rtmidi.pyx index 3019ffe8..48598077 100644 --- a/src/_rtmidi.pyx +++ b/src/_rtmidi.pyx @@ -19,7 +19,7 @@ and Windows (MultiMedia System) operating systems. provides a thin wrapper around the RtMidi C++ interface. The API is basically the same as the C++ one but with the naming scheme of classes, methods and parameters adapted to the Python PEP-8 conventions and requirements of the -Python package naming structure. **python-rtmidi** supports Python 3 (3.8+). +Python package naming structure. **python-rtmidi** supports Python 3 (3.9+). Usage example diff --git a/tox.ini b/tox.ini index 41a5501f..2aec0341 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = flake8, py38, py39, py310, py311, py312 +envlist = flake8, py39, py310, py311, py312, py313 skip_missing_interpreters = True isolated_build = True