refactor(build): rename web build platform from Pyodide to Emscripten#6492
Merged
Conversation
…cripten` Aligns the value with `platform.system()` inside Pyodide, so PEP 508 markers on `flet`'s deps (`oauthlib`, `httpx`) work both via `flet build web` (through serious_python's sitecustomize) and when `flet` is installed directly via micropip in a Pyodide runtime. Requires the matching rename in serious_python.
Required for the `Pyodide` → `Emscripten` platform-argument rename to take effect on `flet build` runs.
Deploying flet-website-v2 with
|
| Latest commit: |
67b163c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7326f86d.flet-website-v2.pages.dev |
| Branch Preview URL: | https://pyodide-to-emscripten.flet-website-v2.pages.dev |
Deploying flet-examples with
|
| Latest commit: |
67b163c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://25868440.flet-examples.pages.dev |
| Branch Preview URL: | https://pyodide-to-emscripten.flet-examples.pages.dev |
…ts reach the host Console msgpack was only ever imported if the user's deps pulled it in (typically via flet). Apps with no flet dependency — or no pyproject.toml at all — left the python_output bridge unregistered, and their prints fell through to the browser dev console silently. Load msgpack from Pyodide's prebuilt repodata when it isn't already importable; the bridge install is now unconditional.
Integration test packages/flet/integration_tests/examples/apps/test_use_dialog.py imports `main` from each example expecting a `main(page)` callable. The wrapper was inadvertently removed in #6489, breaking pytest collection.
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.
Summary
PyodidetoEmscriptenso it matches whatplatform.system()actually returns inside a Pyodide runtime.flet'soauthlib/httpxdeps fromplatform_system != 'Pyodide'toplatform_system != 'Emscripten', so they now work consistently in both build-time pip resolution (viaserious_python's sitecustomize) and direct in-browser installs viamicropip.serious_pythonto1.0.0in theflet buildtemplate — required for the renamed--platform Emscriptenargument value. See flet-dev/serious-python#201.Why
The previous
'Pyodide'value never matched real-worldplatform.system()(which returns'Emscripten'under Pyodide). The build-time path masked the problem by monkey-patchingplatform.system()to return'Pyodide'viaserious_python's injectedsitecustomize.py. But anyone installingfletdirectly viamicropipin a Pyodide REPL hit the real value and the markers were silently ineffective —oauthlibandhttpxgot pulled in unnecessarily.Test plan
flet build webwith the new template builds successfully and the dart invocation logs show--platform Emscripten.site-packagesdoes not containoauthliborhttpx.micropip.install("flet")inside a Pyodide REPL also skipsoauthlib/httpx.flet build apk/flet build macos/flet build linuxstill build (no code path touched).Summary by Sourcery
Rename the web build platform identifier from Pyodide to Emscripten and align dependency markers and templates with the new platform name.
Bug Fixes:
Enhancements:
Build: