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:
Installing web only (for deploying inside Docker container) - includes: flet and 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:
Installing just flet
Installing "just flet" as of now:
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.
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. Whenfletis used inrequirements.txtthenflet buildcommand does the best to replace it withflet-embedpackage which is scaled-down version of package without CLI, desktop and web clients. It doesn't work well iffletis not a direct dependency inrequirements.txt, e.g. user uses a package that depends onfletsomewhere 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 buildbut 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
fletCLI 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-webandflet-desktop:Installing web only (for deploying inside Docker container) - includes:
fletandflet-web:Installing desktop (for development and
flet pack) - includes:flet,flet-cliandflet-desktop:Installing CLI only (for
flet build,flet packto use in CIs without desktop or web) - includes:fletandflet-cli:Installing just
fletInstalling "just flet" as of now:
will install
fletand flet[.exe] shim that 1) performs redirection toflet_cli.mainand 2) installsflet-cliif it's not yet installing.