flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
11.5k stars 449 forks source link

Poetry support for monorepo style projects? #3731

Open baseplate-admin opened 3 months ago

baseplate-admin commented 3 months ago

Duplicate Check

Describe the requested feature

Hi, it seems flet cannot build for monorepo style projects.

Here is a tree of the project folder

├───assets
│   ├───fonts
│   │   └───Kokoro
│   └───icons
├───src
│   ├───seeder_flet
│   │   ├───lib
│   │   │   ├───components
│   │   │   │   └───__pycache__
│   │   │   └───views
│   │   │       └───__pycache__
│   │   └───__pycache__
│   └───shinobi
│       ├───src
│       │   ├───builder
│       │   ├───decorators
│       │   ├───parser
│       │   └───utilities
│       └───test
│           ├───builder
│           └───parser
└───tests

and following pyproject.toml file

[tool.poetry]
name = "seeder-flet"
version = "0.1.0"
description = ""
authors = [ "baseplate-admin <61817579+baseplate-admin@users.noreply.github.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.12"
flet = ">=0.22.1"
shinobi = {path='./src/shinobi', develop = true}

[tool.poetry.group.dev.dependencies]
poethepoet = "^0.27.0"

[tool.poe.tasks]
dev = "flet run -d -r"

when i build with flet, it outputs the following

(seeder-flet-py3.12) PS C:\Programming\coreproject\seeder> poetry run flet build windows  -v
[11:43:40] Flutter bootstrap directory: C:\Users\baseplate-admin\AppData\Local\Temp\flet_flutter_build_uh5yJLSQBf
           Additional Flutter dependencies:
           {}
[11:43:43] Created Flutter bootstrap project from gh:flet-dev/flet-build-template with ref 0.23.2 ✅
           Customized app icons and splash images ✅
           Run subprocess: ['C:\\tools\\flutter\\bin\\dart.BAT', 'run', 'flutter_launcher_icons']
(  ●   ) Generating app icons (1.4s)
Downloading packages... 
(●     ) Generating app icons ⏳... Got dependencies in `C:\Users\baseplate-admin\AppData\Local\Temp\flet_flutter_build_uh5yJLSQBf`.
(  ●   ) Generating app icons ⏳... 
Built flutter_launcher_icons:flutter_launcher_icons.
( ●    ) Generating app icons ⏳...   ════════════════════════════════════════════
     FLUTTER LAUNCHER ICONS (v0.13.1)
  ════════════════════════════════════════════

• Creating default icons Android
(●     ) Generating app icons ⏳... • Overwriting the default Android launcher icon with a new icon
(  ●   ) Generating app icons ⏳... • Overwriting default iOS launcher icon with new icon
(    ● ) Generating app icons ⏳... Creating Icons for Web...
(  ●   ) Generating app icons ⏳... Creating Icons for Windows...
( ●    ) Generating app icons ⏳... Creating Icons for MacOS...
(   ●  ) Generating app icons ⏳... 
✓ Successfully generated launcher icons
[11:43:46] Generated app icons ✅
           Run subprocess: ['C:\\tools\\flutter\\bin\\dart.BAT', 'run', 'serious_python:main', 'package', 'C:\\Programming\\coreproject\\seeder', '--dep-mappings', 'flet=flet-embed',  
           '--req-deps', 'flet-embed', '--exclude', 'build']
(●     ) Packaging Python app ⏳... 
Built serious_python:main.
( ●    ) Packaging Python app ⏳... Running package command
Creating asset directory: C:\Users\baseplate-admin\AppData\Local\Temp\flet_flutter_build_uh5yJLSQBf\app
Copying Python app from C:\Programming\coreproject\seeder to C:\Users\baseplate-admin\AppData\Local\Temp\serious_python_tempfe47c924
(  ●   ) Packaging Python app ⏳... Error: type 'Null' is not a subtype of type 'String'
Deleting temp directory C:\Users\baseplate-admin\AppData\Local\Temp\serious_python_tempfe47c924
[11:43:47] Deleting Flutter bootstrap directory C:\Users\baseplate-admin\AppData\Local\Temp\flet_flutter_build_uh5yJLSQBf
           Flet app package app/app.zip was not created.

Suggest a solution

Flet should look for packages in the pyproject.toml file recursively.

Screenshots

No response

Additional details

If you want a github repository: https://github.com/coreproject-moe/CoreProject/tree/a8d9ef8fe716dc4f2abb2a412f8e035dcd12ae31/seeder

cc: @moonlitgrace

baseplate-admin commented 3 months ago
 Error: type 'Null' is not a subtype of type 'String'

this is the error line

baseplate-admin commented 3 months ago

hi @FeodorFitsner, should this be in serious-python ?

ndonkoHenri commented 3 months ago

Can you use --v flag?

baseplate-admin commented 3 months ago

Can you use --v flag?

Sure

(seeder-flet-py3.12) PS C:\Programming\coreproject\seeder> poetry run flet build windows  -v                    
[14:41:37] Flutter bootstrap directory: C:\Users\baseplate-admin\AppData\Local\Temp\flet_flutter_build_W8M9cIeAtz
           Additional Flutter dependencies:
           {}
[14:41:44] Created Flutter bootstrap project from gh:flet-dev/flet-build-template with ref 0.23.2 ✅
           Customized app icons and splash images ✅
           Run subprocess: ['C:\\tools\\flutter\\bin\\dart.BAT', 'run', 'flutter_launcher_icons']
(    ● ) Generating app icons (2.5s)
(   ●  ) Generating app icons ⏳... 
(    ● ) Generating app icons ⏳... Got dependencies in `C:\Users\baseplate-admin\AppData\Local\Temp\flet_flutter_build_W8M9cIeAtz`.
(     ●) Generating app icons (3.3s)
Built flutter_launcher_icons:flutter_launcher_icons.
(    ● ) Generating app icons ⏳...   ════════════════════════════════════════════
     FLUTTER LAUNCHER ICONS (v0.13.1)
  ════════════════════════════════════════════

• Creating default icons Android
(   ●  ) Generating app icons ⏳... • Overwriting the default Android launcher icon with a new icon
( ●    ) Generating app icons ⏳... • Overwriting default iOS launcher icon with new icon
(   ●  ) Generating app icons ⏳... Creating Icons for Web...
(     ●) Generating app icons ⏳... Creating Icons for Windows...
Creating Icons for MacOS...
(●     ) Generating app icons ⏳... 
✓ Successfully generated launcher icons
[14:41:52] Generated app icons ✅
           Run subprocess: ['C:\\tools\\flutter\\bin\\dart.BAT', 'run', 'serious_python:main', 'package', 'C:\\Programming\\coreproject\\seeder', '--dep-mappings', 'flet=flet-embed',   
           '--req-deps', 'flet-embed', '--exclude', 'build']
(  ●   ) Packaging Python app ⏳... 
Built serious_python:main.
Running package command
(   ●  ) Packaging Python app ⏳... Creating asset directory: C:\Users\baseplate-admin\AppData\Local\Temp\flet_flutter_build_W8M9cIeAtz\app
Copying Python app from C:\Programming\coreproject\seeder to C:\Users\baseplate-admin\AppData\Local\Temp\serious_python_temp41c572b0
(    ● ) Packaging Python app ⏳... Error: type 'Null' is not a subtype of type 'String'
Deleting temp directory C:\Users\baseplate-admin\AppData\Local\Temp\serious_python_temp41c572b0
[14:41:53] Deleting Flutter bootstrap directory C:\Users\baseplate-admin\AppData\Local\Temp\flet_flutter_build_W8M9cIeAtz
           Flet app package app/app.zip was not created.
ndonkoHenri commented 3 months ago

--v, instead of -v

baseplate-admin commented 3 months ago
(seeder-flet-py3.12) PS C:\Programming\coreproject\seeder> poetry run flet build windows  --v
[14:43:12] Flutter bootstrap directory: C:\Users\baseplate-admin\AppData\Local\Temp\flet_flutter_build_5GTut7q0HK
           Additional Flutter dependencies:
           {}
[14:43:21] Created Flutter bootstrap project from gh:flet-dev/flet-build-template with ref 0.23.2 ✅
           Customized app icons and splash images ✅
           Run subprocess: ['C:\\tools\\flutter\\bin\\dart.BAT', 'run', 'flutter_launcher_icons']
(  ●   ) Generating app icons (2.9s)
( ●    ) Generating app icons ⏳... 
Got dependencies in `C:\Users\baseplate-admin\AppData\Local\Temp\flet_flutter_build_5GTut7q0HK`.
(  ●   ) Generating app icons ⏳... 
Built flutter_launcher_icons:flutter_launcher_icons.
  ════════════════════════════════════════════
     FLUTTER LAUNCHER ICONS (v0.13.1)
  ════════════════════════════════════════════

( ●    ) Generating app icons ⏳... • Creating default icons Android
• Overwriting the default Android launcher icon with a new icon
(  ●   ) Generating app icons ⏳... • Overwriting default iOS launcher icon with new icon
(     ●) Generating app icons ⏳... Creating Icons for Web...
(   ●  ) Generating app icons ⏳... Creating Icons for Windows...
( ●    ) Generating app icons ⏳... Creating Icons for MacOS...
(  ●   ) Generating app icons ⏳... 
✓ Successfully generated launcher icons
[14:43:26] Generated app icons ✅
           Run subprocess: ['C:\\tools\\flutter\\bin\\dart.BAT', 'run', 'serious_python:main', 'package', 'C:\\Programming\\coreproject\\seeder', '--dep-mappings', 'flet=flet-embed',   
           '--req-deps', 'flet-embed', '--exclude', 'build']
( ●    ) Packaging Python app ⏳... 
Built serious_python:main.
(●     ) Packaging Python app ⏳... Running package command
Creating asset directory: C:\Users\baseplate-admin\AppData\Local\Temp\flet_flutter_build_5GTut7q0HK\app
Copying Python app from C:\Programming\coreproject\seeder to C:\Users\baseplate-admin\AppData\Local\Temp\serious_python_temp80c62787
(  ●   ) Packaging Python app ⏳... Error: type 'Null' is not a subtype of type 'String'
Deleting temp directory C:\Users\baseplate-admin\AppData\Local\Temp\serious_python_temp80c62787
[14:43:27] Deleting Flutter bootstrap directory C:\Users\baseplate-admin\AppData\Local\Temp\flet_flutter_build_5GTut7q0HK
           Flet app package app/app.zip was not created.