fix(flet-cli): correct dependency parsing (#6332)#6340
Open
td3447 wants to merge 3 commits intoflet-dev:mainfrom
Open
fix(flet-cli): correct dependency parsing (#6332)#6340td3447 wants to merge 3 commits intoflet-dev:mainfrom
td3447 wants to merge 3 commits intoflet-dev:mainfrom
Conversation
Closes issue: flet-dev#6332 - Adds a space (' ') in front of dependencies in `pyproject.toml` that have version constraints starting with `<` or `<=`. - Fixes the issue where `flet build` would give a `The system cannot find the file specified.` error.
Contributor
|
Thank you for your PR! This only fixes |
- Fixed parsing issue for dependencies in [tool.poetry.dependencies] - Adds single space ' ' to the front of the `<` or `<=` to prevent `The system cannot find the file specified.` error.
Author
Updates
Test Code
poetry run flet build windows | apkTests[tool.poetry.dependencies]
✅ chardet = "<=6"
✅ chardet = "<6"
✅ chardet = " < 6 " |
- Fixed an error where a `<` after a `,` was not recognized as a dependency. - Added more checks to ensure a wider variety of typos are covered. - Fixed an issue where using a `*` wouldn't correctly look for any version and raise an error. - Fixed an issue where using a `!` after a `,` would raise an error, since it was missing the required ` ` in front. - Ensured the correct separators were added for all the types of requirements I could think of - Added support for clearing whitespace from uv dependencies, in the same way used with the poetry dependencies. - Tests were conducted on both poetry and uv, using `flet build`
Author
Updates
TestingPoetrypoetry run flet build windows | apk -vpyproject.toml (Poetry)Test Case[tool.poetry.dependencies]
boto3 = "* "
packaging = " 26.0 "
urllib3 = " ^ 2.6.0 "
setuptools = " ~ 82.0.0 "
certifi = " >= 2026.1.4 "
chardet = " < 6 "
requests = " <= 2.32.4 "
pydantic = " >= 2.9.0 , <3.0.0 "
pillow = " > 11.1.0, <= 12.0.0 "
sqlalchemy = " >= 1.4 , <=2.0"
pandas = " >= 2.3, != 2.3.3 "
scipy = { version = "^ 1.16", optional = true }
uvicorn = { version = ">= 0.42.0", extras = ["standard"] }
pywin32 = { version = " >= 310", markers = "sys_platform == 'win32'" }
numpy = { git = "https://github.com/numpy/numpy.git", branch = "main" }Standard case[tool.poetry.dependencies]
boto3 = "*"
packaging = "26.0"
urllib3 = "^2.6.0"
setuptools = "~82.0.0"
certifi = ">=2026.1.4"
chardet = "<6"
requests = "<=2.32.4"
pydantic = ">=2.9.0,<3.0.0"
pillow = ">11.1.0,<=12.0.0"
sqlalchemy = ">=1.4,<=2.0"
pandas = ">=2.3,!=2.3.3"
scipy = { version = "^1.16", optional = true }
uvicorn = { version = ">=0.42.0", extras = ["standard"] }
pywin32 = { version = ">=310", markers = "sys_platform == 'win32'" }
numpy = { git = "https://github.com/numpy/numpy.git", branch = "main" }Output[dependencies]
pandas>=2.3, !=2.3.3
boto3
certifi>=2026.1.4
chardet <6
pydantic>=2.9.0, <3.0.0
packaging==26.0
scipy>=1.16
requests <=2.32.4
numpy@git+https://github.com/numpy/numpy.git@main
pywin32>=310;sys_platform == 'win32'
setuptools~=82.0.0
pillow>11.1.0, <=12.0.0
urllib3>=2.6.0
uvicorn>=0.42.0
sqlalchemy>=1.4, <=2.0Detailed Outputdep: boto3
sep: ''
val:
suf:
dep: packaging
sep: '=='
val: 26.0
suf:
dep: urllib3
sep: '>='
val: 2.6.0
suf:
dep: setuptools
sep: ''
val: ~=82.0.0
suf:
dep: certifi
sep: ''
val: >=2026.1.4
suf:
dep: chardet
sep: ''
val: <6
suf:
dep: requests
sep: ''
val: <=2.32.4
suf:
dep: pydantic
sep: ''
val: >=2.9.0, <3.0.0
suf:
dep: pillow
sep: ''
val: >11.1.0, <=12.0.0
suf:
dep: sqlalchemy
sep: ''
val: >=1.4, <=2.0
suf:
dep: pandas
sep: ''
val: >=2.3, !=2.3.3
suf:
start: scipy^1.16
dep: scipy
sep: '>='
val: 1.16
suf:
start: uvicorn>=0.42.0
dep: uvicorn
sep: ''
val: >=0.42.0
suf:
start: pywin32>=310
dep: pywin32
sep: ''
val: >=310
suf: ;sys_platform == 'win32'
dep: numpy
sep: '@'
val: git+https://github.com/numpy/numpy.git@main
suf:ResultBuild successful 🥳 UVuv run flet build windows | apk -vpyproject.toml (UV)Test Casedependencies = [
"flet ",
" boto3 ",
" packaging == 26.0 ",
" urllib3 >= 2.6.0 ",
" setuptools ~= 82.0.0 ",
" certifi >= 2026.1.4 ",
"chardet < 6 ",
"requests <= 2.32.4",
"pydantic>= 2.9.0 , <3.0.0 ",
"pillow> 11.1.0, <=12.0.0 ",
"sqlalchemy>=1.4, <=2.0",
"uvicorn[ standard ]>= 0.42.0",
"pywin32 >=310 ; sys_platform == 'win32'",
"numpy @ git+https://github.com/numpy/numpy.git@main",
]Standard casedependencies = [
"flet",
"boto3",
"packaging==26.0",
"urllib3>=2.6.0",
"setuptools~=82.0.0",
"certifi>=2026.1.4",
"chardet <6",
"requests<=2.32.4",
"pydantic>=2.9.0, <3.0.0",
"pillow>11.1.0, <=12.0.0",
"sqlalchemy>=1.4, <=2.0",
"pandas>=2.3, !=2.3.3",
# "scipy>=1.16",
"uvicorn[standard]>=0.42.0",
"pywin32>=310; sys_platform == 'win32'",
"numpy @ git+https://github.com/numpy/numpy.git@main",
]Outputpackaging==26.0
urllib3>=2.6.0
chardet <6
sqlalchemy>=1.4, <=2.0
pydantic>=2.9.0, <3.0.0
pillow>11.1.0, <=12.0.0
boto3
flet
pandas>=2.3, !=2.3.3
pywin32>=310;sys_platform=='win32'
requests <=2.32.4
uvicorn[standard]>=0.42.0
numpy@git+https://github.com/numpy/numpy.git@main
certifi>=2026.1.4
setuptools~=82.0.0Detailed Outputdep: flet
dep: boto3
dep: packaging==26.0
dep: urllib3>=2.6.0
dep: setuptools~=82.0.0
dep: certifi>=2026.1.4
dep: chardet<6
val: chardet
sep: '<'
suf: 6
dep: requests<=2.32.4
val: requests
sep: '<='
suf: 2.32.4
dep: pydantic>=2.9.0,<3.0.0
val: pydantic>=2.9.0,
sep: '<'
suf: 3.0.0
dep: pillow>11.1.0,<=12.0.0
val: pillow>11.1.0,
sep: '<='
suf: 12.0.0
dep: sqlalchemy>=1.4,<=2.0
val: sqlalchemy>=1.4,
sep: '<='
suf: 2.0
dep: pandas>=2.3,!=2.3.3
val: pandas>=2.3,
sep: '!'
suf: =2.3.3
dep: uvicorn[standard]>=0.42.0
dep: pywin32>=310;sys_platform=='win32'
dep: numpy@git+https://github.com/numpy/numpy.git@mainResultBuild successful 🥳 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #6332
Summary
Commit message
Closes issue: #6332
pyproject.tomlthat have version constraints starting with<or<=.flet buildwould give aThe system cannot find the file specified.error.Additional Details
pyproject.tomlafter adding dependencies withuv add. uv does not have a leading space before the<but withflet builda lack of leading space raises an error.<=or<and bypasses all others, if it has one from the list then it appends a space and adds that to the set.Test Code
Type of change
Summary by Sourcery
Bug Fixes:
<or<=version constraints are formatted with a leading space to avoid build failures when parsingpyproject.tomldependencies.