chore: Move Linux build and client dependencies in flet.utils to further simplify CI workflow#6357
chore: Move Linux build and client dependencies in flet.utils to further simplify CI workflow#6357ndonkoHenri wants to merge 6 commits intorelease/v0.84.0from
flet.utils to further simplify CI workflow#6357Conversation
Deploying flet-docs with
|
| Latest commit: |
0d0e6fd
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7a922701.flet-docs.pages.dev |
| Branch Preview URL: | https://linux-deps-as-util.flet-docs.pages.dev |
There was a problem hiding this comment.
Pull request overview
This PR centralizes the Linux apt dependency lists used by Flet CI/workflows into flet.utils, and updates CI/docs to consume those canonical lists (reducing duplication and simplifying future updates).
Changes:
- Add
flet.utils.linux_depswith canonical Linux build/clientaptpackage sets (tuple + space-joined string variants). - Update GitHub workflows and publish docs to install Linux packages by reading
flet.utils.*_dependencies_aptat runtime. - Route version-detection parsing/error output in
flet/version.pytostderr.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/packages/flet/src/flet/version.py | Send Git/.fvmrc parsing errors to stderr. |
| sdk/python/packages/flet/src/flet/utils/linux_deps.py | New canonical Linux apt dependency definitions for build/client. |
| sdk/python/packages/flet/src/flet/utils/init.py | Re-export Linux dependency constants via flet.utils. |
| sdk/python/packages/flet/docs/publish/index.md | Use flet.utils.linux_build_dependencies_apt in the documented workflow template. |
| .github/workflows/flet-build-test.yml | Install Linux deps via flet.utils.linux_build_dependencies_apt. |
| .github/workflows/ci.yml | Install Linux client deps via flet.utils.linux_client_dependencies_apt. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| """Linux apt packages used to build Flet Linux client binaries in CI.""" | ||
|
|
||
|
|
||
| linux_client_dependencies_apt: Final[str] = " ".join(linux_client_dependencies) | ||
| """`linux_client_dependencies` as a shell-ready, space-separated string.""" |
There was a problem hiding this comment.
Same issue as above: this standalone triple-quoted string after the assignment is a no-op expression and is likely to trigger Ruff flake8-bugbear B018. Use a #/#: comment instead, or move this text into the module docstring.
| """Canonical Linux apt dependency sets used by Flet workflows.""" | ||
|
|
||
| from typing import Final | ||
|
|
||
| linux_build_dependencies: Final[tuple[str, ...]] = ( | ||
| "clang", | ||
| "ninja-build", | ||
| "libgtk-3-dev", | ||
| "libasound2-dev", | ||
| "libmpv-dev", | ||
| "mpv", | ||
| "libgstreamer1.0-dev", | ||
| "libgstreamer-plugins-base1.0-dev", | ||
| "libgstreamer-plugins-bad1.0-dev", | ||
| "gstreamer1.0-plugins-base", | ||
| "gstreamer1.0-plugins-good", | ||
| "gstreamer1.0-plugins-bad", | ||
| "gstreamer1.0-plugins-ugly", | ||
| "gstreamer1.0-libav", | ||
| "gstreamer1.0-tools", | ||
| "gstreamer1.0-x", | ||
| "gstreamer1.0-alsa", | ||
| "gstreamer1.0-gl", | ||
| "gstreamer1.0-gtk3", | ||
| "gstreamer1.0-qt5", | ||
| "gstreamer1.0-pulseaudio", | ||
| "pkg-config", | ||
| "libsecret-1-0", | ||
| "libsecret-1-dev", | ||
| ) | ||
| """Linux apt packages required to build a Flet Linux app.""" | ||
|
|
||
| linux_build_dependencies_apt: Final[str] = " ".join(linux_build_dependencies) | ||
| """`linux_build_dependencies` as a shell-ready, space-separated string.""" | ||
|
|
||
| linux_client_dependencies: Final[tuple[str, ...]] = ( | ||
| "lld", | ||
| "llvm", | ||
| "binutils", | ||
| "clang", | ||
| "cmake", | ||
| "ninja-build", | ||
| "pkg-config", | ||
| "libgtk-3-dev", | ||
| "libasound2-dev", | ||
| "libunwind-dev", | ||
| "libsecret-1-0", | ||
| "libsecret-1-dev", | ||
| "libmpv-dev", | ||
| "mpv", | ||
| "libgstreamer1.0-dev", | ||
| "libgstreamer-plugins-base1.0-dev", | ||
| "libgstreamer-plugins-bad1.0-dev", | ||
| "gstreamer1.0-plugins-base", | ||
| "gstreamer1.0-plugins-good", | ||
| "gstreamer1.0-plugins-bad", | ||
| "gstreamer1.0-plugins-ugly", | ||
| "gstreamer1.0-libav", | ||
| "gstreamer1.0-tools", | ||
| "gstreamer1.0-x", | ||
| "gstreamer1.0-alsa", | ||
| "gstreamer1.0-gl", | ||
| "gstreamer1.0-gtk3", | ||
| "gstreamer1.0-qt5", | ||
| "gstreamer1.0-pulseaudio", | ||
| ) | ||
| """Linux apt packages used to build Flet Linux client binaries in CI.""" | ||
|
|
||
|
|
||
| linux_client_dependencies_apt: Final[str] = " ".join(linux_client_dependencies) | ||
| """`linux_client_dependencies` as a shell-ready, space-separated string.""" |
There was a problem hiding this comment.
The triple-quoted strings after these assignments are standalone string expressions (variable “docstrings”). With the repo’s Ruff config selecting flake8-bugbear rules (B018), these are likely to be flagged as “useless expression” and fail lint. Prefer #/#: comments on the assignment line, or convert to module-level documentation instead of standalone string literals.
| """Canonical Linux apt dependency sets used by Flet workflows.""" | |
| from typing import Final | |
| linux_build_dependencies: Final[tuple[str, ...]] = ( | |
| "clang", | |
| "ninja-build", | |
| "libgtk-3-dev", | |
| "libasound2-dev", | |
| "libmpv-dev", | |
| "mpv", | |
| "libgstreamer1.0-dev", | |
| "libgstreamer-plugins-base1.0-dev", | |
| "libgstreamer-plugins-bad1.0-dev", | |
| "gstreamer1.0-plugins-base", | |
| "gstreamer1.0-plugins-good", | |
| "gstreamer1.0-plugins-bad", | |
| "gstreamer1.0-plugins-ugly", | |
| "gstreamer1.0-libav", | |
| "gstreamer1.0-tools", | |
| "gstreamer1.0-x", | |
| "gstreamer1.0-alsa", | |
| "gstreamer1.0-gl", | |
| "gstreamer1.0-gtk3", | |
| "gstreamer1.0-qt5", | |
| "gstreamer1.0-pulseaudio", | |
| "pkg-config", | |
| "libsecret-1-0", | |
| "libsecret-1-dev", | |
| ) | |
| """Linux apt packages required to build a Flet Linux app.""" | |
| linux_build_dependencies_apt: Final[str] = " ".join(linux_build_dependencies) | |
| """`linux_build_dependencies` as a shell-ready, space-separated string.""" | |
| linux_client_dependencies: Final[tuple[str, ...]] = ( | |
| "lld", | |
| "llvm", | |
| "binutils", | |
| "clang", | |
| "cmake", | |
| "ninja-build", | |
| "pkg-config", | |
| "libgtk-3-dev", | |
| "libasound2-dev", | |
| "libunwind-dev", | |
| "libsecret-1-0", | |
| "libsecret-1-dev", | |
| "libmpv-dev", | |
| "mpv", | |
| "libgstreamer1.0-dev", | |
| "libgstreamer-plugins-base1.0-dev", | |
| "libgstreamer-plugins-bad1.0-dev", | |
| "gstreamer1.0-plugins-base", | |
| "gstreamer1.0-plugins-good", | |
| "gstreamer1.0-plugins-bad", | |
| "gstreamer1.0-plugins-ugly", | |
| "gstreamer1.0-libav", | |
| "gstreamer1.0-tools", | |
| "gstreamer1.0-x", | |
| "gstreamer1.0-alsa", | |
| "gstreamer1.0-gl", | |
| "gstreamer1.0-gtk3", | |
| "gstreamer1.0-qt5", | |
| "gstreamer1.0-pulseaudio", | |
| ) | |
| """Linux apt packages used to build Flet Linux client binaries in CI.""" | |
| linux_client_dependencies_apt: Final[str] = " ".join(linux_client_dependencies) | |
| """`linux_client_dependencies` as a shell-ready, space-separated string.""" | |
| """Canonical Linux apt dependency sets used by Flet workflows.""" | |
| from typing import Final | |
| # Linux apt packages required to build a Flet Linux app. | |
| linux_build_dependencies: Final[tuple[str, ...]] = ( | |
| "clang", | |
| "ninja-build", | |
| "libgtk-3-dev", | |
| "libasound2-dev", | |
| "libmpv-dev", | |
| "mpv", | |
| "libgstreamer1.0-dev", | |
| "libgstreamer-plugins-base1.0-dev", | |
| "libgstreamer-plugins-bad1.0-dev", | |
| "gstreamer1.0-plugins-base", | |
| "gstreamer1.0-plugins-good", | |
| "gstreamer1.0-plugins-bad", | |
| "gstreamer1.0-plugins-ugly", | |
| "gstreamer1.0-libav", | |
| "gstreamer1.0-tools", | |
| "gstreamer1.0-x", | |
| "gstreamer1.0-alsa", | |
| "gstreamer1.0-gl", | |
| "gstreamer1.0-gtk3", | |
| "gstreamer1.0-qt5", | |
| "gstreamer1.0-pulseaudio", | |
| "pkg-config", | |
| "libsecret-1-0", | |
| "libsecret-1-dev", | |
| ) | |
| # `linux_build_dependencies` as a shell-ready, space-separated string. | |
| linux_build_dependencies_apt: Final[str] = " ".join(linux_build_dependencies) | |
| # Linux apt packages used to build Flet Linux client binaries in CI. | |
| linux_client_dependencies: Final[tuple[str, ...]] = ( | |
| "lld", | |
| "llvm", | |
| "binutils", | |
| "clang", | |
| "cmake", | |
| "ninja-build", | |
| "pkg-config", | |
| "libgtk-3-dev", | |
| "libasound2-dev", | |
| "libunwind-dev", | |
| "libsecret-1-0", | |
| "libsecret-1-dev", | |
| "libmpv-dev", | |
| "mpv", | |
| "libgstreamer1.0-dev", | |
| "libgstreamer-plugins-base1.0-dev", | |
| "libgstreamer-plugins-bad1.0-dev", | |
| "gstreamer1.0-plugins-base", | |
| "gstreamer1.0-plugins-good", | |
| "gstreamer1.0-plugins-bad", | |
| "gstreamer1.0-plugins-ugly", | |
| "gstreamer1.0-libav", | |
| "gstreamer1.0-tools", | |
| "gstreamer1.0-x", | |
| "gstreamer1.0-alsa", | |
| "gstreamer1.0-gl", | |
| "gstreamer1.0-gtk3", | |
| "gstreamer1.0-qt5", | |
| "gstreamer1.0-pulseaudio", | |
| ) | |
| # `linux_client_dependencies` as a shell-ready, space-separated string. | |
| linux_client_dependencies_apt: Final[str] = " ".join(linux_client_dependencies) |
Deploying flet-examples with
|
| Latest commit: |
0d0e6fd
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://eda0635d.flet-examples.pages.dev |
| Branch Preview URL: | https://linux-deps-as-util.flet-examples.pages.dev |
Summary by Sourcery
Centralize Linux dependency definitions in flet.utils and reuse them across CI and docs to simplify and standardize Linux builds and clients.
Enhancements:
Build:
Documentation: