chore: Move Linux build and client dependencies in flet.utils to further simplify CI workflow#6383
chore: Move Linux build and client dependencies in flet.utils to further simplify CI workflow#6383ndonkoHenri wants to merge 7 commits intomainfrom
flet.utils to further simplify CI workflow#6383Conversation
Deploying flet-website-v2 with
|
| Latest commit: |
d6235fe
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0b51cf17.flet-website-v2.pages.dev |
| Branch Preview URL: | https://linux-deps-as-util.flet-website-v2.pages.dev |
Deploying flet-examples with
|
| Latest commit: |
d6235fe
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2a871b1e.flet-examples.pages.dev |
| Branch Preview URL: | https://linux-deps-as-util.flet-examples.pages.dev |
There was a problem hiding this comment.
Pull request overview
Centralizes Linux apt dependency lists into the Python flet.utils package and updates CI/docs workflows to consume those canonical lists, reducing duplication and simplifying future maintenance of dependency sets.
Changes:
- Added
flet.utils.linux_depswith canonical Linux build/client apt dependency sets, and re-exported them viaflet.utils. - Updated CI/workflow YAML and publish docs to install Linux deps by querying
flet.utils.*_dependencies_aptinstead of duplicating package lists. - Improved version-related error logging to write to
stderr, and extended the build-test workflow with a newpackjob.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
sdk/python/packages/flet/src/flet/version.py |
Routes version discovery/parsing errors to stderr. |
sdk/python/packages/flet/src/flet/utils/linux_deps.py |
Introduces canonical Linux apt dependency tuples + space-joined strings for workflows. |
sdk/python/packages/flet/src/flet/utils/__init__.py |
Re-exports Linux dependency constants via flet.utils. |
sdk/python/packages/flet/docs/publish/index.md |
Updates workflow example to consume flet.utils.linux_build_dependencies_apt. |
.github/workflows/flet-build-test.yml |
Uses canonical Linux deps, adds version patching, fixes path filters, and adds a new pack job. |
.github/workflows/ci.yml |
Uses canonical Linux client deps for Flutter Linux client build step. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -39,6 +47,7 @@ env: | |||
|
|
|||
| # Extra args passed via workflow_dispatch (empty for push/PR) | |||
| FLET_BUILD_EXTRA_ARGS: ${{ github.event_name == 'workflow_dispatch' && inputs.extra_args || '' }} | |||
There was a problem hiding this comment.
In workflow_dispatch inputs the build args input was renamed to extra_build_args, but FLET_BUILD_EXTRA_ARGS is still populated from inputs.extra_args (which no longer exists). This makes the build-extra-args feature ineffective (and can break expression evaluation depending on GitHub Actions behavior). Update the expression to reference inputs.extra_build_args (or keep the old input name consistently).
| FLET_BUILD_EXTRA_ARGS: ${{ github.event_name == 'workflow_dispatch' && inputs.extra_args || '' }} | |
| FLET_BUILD_EXTRA_ARGS: ${{ github.event_name == 'workflow_dispatch' && inputs.extra_build_args || '' }} |
| """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.""" | ||
|
|
There was a problem hiding this comment.
The triple-quoted strings immediately following these constant assignments are standalone string expressions (not true “variable docstrings”), so Ruff/flake8-bugbear will flag them (B018) and they won’t reliably show up in generated docs. Use # comments instead, or switch to a documentation mechanism that’s actually supported for module-level constants.
| """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 here: the triple-quoted string after the assignment is a standalone expression (will trigger Ruff B018) rather than a real docstring for linux_client_dependencies / linux_client_dependencies_apt. Prefer # comments (or another supported constant-doc mechanism) to document these constants.
| - name: Patch versions | ||
| shell: bash | ||
| run: | | ||
| source "${SCRIPTS}/update_build_version.sh" | ||
| source "${SCRIPTS}/common.sh" | ||
| patch_python_package_versions |
There was a problem hiding this comment.
This step runs patch_python_package_versions on macOS runners too. The implementation in .github/scripts/common.sh uses sed -i -e ..., which on macOS/BSD sed treats -e as the backup suffix for -i and leaves extra *-e backup files in the workspace. Consider making the patch script’s sed -i usage portable (or gating this step to Linux) to avoid polluting the tree and potentially affecting build outputs.
| run: | | ||
| source "${SCRIPTS}/update_build_version.sh" | ||
| source "${SCRIPTS}/common.sh" | ||
| patch_python_package_versions |
There was a problem hiding this comment.
Same concern here: patch_python_package_versions relies on sed -i -e ... in .github/scripts/common.sh, which on macOS/BSD sed will create *-e backup files. Since this job runs on macos-latest, consider making the patch script’s in-place edits portable (or cleaning up the backups) so packaging isn’t affected by stray files.
| patch_python_package_versions | |
| patch_python_package_versions | |
| find "${SDK_PYTHON}/packages" -type f -name '*-e' -delete | |
| find "${ROOT}/packages/flet" -type f -name '*-e' -delete |
Reopening due to accidental close of #6357
Summary by Sourcery
Centralize Linux build and client dependency definitions in the Python SDK and extend CI to build and pack a desktop test app across platforms.
New Features:
flet packwith configurable extra arguments.flet.utilsfor reuse in CI and documentation.Enhancements:
flet.utilsinstead of hardcoding apt packages.CI:
flet buildandflet packvia workflow_dispatch inputs.Documentation:
flet.utilshelpers instead of an inline apt package list.