Android updates (#2568)

* Add Python 3.14 for Android

* Simplify GitHub Actions workflows

* Update tests

* Allow running `patchelf` even when the environment's `bin` directory is not on the PATH

* Search in both the environment's bin directory and the PATH

* Use `sysconfig.get_path`

* Fix lint warning
This commit is contained in:
Malcolm Smith
2025-09-08 15:58:03 +01:00
committed by GitHub
parent 3f076ba487
commit 0826975570
13 changed files with 149 additions and 167 deletions
+13 -1
View File
@@ -1,7 +1,9 @@
import os
import platform
import re
import sys
from dataclasses import dataclass
from pathlib import Path
from shutil import rmtree
from subprocess import CalledProcessError
from textwrap import dedent
@@ -353,11 +355,21 @@ def test_libcxx(tmp_path, capfd):
project_dir = tmp_path / "project"
output_dir = tmp_path / "output"
# cibuildwheel should be able to run `patchelf` and `wheel` even when its
# environment's `bin` directory is not on the PATH.
non_venv_path = ":".join(
item for item in os.environ["PATH"].split(":") if Path(item) != Path(sys.executable).parent
)
# A C++ package should include libc++, and the extension module should be able to
# find it using DT_RUNPATH.
new_c_project(setup_py_extension_args_add="language='c++'").generate(project_dir)
script = 'import spam; print(", ".join(f"{s}: {spam.filter(s)}" for s in ["ham", "spam"]))'
cp313_test_env = {**cp313_env, "CIBW_TEST_COMMAND": f"python -c '{script}'"}
cp313_test_env = {
**cp313_env,
"CIBW_TEST_COMMAND": f"python -c '{script}'",
"PATH": non_venv_path,
}
# Including external libraries requires API level 24.
with pytest.raises(CalledProcessError):
+1 -3
View File
@@ -100,9 +100,7 @@ def test_ios_platforms(tmp_path, build_config, monkeypatch, capfd):
)
# The expected wheels were produced.
expected_wheels = utils.expected_wheels(
"spam", "0.1.0", platform="ios", python_abi_tags=["cp313-cp313", "cp314-cp314"]
)
expected_wheels = utils.expected_wheels("spam", "0.1.0", platform="ios")
assert set(actual_wheels) == set(expected_wheels)
# The user was notified that the cross-build tool was found.
+14 -3
View File
@@ -261,9 +261,20 @@ def _expected_wheels(
musllinux_versions = ["musllinux_1_2"]
if platform == "pyodide" and python_abi_tags is None:
python_abi_tags = ["cp312-cp312", "cp313-cp313"]
elif platform in {"android", "ios"} and python_abi_tags is None:
python_abi_tags = ["cp313-cp313"]
python_abi_tags = [
"cp312-cp312",
"cp313-cp313",
]
elif platform == "android" and python_abi_tags is None: # noqa: SIM114
python_abi_tags = [
"cp313-cp313",
"cp314-cp314",
]
elif platform == "ios" and python_abi_tags is None:
python_abi_tags = [
"cp313-cp313",
"cp314-cp314",
]
elif python_abi_tags is None:
python_abi_tags = [
"cp38-cp38",