Skip to content

fix(flet build): honor empty platform values for remaining build settings - #7040

Open
AbhayPhalswal wants to merge 3 commits into
flet-dev:flet-1.1.0from
AbhayPhalswal:fix/6949-platform-overrides
Open

AbhayPhalswal wants to merge 3 commits into
flet-dev:flet-1.1.0from
AbhayPhalswal:fix/6949-platform-overrides

Conversation

@AbhayPhalswal

@AbhayPhalswal AbhayPhalswal commented Nov 2, 2026 •

Copy link
Copy Markdown

Follow-up to #6981 for the rest of #6949.

flet build resolved these [tool.flet.<platform>] settings as platform_value or global_value, so an explicit empty platform value was skipped and the global value won:

  • artifact
  • org
  • bundle_id
  • icon_background (icon_background_value())
  • splash.* via splash_setting(): color, dark_color, icon_background, icon_dark_background, icon_fit

They now resolve through get_platform_setting(), which already has the "present wins" (is not None) semantics the issue proposes, so the precedence rule lives in one place. An empty platform value clears the global value for that platform, and the caller's existing default applies: com.flet, <org>.<project>, the default artifact name, a white icon background, the default splash colours and contain. None of these settings can end up as an empty string.

get_platform_setting() gets an optional platform argument, so icon_background_value("android") keeps working while another platform is being built.

Tests

New cases in test_build_platform_settings.py cover:

  • the explicit platform argument
  • an empty platform value for each splash key
  • the resolved splash colour and icon background falling back to their defaults

The artifact, org and bundle_id call sites in setup_template_data() now use get_platform_setting(), which test_empty_platform_value_clears_global already covers. There's no existing test harness for setup_template_data(), so I didn't add one. I'm happy to if you'd like.

Locally on Windows, uv run --group test pytest packages/flet-cli/tests gives 855 passed, 12 skipped and 2 failed. Both failures (test_unreadable_source_warns_without_failing and test_warns_when_listed_file_is_missing) fail the same way on the base commit, so they're Windows-specific and unrelated to this change. ruff format --check and ruff check pass on the changed files.

Not included: documenting the precedence rules on the publish docs page, which the issue also suggests.

🤖 Generated with Claude Code

Summary by Sourcery

Honor explicit empty platform values across remaining build settings so they override global configuration consistently and fall back to platform defaults when appropriate.

Bug Fixes:

  • Honor explicit empty platform-specific build settings so they clear corresponding global values while allowing the appropriate defaults to apply.
  • Apply consistent platform-over-global precedence to artifact, organization, bundle ID, icon background, and splash settings.

Enhancements:

  • Allow platform setting lookups to target an explicitly specified platform independently of the platform being built.
  • Document that platform-specific false and empty-string values override global settings.

Documentation:

  • Document platform-specific precedence for false and empty-string values in publishing configuration.

Tests:

  • Add coverage for explicit platform lookups, empty splash and icon background values, default fallbacks, and identity settings passed to build templates.

`artifact`, `org`, `bundle_id`, `icon_background` and the `splash`
settings resolved `[tool.flet.<platform>]` over `[tool.flet]` with `or`,
so an explicit empty platform value was skipped and the global value
won. They now go through `get_platform_setting()`, which already treats
any set value as an override, so an empty platform value clears the
global one and the caller's default applies.

`get_platform_setting()` gains an optional `platform` argument so
`icon_background_value()` can resolve Android's adaptive-icon colour
while another platform is being built.

Covers the keys from flet-dev#6949 that flet-dev#6981 did not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CLAassistant

CLAassistant commented Nov 2, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@ndonkoHenri ndonkoHenri changed the title fix: honor empty platform values for remaining build settings fix(flet build): honor empty platform values for remaining build settings Nov 2, 2026

This branch has not been deployed

No deployments
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.

flet build: false/empty per-platform pyproject values don't override global ones (hide_window_on_start, org, splash.*, …)

3 participants