recipe-tester: run on-device tests against the Flet 0.86#104
Merged
Conversation
Two Flet-0.86 packaging changes broke the on-device pytest run once the app's flet was pinned to 0.86 (past the certifi/AF_UNIX crashes): - cwd is now <container>/Library/Application Support/data, so main.py's relative 'recipe_tests' rootdir/target no longer resolved (pytest EXIT 4). Anchor the path to __file__ instead. - the app is compiled to .pyc with the source stripped by default; pytest only collects .py, so 0 tests were collected (EXIT 5). Set [tool.flet.compile] app = false so the app/test source is kept (--compile-packages stays on). Verified on an iPhone 16 simulator: collected + passed + EXIT 0.
…al packages, and Flet >=0.86 compatibility
The iOS 'Stage tests + build recipe-tester iOS sim app' step referenced $INPUT_PYTHON_VERSION but never set it in env (only the APK step did). Under set -u the var was unbound, so --python-version expanded to '' and flet build defaulted to Python 3.14 — whose iOS stdlib lacks _pyrepl, so pytest's pdb import crashed with INTERNALERROR (EXIT 3) even on the 3.12 leg. Set the var like the APK lane so iOS bundles the matrix Python (3.12).
The unquoted '>=' in 'uvx --with flet-cli>=0.86.0.dev0' was parsed by the shell as a redirection (> to a file '=0.86.0.dev0'), dropping the version constraint — so flet-cli/flet resolved to stable 0.85.3, whose 'flet build' rejects --python-version and the build failed on both platforms. Quote the specifiers and pass --prerelease allow (a >=dev bound alone doesn't enable prereleases). Verified: uvx --prerelease allow --with 'flet-cli>=0.86.0.dev0' flet --version -> 0.86.0.dev2.
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.
Changes
Bump the test toolchain to 0.86.0.dev
build-wheels-version.yml: the recipe-testerflet build apk/flet build ios-simulatorsteps now pin--with flet-cli>=0.86.0.dev0 --with flet>=0.86.0.dev0and pass--python-version.tests/recipe-tester/pyproject.toml.tpl: app deps pinnedflet>=0.86.0.dev0(andflet[all]in the dev group).Adapt the recipe-tester to 0.86 packaging
tests/recipe-tester/main.py: anchor the pytest--rootdir/target todirname(__file__)instead of the relativerecipe_tests. Flet 0.86 runs the app withcwd = <container>/Library/Application Support/data, so the relative path no longer resolved (pytest EXIT 4).tests/recipe-tester/pyproject.toml.tpl:[tool.flet.compile] app = false. Flet 0.86 compiles the app to.pycand strips the source by default; pytest only collects.py, so the bundled tests reported "0 items" (EXIT 5). This keeps the app/test source as.py; bundled packages are still compiled (compile.packagesuntouched).Depends on the serious_python x86_64 fix
Android x86_64 still fails on
ModuleNotFoundError: certifibecause serious_python 4.3.0 packs an emptysitepackages.zipfor the x86_64 Android build (arm64-v8a is fine; x86_64 is inandroid_abis, andbuild/site-packages/x86_64/is populated — it just isn't zipped). Will be fixed by flet-dev/serious-python#229.