Skip to content

Flet packages and extras - new ways to install Flet tools and dependencies #4227

Description

@FeodorFitsner

Duplicate Check

Describe the requested feature

Current issue

In the latest 0.24.1 version Flet can be installed on user's machine with pip install flet. That command installs everything: flet core library, flet runtime, flet CLI, flet desktop binaries and flet web client. When flet is used in requirements.txt then flet build command does the best to replace it with flet-embed package which is scaled-down version of package without CLI, desktop and web clients. It doesn't work well if flet is not a direct dependency in requirements.txt, e.g. user uses a package that depends on flet somewhere in its hierarchy.

Solution

Flet 0.25 introduces new packages structure which is more suitable for partial installations: #3163

We tried using dependency markers to cut off CLI, web and desktop client packages during flet build but it doesn't work well with Poetry.

We propose to use dependency extras, so users can explicitly install what they want in different development/deployment scenarios. We will be using flet CLI shim to install missing packages in runtime to allow gradual migration to new installation commands.

New Flet installation commands

Installing CLI, desktop and web clients - includes: flet, flet-cli, flet-web and flet-desktop:

pip install flet[all]

Installing web only (for deploying inside Docker container) - includes: flet and flet-web:

pip install flet[web]

Installing desktop (for development and flet pack) - includes: flet, flet-cli and flet-desktop:

pip install flet[desktop]

Installing CLI only (for flet build, flet pack to use in CIs without desktop or web) - includes: flet and flet-cli:

pip install flet[cli]

Installing just flet

Installing "just flet" as of now:

pip install flet

will install flet and flet[.exe] shim that 1) performs redirection to flet_cli.main and 2) installs flet-cli if it's not yet installing.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status
✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions