flet icon indicating copy to clipboard operation
flet copied to clipboard

Comments not ignored in requirements.txt during flet build

Open Richy-Z opened this issue 7 months ago • 0 comments

Duplicate Check

  • [X] I have searched the opened issues and there are no duplicates

Describe the bug

When running flet build, comments which start with # (as expected by pip) are not ignored like they are supposed to, and raise an error during building. This completely halts the build process and is quite problematic if you would like to have some additional information about dependencies in requirements.txt.

Code

requests
flet
# pathlib is only required during development for the development tab, specifically the self destruct command
pathlib

To reproduce

Simply add a comment to your requirements.txt file in the project. for example:

flet
# hello, I'm a comment!

Expected behavior

The line containing the comment in the file should simply be disregarded and build errors should not occur.

Screenshots

ERROR: Invalid requirement: '# pathlib is only required during development for the development tab, specifically the self destruct command'

[notice] A new release of pip is available: 23.2.1 -> 24.1.1
[notice] To update, run: /var/folders/rq/y07fbj017b99m87tbr3ry95h0000gn/T/hostpython3.11_Tft70e/python/bin/python3 -m pip install --upgrade pip
[00:02:00] Deleting Flutter bootstrap directory /var/folders/rq/y07fbj017b99m87tbr3ry95h0000gn/T/flet_flutter_build_brjFMJo41z                                                                                                                                                                              
           Error building Flet app - see the log of failed command above.                                                                                                                                                                                                                                   
❌ ERROR: IPA build failed with status code 1.

Operating System

macOS

Operating system details

macOS Sonoma 14.5

Flet version

0.23.2

Regression

No, it isn't

Suggestions

Since it doesnt look like requirements arent installed with pip install -r requirements.txt during building, I assume that there is just a for loop iterating through each line of requirements.txt. Implement a simple if statement to check for a hashtag:

if "#" in line:
    return

Additional details

No response

Richy-Z avatar Jul 03 '24 23:07 Richy-Z