From b136e5a082a007cf424ff1fe93a2dd9b27423e18 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Sun, 30 Nov 2025 15:21:03 -0800 Subject: [PATCH 1/2] Require running bintool on universal Python on macOS for wheel testing /usr/bin/python3 is Python 3.9.6 from Xcode. Instead of forcibly using it for wheel tests, use the Python we were run with, but require that to be a universal2 binary. These are available from the official Python installers and thus from actions/setup-python, but notably not from Homebrew or from MacPorts by default. Signed-off-by: Benjamin Gilbert --- .github/workflows/build.yml | 5 +++++ bintool | 16 ++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8d312d8..0db2bbc3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -196,6 +196,11 @@ jobs: # packaging needed by glib python3 -m pip install --break-system-packages license-expression \ packaging + - name: Install Python (macOS) + if: matrix.os == 'macos' + uses: actions/setup-python@v6 + with: + python-version: '3.14' - name: Download source tarball uses: actions/download-artifact@v6 with: diff --git a/bintool b/bintool index 4590c1f6..5b9e3fd5 100755 --- a/bintool +++ b/bintool @@ -35,6 +35,7 @@ import platform import shutil import subprocess import sys +import sysconfig import tarfile from tempfile import TemporaryDirectory from typing import Any, BinaryIO, Self @@ -534,14 +535,17 @@ class WheelSmokeTester(SmokeTester): def _unpack(self, dir: Path) -> None: log('Creating virtualenv') - # /usr/bin/python3 on macOS because sys.executable may not be a - # universal binary - python = ( - '/usr/bin/python3' if self._system == 'macos' else sys.executable - ) + if ( + self._system == 'macos' + and '-universal2' not in sysconfig.get_platform() + ): + raise Exception( + 'Testing macOS wheels requires bintool to be run with a ' + 'Python built as a universal binary' + ) # resolve 8.3 shortname of tempdir to avoid venv warning on Windows # https://github.com/python/cpython/issues/90329 - subprocess.check_call([python, '-m', 'venv', dir.resolve()]) + subprocess.check_call([sys.executable, '-m', 'venv', dir.resolve()]) if self._update_pip: subprocess.check_call( [ From 2bd5426beb2b2e6b9360f9a3f059559316d86506 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Thu, 20 Nov 2025 15:03:14 -0800 Subject: [PATCH 2/2] Drop Python wheel support for Python 3.9 Python 3.9 is EOL. This loses us support for Debian 11 (oldoldstable), the default Python on EL 9, and /usr/bin/python3 on macOS. The minimum supported Python on EL 8 now has a new enough pip. Signed-off-by: Benjamin Gilbert --- artifacts/python/README.md | 6 +----- artifacts/python/pyproject.in.toml | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/artifacts/python/README.md b/artifacts/python/README.md index 026f9e20..f5b9b534 100644 --- a/artifacts/python/README.md +++ b/artifacts/python/README.md @@ -20,17 +20,13 @@ of OpenSlide. Install with `pip install openslide-bin`. OpenSlide Python ≥ 1.4.0 will automatically find openslide-bin and use it. -openslide-bin is available for Python 3.9+ on the following platforms: +openslide-bin is available for Python 3.10+ on the following platforms: - Linux aarch64 and x86_64 with glibc 2.28+ (Debian, Fedora, RHEL 8+, Ubuntu, many others) - macOS 11+ (arm64 and x86_64) - Windows 10+ and Windows Server 2016+ (x64) -pip older than 20.3 cannot install openslide-bin, claiming that it `is not a -supported wheel on this platform`. On platforms with these versions of pip -(RHEL 8), upgrade pip first with `pip install --upgrade pip`. - ## Using Use OpenSlide via [OpenSlide Python][]. The OpenSlide Python diff --git a/artifacts/python/pyproject.in.toml b/artifacts/python/pyproject.in.toml index 3eb2e0f7..14a41160 100644 --- a/artifacts/python/pyproject.in.toml +++ b/artifacts/python/pyproject.in.toml @@ -19,7 +19,6 @@ classifiers = [ "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -28,7 +27,7 @@ classifiers = [ "Topic :: Scientific/Engineering :: Bio-Informatics", "Typing :: Typed", ] -requires-python = ">= 3.9" +requires-python = ">= 3.10" [project.urls] Homepage = "https://openslide.org/"