From a5624fcd2c662752cd83fc0147d3dce094fbbaad Mon Sep 17 00:00:00 2001 From: Malcolm Smith Date: Sun, 28 Jun 2026 06:05:08 +0100 Subject: [PATCH] Android fixes (#2933) * Update Android test repository URL * Update to current Python versions, and remove patch which isn't needed anymore --- cibuildwheel/platforms/android.py | 4 ---- cibuildwheel/resources/android/android.patch | 11 ----------- cibuildwheel/resources/build-platforms.toml | 4 ++-- test/test_android.py | 2 +- 4 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 cibuildwheel/resources/android/android.patch diff --git a/cibuildwheel/platforms/android.py b/cibuildwheel/platforms/android.py index 5e47196b..6d31bb1c 100644 --- a/cibuildwheel/platforms/android.py +++ b/cibuildwheel/platforms/android.py @@ -223,10 +223,6 @@ def setup_target_python(config: PythonConfiguration, build_path: Path) -> Path: python_dir.mkdir() shutil.unpack_archive(python_tgz, python_dir) - # Patch a testbed bug. This code and the patch file can both be removed once we've - # updated to Python versions that include the fix. - call("patch", "-p1", "-i", RESOURCES_ANDROID / "android.patch", cwd=python_dir) - # Work around https://github.com/python/cpython/issues/138800. This can be removed # once we've updated to Python versions that include the fix. pc_path = python_dir / f"prefix/lib/pkgconfig/python-{config.version}.pc" diff --git a/cibuildwheel/resources/android/android.patch b/cibuildwheel/resources/android/android.patch deleted file mode 100644 index f2d6ff98..00000000 --- a/cibuildwheel/resources/android/android.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/android.py -+++ b/android.py -@@ -1021,7 +1021,7 @@ def main(): - context = parse_args() - - # Set the CROSS_BUILD_DIR if an argument was provided -- if context.cross_build_dir: -+ if getattr(context, "cross_build_dir", None): - global CROSS_BUILD_DIR - CROSS_BUILD_DIR = context.cross_build_dir.resolve() - diff --git a/cibuildwheel/resources/build-platforms.toml b/cibuildwheel/resources/build-platforms.toml index 3dbce5ad..0d760b8a 100644 --- a/cibuildwheel/resources/build-platforms.toml +++ b/cibuildwheel/resources/build-platforms.toml @@ -222,8 +222,8 @@ python_configurations = [ [android] python_configurations = [ - { identifier = "cp313-android_arm64_v8a", version = "3.13", url = "https://repo.maven.apache.org/maven2/com/chaquo/python/python/3.13.13/python-3.13.13-aarch64-linux-android.tar.gz", sha256 = "a21250c246b36eb704be096be51e40ab24cafa3ae1d7ca4c396e6bf780cf87cf" }, - { identifier = "cp313-android_x86_64", version = "3.13", url = "https://repo.maven.apache.org/maven2/com/chaquo/python/python/3.13.13/python-3.13.13-x86_64-linux-android.tar.gz", sha256 = "b021b76df2c8d64e41c76d18a2d91f27652356bd932c06f9076bac1b664c0e37" }, + { identifier = "cp313-android_arm64_v8a", version = "3.13", url = "https://repo.maven.apache.org/maven2/com/chaquo/python/python/3.13.14/python-3.13.14-aarch64-linux-android.tar.gz", sha256 = "2541c4fa77b6543504c97fa90a71c745225b5800fe25bc8c73a6516b594d0cbc" }, + { identifier = "cp313-android_x86_64", version = "3.13", url = "https://repo.maven.apache.org/maven2/com/chaquo/python/python/3.13.14/python-3.13.14-x86_64-linux-android.tar.gz", sha256 = "9d96f7e077677b6651b2e756034ed41ab4479f5f8bf3168a814f458bc2ac137e" }, { identifier = "cp314-android_arm64_v8a", version = "3.14", url = "https://www.python.org/ftp/python/3.14.6/python-3.14.6-aarch64-linux-android.tar.gz", sha256 = "38bbe77d3167b5cd554e03b1021324926f09f3825202b065951dd7638e9c37e5" }, { identifier = "cp314-android_x86_64", version = "3.14", url = "https://www.python.org/ftp/python/3.14.6/python-3.14.6-x86_64-linux-android.tar.gz", sha256 = "e04eb26607627e68d148f89de793372f54a345c91b13628567f24abcdd3bfa3e" }, { identifier = "cp315-android_arm64_v8a", version = "3.15", url = "https://www.python.org/ftp/python/3.15.0/python-3.15.0b2-aarch64-linux-android.tar.gz", sha256 = "de5e36ffc3c33b63a1ed53fe83db4dee16b003a3180ac35e5c4c203d3750e076" }, diff --git a/test/test_android.py b/test/test_android.py index 59cec2c2..91c6ab33 100644 --- a/test/test_android.py +++ b/test/test_android.py @@ -690,7 +690,7 @@ def test_xbuild_files(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None add_env={ **cp313_env, # TODO: remove this once there are official Android NumPy wheels on PyPI. - "PIP_EXTRA_INDEX_URL": "https://chaquo.com/pypi-test", + "PIP_EXTRA_INDEX_URL": "https://chaquo.com/pypi-upstream", "CIBW_ARCHS": "all", # Include both native and non-native archs. "CIBW_TEST_COMMAND": f"python -c '{script}'", },