Move Flet client binaries from PyPI wheels to GitHub releases#6309
Merged
FeodorFitsner merged 2 commits intomainfrom Mar 16, 2026
Merged
Move Flet client binaries from PyPI wheels to GitHub releases#6309FeodorFitsner merged 2 commits intomainfrom
FeodorFitsner merged 2 commits intomainfrom
Conversation
Remove the flet-desktop-light package and all references across scripts, packaging and docs; delete its README and pyproject. Consolidate desktop packaging to a single flet-desktop artifact and simplify CI (remove builds/packaging for the light variant, update artifact uploads, and add a dev_release job). Enhance flet-desktop runtime: add logic to determine Linux distro by glibc, choose desktop flavor via env/pyproject/default, compute artifact filenames, download GitHub release archives, extract into a versioned per-user cache, and ensure a cached client is used when bundled binaries are absent. Update flet-cli utils to prefer bundled binaries then fall back to the cached/downloaded client. Update pip utils to always target flet-desktop. Misc: remove package-data entry from flet-desktop pyproject and update various pyproject files and macros to drop flet-desktop-light where applicable.
Contributor
There was a problem hiding this comment.
Pull request overview
Restores the previous “download desktop client on first run” distribution model by removing bundled Flet desktop client binaries from PyPI wheels, publishing the binaries to GitHub Releases, and unifying flet-desktop / flet-desktop-light into a single flet-desktop package with runtime flavor selection.
Changes:
- Add runtime client selection + download/extract caching logic to
flet_desktop, including glibc-based Linux artifact selection and flavor config via env/pyproject.toml. - Remove
flet-desktop-lightacross the Python workspace (deps, extras, scripts, docs) and simplify installation logic to always useflet-desktop. - Update CI to stop embedding client binaries into wheels, upload client archives as workflow artifacts, and publish them on GitHub Releases (including dev releases from
main).
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/pyproject.toml | Removes flet-desktop-light from workspace dependencies. |
| sdk/python/packages/flet/src/flet/utils/pip.py | Simplifies desktop runtime installation to always install flet-desktop. |
| sdk/python/packages/flet/pyproject.toml | Unifies extras to depend on flet-desktop on all platforms. |
| sdk/python/packages/flet/docs/extras/macros/pypi_index.py | Removes flet-desktop-light from docs package index set. |
| sdk/python/packages/flet-desktop/src/flet_desktop/init.py | Implements flavor selection, Linux distro selection, download + cache extraction, and updated view resolution order. |
| sdk/python/packages/flet-desktop/pyproject.toml | Stops shipping bundled client binaries in the wheel. |
| sdk/python/packages/flet-desktop-light/pyproject.toml | Deletes deprecated flet-desktop-light package metadata. |
| sdk/python/packages/flet-desktop-light/README.md | Deletes deprecated flet-desktop-light documentation. |
| sdk/python/packages/flet-cli/src/flet_cli/__pyinstaller/utils.py | Updates PyInstaller integration to use bundled binaries, cache, or trigger downloads. |
| sdk/python/examples/apps/flet_build_test/pyproject.toml | Removes flet-desktop-light from example app deps. |
| .github/workflows/ci.yml | Stops bundling clients into wheels; publishes client archives to GitHub Releases (tag + dev). |
| .github/scripts/patch_toml_versions.py | Removes flet-desktop-light from version patching list. |
| .github/scripts/common.sh | Removes flet-desktop-light from version patch loop. |
| .github/scripts/clean-pypi.sh | Removes PyPI cleanup step for flet-desktop-light. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Introduce safe_zip_extractall (flet.utils.files) to validate zip member paths and prevent path traversal, and export it via flet.utils.__init__.py. Update flet_desktop to use a temporary extraction directory and atomic rename into the cache, add cleanup on failure (shutil.rmtree), and use safe_zip_extractall for .zip archives. Other changes: increase randomness length for temp download names, return the temp download path (avoid in-place rename), log a warning when glibc detection falls back to a default, and improve handling of FLET_VIEW_PATH by checking for the actual executable and emitting informative warnings if not found.
Deploying flet-docs with
|
| Latest commit: |
7d1ec1b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c3f5a270.flet-docs.pages.dev |
| Branch Preview URL: | https://flet-client-binaries.flet-docs.pages.dev |
Deploying flet-examples with
|
| Latest commit: |
7d1ec1b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e557622e.flet-examples.pages.dev |
| Branch Preview URL: | https://flet-client-binaries.flet-examples.pages.dev |
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.
Close #6290
Flet desktop client binaries (compiled Flutter app) are currently bundled into
flet-desktopandflet-desktop-lightplatform-specific wheels. This makes wheels huge and each release consumes significant PyPI space. Previously (before commit9d21f5b94), binaries were downloaded from GitHub Releases on first run. The goal is to restore that behavior: remove binaries from wheels, publish them to GitHub Releases for both dev and tag builds, and download on first run.Additionally, since binaries are no longer in the wheel, we unify
flet-desktopandflet-desktop-lightinto a singleflet-desktoppackage. The light/full choice becomes a runtime configuration ([tool.flet]in user'spyproject.toml) that determines which binary to download.Decisions
main(tagv0.83.0.dev6045)py3-none-anyflet-desktopwheel (eliminateflet-desktop-light)v{version}— existingversion.pypatching is sufficient[tool.flet]in user'spyproject.tomlwithFLET_DESKTOP_FLAVORenv var override; default islighton Linux,fullon Windows/macOSStep 1: Add download logic to
flet_desktop/__init__.pyFile:
sdk/python/packages/flet-desktop/src/flet_desktop/__init__.py1a. Add imports
Add back
urllib.request,zipfile(removed in9d21f5b94). Addctypesfor glibc detection.1b. Add glibc-based Linux binary selection
__get_linux_distro_id() -> str:FLET_LINUX_DISTROenv var override firstctypes(ctypes.CDLL("libc.so.6")->gnu_get_libc_version())1c. Add desktop flavor detection
__get_desktop_flavor() -> str(returns"full"or"light"):FLET_DESKTOP_FLAVORenv var (explicit override)pyproject.tomlfromos.getcwd()->[tool.flet].desktop_flavor"light"on Linux,"full"on Windows/macOSUse stdlib
tomllib(Python 3.11+) withtomlifallback for 3.10 compatibility. Wrap in try/except — missing file or parse errors silently fall back to default.1d. Add artifact filename helper
__get_artifact_filename() -> str:"flet-windows.zip""flet-macos.tar.gz""flet-linux-{distro_id}-{arch}.tar.gz""flet-linux-{distro_id}-light-{arch}.tar.gz"Uses
__get_linux_distro_id()+get_arch()+__get_desktop_flavor().1e. Revive
__download_flet_client(file_name) -> str1f. Restructure
__locate_and_unpack_flet_view()resolution orderNew order per platform:
build/{platform}/dir (localflet buildoutput) — unchangedFLET_VIEW_PATHenv var — moved up__get_client_storage_dir()— reuse if already extractedget_package_bin_dir()— for PyInstaller bundlesWindows: Download
flet-windows.zip, extract withzipfile.macOS: Download
flet-macos.tar.gz, extract withtarfile.Linux: Download
flet-linux-{distro}[-light]-{arch}.tar.gz, extract withtarfile.1g. Update
__get_client_storage_dir()Replace
__get_desktop_distribution_name()(no longer needed) with flavor-aware cache path:~/.flet/client/flet-desktop-{flavor}-{version}/Step 2: Eliminate
flet-desktop-lightpackage2a. Delete
sdk/python/packages/flet-desktop-light/entirely2b. Update
flet-desktop/pyproject.tomlFile:
sdk/python/packages/flet-desktop/pyproject.toml[tool.setuptools.package-data]section2c. Update
flet/utils/pip.pyFile:
sdk/python/packages/flet/src/flet/utils/pip.pyensure_flet_desktop_package_installed(): Removeflet-desktop-lightbranch. Always installflet-desktop:Step 3: Update CI workflow
File:
.github/workflows/ci.yml3a. Stop bundling binaries into wheels
build_windowsjob:flet-windows.zipcreationflet/dir intoflet_desktop/app/, building flet-desktop wheel, wheel retaggingclient/flet-windows.zipbuild_macosjob:flet-macos.tar.gzcreationflet_desktop/app/, building flet-desktop wheel, wheel retaggingclient/flet-macos.tar.gzbuild_linuxjob:flet-linux-*.tar.gzcreation (both full and light variants)client/flet-linux*.tar.gz3b. Move wheel builds to
build_flet_cli_desktopChange from building only
--sdistto full build:uv build --package flet-cli uv build --package flet uv build --package flet-desktop # wheel + sdist, now universal py3-none-anyRemove all
flet-desktop-lightreferences.3c. Add dev release job
3d. Update
py_publishdependenciesRemove dependencies on
build_windows,build_macos,build_linux. Removeflet_desktop_lightfrom publish list.3e. Remove
flet-desktop-lightfrom CI entirelycommon.sh: Remove frompatch_python_package_versions()loopci.ymlpy_publish: Removeflet_desktop_lightfrom package listci.ymlbuild_linux: Keep building both full and light Flutter clients (they produce different archives), but removeflet-desktop-lightwheel buildingStep 4: Update PyInstaller hook
File:
sdk/python/packages/flet-cli/src/flet_cli/__pyinstaller/utils.pyUpdate
get_flet_bin_path():get_package_bin_dir()— if has content, return itStep 5: Environment variables
FLET_DESKTOP_FLAVOR—"full"or"light"(default:"light"on Linux,"full"elsewhere)FLET_LINUX_DISTRO— override glibc-based distro detection (e.g.,debian12)FLET_CLIENT_URL— override full download URL (mirrors/air-gapped)Summary by Sourcery
Move Flet desktop client distribution from wheel-bundled binaries to on-demand downloads from GitHub Releases, while unifying desktop packages and updating tooling to support the new flow.
New Features:
Enhancements:
Build:
Summary by Sourcery
Move Flet desktop runtime distribution from wheel-bundled binaries to on-demand downloads from GitHub Releases, while unifying desktop packaging and updating tooling to support the new flow.
New Features:
Enhancements:
Build:
CI:
Documentation:
Chores: