Skip to content

fix(flet-cli): correct dependency parsing (#6332)#6340

Open
td3447 wants to merge 2 commits intoflet-dev:mainfrom
td3447:fix/6332-parse-dependency-constraints
Open

fix(flet-cli): correct dependency parsing (#6332)#6340
td3447 wants to merge 2 commits intoflet-dev:mainfrom
td3447:fix/6332-parse-dependency-constraints

Conversation

@td3447
Copy link

@td3447 td3447 commented Mar 21, 2026

Fix #6332

Summary

Commit message

Closes issue: #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.

Additional Details

  • This prevents users from having to manually edit the pyproject.toml after adding dependencies with uv add. uv does have a leading space before the < but with flet build a lack of leading space raises an error.
  • The function looks for a <= 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

  • Builds tested on the following.
flet build windows | linux | apk

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Summary by Sourcery

Bug Fixes:

  • Ensure dependencies with < or <= version constraints are formatted with a leading space to avoid build failures when parsing pyproject.toml dependencies.

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.
@CLAassistant
Copy link

CLAassistant commented Mar 21, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine

@FeodorFitsner
Copy link
Contributor

Thank you for your PR!

This only fixes project.dependencies. flet build / flet publish prefer tool.poetry.dependencies first, and get_poetry_dependencies() can still emit pkg<ver without normalization, so Poetry users may still hit the same issue. Can you fix that too please?

- 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.
@td3447
Copy link
Author

td3447 commented Mar 21, 2026

Updates

  • Added compatibility with poetry
  • Edited format_dependency_version() to include checks for < or <= and include a leading space.

Test Code

  • Builds tested on the following.
poetry run flet build windows | apk

Tests

[tool.poetry.dependencies]
 chardet = "<=6"
 chardet = "<6"
 chardet = "   <     6  "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: flet build fails with dependency with only <, The system cannot find the file specified.

3 participants