Skip to content

chore: Move Linux build and client dependencies in flet.utils to further simplify CI workflow#6383

Open
ndonkoHenri wants to merge 7 commits intomainfrom
linux-deps-as-util
Open

chore: Move Linux build and client dependencies in flet.utils to further simplify CI workflow#6383
ndonkoHenri wants to merge 7 commits intomainfrom
linux-deps-as-util

Conversation

@ndonkoHenri
Copy link
Copy Markdown
Contributor

@ndonkoHenri ndonkoHenri commented Apr 5, 2026

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:

  • Add workflow job to build and pack the desktop test application for Linux, macOS, and Windows using flet pack with configurable extra arguments.
  • Expose Linux build and client dependency lists from flet.utils for reuse in CI and documentation.

Enhancements:

  • Refactor CI workflows and publish docs examples to read Linux dependencies dynamically from flet.utils instead of hardcoding apt packages.
  • Adjust Git and Flutter version error logging to write to stderr instead of stdout.
  • Tighten workflow path triggers and introduce shared environment variables for repository paths in build workflows.

CI:

  • Split out a dedicated cross-platform pack job in the build workflow, including artifact upload for packed binaries.
  • Parameterize extra arguments for flet build and flet pack via workflow_dispatch inputs.
  • Reuse Python-defined Linux dependency lists in CI workflows to simplify maintenance and keep dependencies consistent.

Documentation:

  • Update publishing documentation to install Linux build dependencies via the new flet.utils helpers instead of an inline apt package list.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 5, 2026

Deploying flet-website-v2 with  Cloudflare Pages  Cloudflare Pages

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

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying flet-examples with  Cloudflare Pages  Cloudflare Pages

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

View logs

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_deps with canonical Linux build/client apt dependency sets, and re-exported them via flet.utils.
  • Updated CI/workflow YAML and publish docs to install Linux deps by querying flet.utils.*_dependencies_apt instead of duplicating package lists.
  • Improved version-related error logging to write to stderr, and extended the build-test workflow with a new pack job.

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 || '' }}
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
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 || '' }}

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +35
"""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."""

Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +67 to +71
"""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."""
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +172 to +177
- name: Patch versions
shell: bash
run: |
source "${SCRIPTS}/update_build_version.sh"
source "${SCRIPTS}/common.sh"
patch_python_package_versions
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
run: |
source "${SCRIPTS}/update_build_version.sh"
source "${SCRIPTS}/common.sh"
patch_python_package_versions
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants