From 5f6daced55b9fc112b4ab85fa4c351f94fea0523 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Thu, 18 Jun 2026 11:46:04 -0700 Subject: [PATCH] Android ABI list now driven by manifest's per-minor android_abis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Snapshot from python-build release 20260618, which adds `android_abis` on each `pythons.` entry. Replaces the hardcoded `if pythonVersion == "3.12" then 3 ABIs else 2 ABIs` branch in `serious_python_android/android/build.gradle.kts` with a read of `.android_abis` from `python_versions.properties` (drives both `defaultConfig.ndk.abiFilters` and the per-ABI download/copy fan-out). - `gen_version_tables` emits `androidAbis: List` on the generated `PythonRelease` class and one `.android_abis=` line per minor in each native package's `python_versions.properties`. - `package_command.dart` forwards `androidAbis` from `baseRelease` to the per-run `PythonRelease` it constructs. - Pinned release bumped 20260614 -> 20260618. Adding a future minor (or flipping a 32-bit support decision) is now a one-line manifest edit in python-build — no Gradle / Dart change here. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/serious_python/CHANGELOG.md | 1 + src/serious_python/bin/gen_version_tables.dart | 12 ++++++++++++ src/serious_python/bin/package_command.dart | 1 + src/serious_python/lib/src/python_versions.dart | 14 ++++++++++++-- .../android/build.gradle.kts | 14 ++++++++------ .../android/python_versions.properties | 7 +++++-- .../darwin/python_versions.properties | 7 +++++-- .../linux/python_versions.properties | 7 +++++-- .../windows/python_versions.properties | 7 +++++-- 9 files changed, 54 insertions(+), 16 deletions(-) diff --git a/src/serious_python/CHANGELOG.md b/src/serious_python/CHANGELOG.md index 72ce22b0..ce5c0626 100644 --- a/src/serious_python/CHANGELOG.md +++ b/src/serious_python/CHANGELOG.md @@ -10,6 +10,7 @@ * Cache downloaded Python distributions and `dart_bridge` artifacts under `$FLET_CACHE_DIR` (default `~/.flet/cache`) across all platforms. * Remove the scaffold `getPlatformVersion` method from the platform plugins. * Drop the `x86` (32-bit Intel) Android ABI — Flutter no longer produces it. Android builds target `arm64-v8a` + `x86_64` (plus `armeabi-v7a` on Python 3.12); the `x86` wheel platform-tag entry and the Android packaging rules referencing it are removed. +* Android ABI list now reads from python-build's manifest (per-minor `android_abis`, surfaced as `.android_abis` in `python_versions.properties` and `PythonRelease.androidAbis` in the generated Dart) instead of the hardcoded `if pythonVersion == "3.12"` branch in `serious_python_android/android/build.gradle.kts`. Drives both `defaultConfig.ndk.abiFilters` and the per-ABI download/copy fan-out; adding a future minor only needs the one-line manifest edit. * **Breaking change:** the `configure` command (and the bare in-place version-switching machinery, including `stageDarwinRuntime`) is removed. Switching the bundled Python version between builds is now handled by a clean rebuild — `flet build` wipes its build dir on a version change, and the Darwin `dist_ios` / `dist_macos` version marker re-extracts the runtime — so a separate `serious_python configure` step is no longer needed. * **Bug fix:** the Pyodide 0.29 wheel platform tag for the 3.13 row was `pyodide-2025.0-wasm32`, but Pyodide publishes 0.29 wheels under `pyemscripten_2025_0_wasm32`; corrected to `pyemscripten-2025.0-wasm32` so `flet build web --python-version 3.13` matches native wheels. diff --git a/src/serious_python/bin/gen_version_tables.dart b/src/serious_python/bin/gen_version_tables.dart index d4dc43af..cc497ced 100644 --- a/src/serious_python/bin/gen_version_tables.dart +++ b/src/serious_python/bin/gen_version_tables.dart @@ -128,6 +128,7 @@ String _dartFile(String release, String defaultPython, String dartBridge, ..writeln(' required this.standaloneReleaseDate,') ..writeln(' required this.pyodideVersion,') ..writeln(' required this.pyodidePlatformTag,') + ..writeln(' required this.androidAbis,') ..writeln(' required this.prerelease,') ..writeln(' });') ..writeln() @@ -135,18 +136,27 @@ String _dartFile(String release, String defaultPython, String dartBridge, ..writeln(' final String standaloneReleaseDate;') ..writeln(' final String pyodideVersion;') ..writeln(' final String pyodidePlatformTag;') + ..writeln('') + ..writeln(' /// Android ABIs python-build publishes distributions for') + ..writeln(' /// this minor. 32-bit Android was dropped in 3.13 (PEP 738);') + ..writeln(' /// only 3.12 still carries `armeabi-v7a`.') + ..writeln(' final List androidAbis;') + ..writeln('') ..writeln(' final bool prerelease;') ..writeln('}') ..writeln() ..writeln('const pythonReleases = {'); for (final s in shorts) { final r = pythons[s] as Map; + final abis = (r['android_abis'] as List).cast(); + final abisLiteral = abis.map((a) => '"$a"').join(', '); b ..writeln(' "$s": PythonRelease(') ..writeln(' standaloneVersion: "${r['full_version']}",') ..writeln(' standaloneReleaseDate: "${r['standalone_release_date']}",') ..writeln(' pyodideVersion: "${r['pyodide_version']}",') ..writeln(' pyodidePlatformTag: "${r['pyodide_platform_tag']}",') + ..writeln(' androidAbis: [$abisLiteral],') ..writeln(' prerelease: ${r['prerelease'] == true},') ..writeln(' ),'); } @@ -165,6 +175,8 @@ String _propertiesFile(String release, String defaultPython, String dartBridge, for (final s in shorts) { final r = pythons[s] as Map; b.writeln('$s.full_version=${r['full_version']}'); + final abis = (r['android_abis'] as List).cast(); + b.writeln('$s.android_abis=${abis.join(",")}'); } return b.toString(); } diff --git a/src/serious_python/bin/package_command.dart b/src/serious_python/bin/package_command.dart index 720a1f09..474b824e 100644 --- a/src/serious_python/bin/package_command.dart +++ b/src/serious_python/bin/package_command.dart @@ -226,6 +226,7 @@ class PackageCommand extends Command { Platform.environment[pyodideVersionEnvironmentVariable] ?? baseRelease.pyodideVersion, pyodidePlatformTag: baseRelease.pyodidePlatformTag, + androidAbis: baseRelease.androidAbis, prerelease: baseRelease.prerelease, ); final preNote = _release.prerelease ? " — pre-release" : ""; diff --git a/src/serious_python/lib/src/python_versions.dart b/src/serious_python/lib/src/python_versions.dart index eac66b3b..27f20ac9 100644 --- a/src/serious_python/lib/src/python_versions.dart +++ b/src/serious_python/lib/src/python_versions.dart @@ -1,5 +1,5 @@ // GENERATED by `dart run serious_python:gen_version_tables` from python-build's -// manifest.json (release 20260614). Do not edit by hand — edit python-build's +// manifest.json (release 20260618). Do not edit by hand — edit python-build's // manifest.json, cut a release, bump `pythonReleaseDate`, and regenerate. const pythonVersionEnvironmentVariable = "SERIOUS_PYTHON_VERSION"; @@ -10,7 +10,7 @@ const pyodideVersionEnvironmentVariable = "SERIOUS_PYTHON_PYODIDE_VERSION"; const dartBridgeVersionEnvironmentVariable = "DART_BRIDGE_VERSION"; /// python-build release the bundled runtimes come from (YYYYMMDD). -const pythonReleaseDate = "20260614"; +const pythonReleaseDate = "20260618"; const dartBridgeVersion = "1.4.0"; const defaultPythonVersion = "3.14"; @@ -20,6 +20,7 @@ class PythonRelease { required this.standaloneReleaseDate, required this.pyodideVersion, required this.pyodidePlatformTag, + required this.androidAbis, required this.prerelease, }); @@ -27,6 +28,12 @@ class PythonRelease { final String standaloneReleaseDate; final String pyodideVersion; final String pyodidePlatformTag; + + /// Android ABIs python-build publishes distributions for + /// this minor. 32-bit Android was dropped in 3.13 (PEP 738); + /// only 3.12 still carries `armeabi-v7a`. + final List androidAbis; + final bool prerelease; } @@ -36,6 +43,7 @@ const pythonReleases = { standaloneReleaseDate: "20260610", pyodideVersion: "0.27.7", pyodidePlatformTag: "pyodide-2024.0-wasm32", + androidAbis: ["arm64-v8a", "x86_64", "armeabi-v7a"], prerelease: false, ), "3.13": PythonRelease( @@ -43,6 +51,7 @@ const pythonReleases = { standaloneReleaseDate: "20260610", pyodideVersion: "0.29.4", pyodidePlatformTag: "pyemscripten-2025.0-wasm32", + androidAbis: ["arm64-v8a", "x86_64"], prerelease: false, ), "3.14": PythonRelease( @@ -50,6 +59,7 @@ const pythonReleases = { standaloneReleaseDate: "20260610", pyodideVersion: "314.0.0", pyodidePlatformTag: "pyemscripten-2026.0-wasm32", + androidAbis: ["arm64-v8a", "x86_64"], prerelease: false, ), }; diff --git a/src/serious_python_android/android/build.gradle.kts b/src/serious_python_android/android/build.gradle.kts index f50a6f80..c277c822 100644 --- a/src/serious_python_android/android/build.gradle.kts +++ b/src/serious_python_android/android/build.gradle.kts @@ -49,12 +49,14 @@ if (pythonFullVersion == null) { throw GradleException("serious_python: unknown SERIOUS_PYTHON_VERSION '$pythonVersion'. Supported: ${known.joinToString(", ")}") } -// python-build dropped 32-bit Android in 3.13 (PEP 738), so the -// python-android-dart--armeabi-v7a tarball only exists for 3.12. -val abis: List = if (pythonVersion == "3.12") - listOf("arm64-v8a", "armeabi-v7a", "x86_64") -else - listOf("arm64-v8a", "x86_64") +// ABIs come from python-build's manifest (the per-minor `android_abis` array, +// flattened into python_versions.properties by `gen_version_tables`). 3.12 +// still ships armeabi-v7a; 3.13+ are 64-bit-only (PEP 738). A future minor +// only needs the manifest edit — no Gradle change here. +val abis: List = (pv.getProperty("$pythonVersion.android_abis") + ?: throw GradleException( + "serious_python: python_versions.properties has no '$pythonVersion.android_abis'")) + .split(",").map { it.trim() }.filter { it.isNotEmpty() } configure { namespace = "com.flet.serious_python_android" diff --git a/src/serious_python_android/android/python_versions.properties b/src/serious_python_android/android/python_versions.properties index 7cc4bbe2..2fc624e2 100644 --- a/src/serious_python_android/android/python_versions.properties +++ b/src/serious_python_android/android/python_versions.properties @@ -1,8 +1,11 @@ # GENERATED by `dart run serious_python:gen_version_tables` from -# python-build manifest.json (release 20260614). Do not edit by hand. +# python-build manifest.json (release 20260618). Do not edit by hand. default_python_version=3.14 dart_bridge_version=1.4.0 -python_build_release_date=20260614 +python_build_release_date=20260618 3.12.full_version=3.12.13 +3.12.android_abis=arm64-v8a,x86_64,armeabi-v7a 3.13.full_version=3.13.14 +3.13.android_abis=arm64-v8a,x86_64 3.14.full_version=3.14.6 +3.14.android_abis=arm64-v8a,x86_64 diff --git a/src/serious_python_darwin/darwin/python_versions.properties b/src/serious_python_darwin/darwin/python_versions.properties index 7cc4bbe2..2fc624e2 100644 --- a/src/serious_python_darwin/darwin/python_versions.properties +++ b/src/serious_python_darwin/darwin/python_versions.properties @@ -1,8 +1,11 @@ # GENERATED by `dart run serious_python:gen_version_tables` from -# python-build manifest.json (release 20260614). Do not edit by hand. +# python-build manifest.json (release 20260618). Do not edit by hand. default_python_version=3.14 dart_bridge_version=1.4.0 -python_build_release_date=20260614 +python_build_release_date=20260618 3.12.full_version=3.12.13 +3.12.android_abis=arm64-v8a,x86_64,armeabi-v7a 3.13.full_version=3.13.14 +3.13.android_abis=arm64-v8a,x86_64 3.14.full_version=3.14.6 +3.14.android_abis=arm64-v8a,x86_64 diff --git a/src/serious_python_linux/linux/python_versions.properties b/src/serious_python_linux/linux/python_versions.properties index 7cc4bbe2..2fc624e2 100644 --- a/src/serious_python_linux/linux/python_versions.properties +++ b/src/serious_python_linux/linux/python_versions.properties @@ -1,8 +1,11 @@ # GENERATED by `dart run serious_python:gen_version_tables` from -# python-build manifest.json (release 20260614). Do not edit by hand. +# python-build manifest.json (release 20260618). Do not edit by hand. default_python_version=3.14 dart_bridge_version=1.4.0 -python_build_release_date=20260614 +python_build_release_date=20260618 3.12.full_version=3.12.13 +3.12.android_abis=arm64-v8a,x86_64,armeabi-v7a 3.13.full_version=3.13.14 +3.13.android_abis=arm64-v8a,x86_64 3.14.full_version=3.14.6 +3.14.android_abis=arm64-v8a,x86_64 diff --git a/src/serious_python_windows/windows/python_versions.properties b/src/serious_python_windows/windows/python_versions.properties index 7cc4bbe2..2fc624e2 100644 --- a/src/serious_python_windows/windows/python_versions.properties +++ b/src/serious_python_windows/windows/python_versions.properties @@ -1,8 +1,11 @@ # GENERATED by `dart run serious_python:gen_version_tables` from -# python-build manifest.json (release 20260614). Do not edit by hand. +# python-build manifest.json (release 20260618). Do not edit by hand. default_python_version=3.14 dart_bridge_version=1.4.0 -python_build_release_date=20260614 +python_build_release_date=20260618 3.12.full_version=3.12.13 +3.12.android_abis=arm64-v8a,x86_64,armeabi-v7a 3.13.full_version=3.13.14 +3.13.android_abis=arm64-v8a,x86_64 3.14.full_version=3.14.6 +3.14.android_abis=arm64-v8a,x86_64