Repository navigation
PyMobile 0.15.0 - #4
Merged
Merged
Conversation
The audit's two blockers are closed, plus everything that was cheap enough to finish in the same release. Every item below was reproduced first, fixed in the code, and is held by a test that fails without the change. Publishing (A10, A1) - `build --native --bundle` writes an `.aab` beside the APK, from the same manifest, dex, assets and native libraries, and validates it with bundletool (`validate` + `build-apks --mode=universal`). Three packaging defects only bundletool could see were fixed on the way: the manifest was copied as binary APK bytes instead of a proto XmlNode, `base/res/` was fed the compiler's `.flat` intermediates, and native libraries were looked for in the wrong directory (so a bundle carried none at all). - Default `target_sdk` is 36 and `setup-sdk` installs `platforms;android-36`, the level Play requires from 31 August 2026. The new-project template still said 35, so a fresh project would have been rejected after all of this. - `find_toolchain()` compiles against `SDK_PLATFORM` rather than `target_sdk`, so the compiled level and the declared level cannot disagree. - A destroyed Activity no longer takes the interpreter with it: `onDestroy` sends a `__lifecycle__`/`stop` event, `Screen.on_stop()` runs, widget state is kept, and the next window resumes the same app with `Screen.on_start()`. Input that arrives after the stop is dropped. On the device (A2, A3, A4, A5, A9, A18, A19) - The root container applies system-bar, cutout and IME insets itself; `adjustResize` and an `app:insets` event cover the keyboard. - Images are decoded on a worker thread, scaled to the view, EXIF-rotated, and a decode that loses the race against a newer source is discarded. - `supportsRtl` and start/end margins, so Arabic and Hebrew mirror. - The startup screen follows the system theme, and a light/dark switch reaches Python as `app:system-theme` (`App(follow_system_theme=True)` follows it). - The back callback is registered only while there is a screen to go back to; on the root screen the platform's own "leave the app" runs again. - Three deprecated calls replaced; a remote `Image` source warns instead of drawing an empty box. Packaging and security (A17, S7) - `abis = [...]` now really packages every requested architecture in one APK; the second one used to be dropped without a word. - `[network.pins]` pins a domain to the certificates you list, which also stops the app trusting the device's user-installed roots. Storage correctness found by CI - A store that failed to load stayed failed only while the object happened to be alive: the backend registry is weak, so a pinned failure could be collected and the next open quietly retried. Failed states are now held for the process, which is what the docstring always promised. - The "1000 puts are quick" test asserted a wall-clock budget and failed on shared and Windows runners while the code was fine. It now counts storage writes (the same number everywhere) with a generous ceiling that only a quadratic regression trips, and the batching promise got its own test. Contributor and beginner experience (C5, C6, C8, N3, K11) - An Android CI job builds a signed APK and an `.aab` on every push and asserts the manifest declares target 36 and `supportsRtl`. Its first run caught a pinned action SHA that does not exist. - `docs/TUTORIAL.md` and `docs/BEGINNER-MISTAKES.md`; the tutorial's imports and every documented command are checked by tests, so a rename breaks CI instead of a newcomer's first hour. There is no `examples/` tree: the tutorial is the example. - `Storage` and `ModelStore` describe their migration keys the same way, and each error message points at the other store. Also: `--minimal-stdlib` drops what a phone cannot use (709 -> 514 packaged files), the bundled dex is rebuilt and its source hashes re-recorded. Not in this release, and not pretended otherwise: extension points (A11), AndroidX/Material (A12), RecyclerView (A13), incremental frames (A14), `.so` under `lib/` (A6) and `.pyc` in the APK (A7) need rebuilding the runtime or redesigning a subsystem; S1 depends on that same NDK rebuild. None of the Android behaviour above has been observed on a physical device here - the evidence is javac against android-36, bundletool on a real bundle, and tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Закриває два блокери аудиту (
pymobile_audit.md) і все, що було достатньо дешевим, щоб увійти в цей же реліз. Кожен пункт спершу відтворений, потім виправлений, і тримається тестом, який без правки падає.CI цього PR: прогін 43638276536 — success, усі 9 джоб (Python 3.10–3.15, Windows, Android APK+AAB). Локально: 2509 passed / 47 skipped, ruff і mypy чисто.
Публікація (A10, A1)
build --native --bundleпише.aabпоруч з APK і перевіряє йогоbundletool validate+build-apks --mode=universal. Дорогою знайдено три дефекти пакування, яких не бачив жоден юніт-тест: маніфест копіювався бінарним з APK замість protoXmlNode;base/res/годувався.flat-проміжними файлами; нативні бібліотеки шукалися не в тому каталозі, тому бандл узагалі не містив жодної.target_sdkза замовчуванням 36,setup-sdkставитьplatforms;android-36. Шаблон нового проєкту при цьому віддавав 35 — тобто свіжий проєкт усе одно не пройшов би в Play.find_toolchain()компілює протиSDK_PLATFORM, а неtarget_sdk, тож задекларований і скомпільований рівні не можуть розійтися.onDestroyшле__lifecycle__/stop,Screen.on_stop()зберігає стан, наступне вікно продовжує той самий застосунок черезScreen.on_start(). Події, що прийшли після зупинки, відкидаються.На пристрої (A2, A3, A4, A5, A9, A18, A19)
adjustResizeплюс подіяapp:insetsзакривають клавіатуру.supportsRtlіmarginStart/End— арабська й іврит дзеркаляться.app:system-theme(App(follow_system_theme=True)слідує сам).Imageпопереджає, а не малює порожнечу.Пакування і безпека (A17, S7)
abis = [...]справді пакує кожну архітектуру в один APK — друга раніше відкидалася без слова.[network.pins]пінить домен до вказаних сертифікатів, а заразом перестає довіряти користувацьким CA на пристрої.Коректність сховища, яку знайшов CI
Для контриб'ютора й новачка (C5, C6, C8, N3, K11)
.aabна кожен push і перевіряє, що маніфест оголошує target 36 іsupportsRtl. Її перший прогін зловив пінований SHA екшена, якого не існує.docs/TUTORIAL.mdіdocs/BEGINNER-MISTAKES.md; імпорти туторіала й усі документовані команди перевіряються тестами, тож перейменування ламає CI, а не першу годину новачка. Папкиexamples/у репозиторії немає — приклад це сам туторіал.StorageіModelStoreописують ключі міграцій однаково, і кожне повідомлення про помилку посилається на друге сховище.Також:
--minimal-stdlibприбирає те, що телефону не потрібне (709 → 514 файлів у APK), dex перезібрано й хеші джерел перезаписано.Чого тут свідомо немає
A11(точки розширення),A12(AndroidX/Material),A13(RecyclerView),A14(інкрементальні кадри),A6(.soуlib/) іA7(.pycв APK) вимагають перезбірки рантайму або переробки підсистеми;S1залежить від тієї ж збірки з NDK.F4іF8відкладені рішенням власника.Ніщо з Android-поведінки вище не спостерігалося на фізичному пристрої — доказ це
javacпроти android-36,bundletoolна реальному бандлі й тести. Перший прогін на телефоні може показати розбіжності, і саме тому джоба Android у CI тепер збирає артефакт на кожен push.