diff --git a/crates/uv-python/python/get_interpreter_info.py b/crates/uv-python/python/get_interpreter_info.py index 46901a40f1438..09e94719a9b8a 100644 --- a/crates/uv-python/python/get_interpreter_info.py +++ b/crates/uv-python/python/get_interpreter_info.py @@ -487,6 +487,8 @@ def get_operating_system_and_architecture(): "minor": glibc_version[1], } elif hasattr(sys, "getandroidapilevel"): + # On Python <3.13, Android reports itself as "linux" + # See `operation_system == "android"` branch for Python 3.13+ below operating_system = { "name": "android", "api_level": sys.getandroidapilevel(), @@ -550,6 +552,26 @@ def get_operating_system_and_architecture(): "major": int(version[0]), "minor": int(version[1]), } + elif operating_system == "android": + # Python 3.13+ supports Android. We map the Android ABIs to our standard architectures. + # + # See: + # + # - https://peps.python.org/pep-0738/ + # - https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/#android + # - https://developer.android.com/ndk/guides/abis#sa + android_abi_to_arch = { + "arm64_v8a": "aarch64", + "armeabi_v7a": "armv7l", + "x86": "i686", + "x86_64": "x86_64", + } + architecture = android_abi_to_arch.get(architecture, architecture) + + operating_system = { + "name": "android", + "api_level": sys.getandroidapilevel(), + } elif operating_system in [ "freebsd", "netbsd",