-
Notifications
You must be signed in to change notification settings - Fork 536
v1: Migrated poetry
to uv
#5253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Migrates the project's dependency management and build configuration from Poetry to uv.
- Converted all pyproject.toml files to use PEP 621 metadata with uv-specific configuration and setuptools.
- Updated CI workflows and build scripts (including Appveyor) to install, build, test, and publish using uv commands.
- Revised the developer documentation in CONTRIBUTING.md to reflect the new uv installation and command usage.
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
sdk/python/pyproject.toml | Switched dependency and workspace configuration from Poetry to uv. |
sdk/python/packages/flet/pyproject.toml | Migrated dependency declarations, optional dependencies, and URLs to PEP 621 format. |
sdk/python/packages/flet-web/pyproject.toml | Updated package-data and URL declarations with new build settings. |
sdk/python/packages/flet-desktop/pyproject.toml | Simplified dependencies and shifted build backend from poetry-core to setuptools.build_meta. |
sdk/python/packages/flet-cli/pyproject.toml | Updated package metadata and entry-points, and replaced poetry-specific config with project configuration. |
ci/update-flet-wheel-deps.py | Adjusted dependency version insertion to use strict equality matches. |
ci/patch_toml_versions.py | Changed dependency patching to iterate over a list per the new PEP 621 structure. |
CONTRIBUTING.md | Updated installation and command instructions from Poetry to uv. |
.appveyor.yml | Revised build, test, and publish steps to install uv, build wheels with uv, and adjust wheel artifact paths. |
Files not reviewed (1)
- ci/common.sh: Language not supported
for i in range(0, len(deps)): | ||
dep = deps[i] | ||
if dep == dep_name: | ||
deps[i] = f"{dep_name}=={ver}" | ||
elif dep.startswith(f"{dep_name};"): | ||
deps[i] = dep.replace(f"{dep_name};", f"{dep_name}=={ver};") | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dependency version update logic in patch_dep relies on simple string matching, which might not correctly handle cases where dependencies already contain version constraints or extras. Consider using a more robust parser or regex to accurately update dependency strings.
for i in range(0, len(deps)): | |
dep = deps[i] | |
if dep == dep_name: | |
deps[i] = f"{dep_name}=={ver}" | |
elif dep.startswith(f"{dep_name};"): | |
deps[i] = dep.replace(f"{dep_name};", f"{dep_name}=={ver};") | |
for i in range(len(deps)): | |
dep = deps[i] | |
# Parse dependency into components | |
if ";" in dep: | |
base, marker = dep.split(";", 1) | |
else: | |
base, marker = dep, None | |
if "[" in base: | |
name, extras = base.split("[", 1) | |
extras = "[" + extras # Add back the opening bracket | |
else: | |
name, extras = base, "" | |
# Update version if the dependency name matches | |
if name.strip() == dep_name: | |
new_base = f"{name.strip()}{extras}=={ver}" | |
deps[i] = f"{new_base};{marker}" if marker else new_base |
Copilot uses AI. Check for mistakes.
- poetry build | ||
- sh: | | ||
if [[ "$PACKAGE_NAME" == "flet-desktop-light" ]]; then | ||
sed -i 's/flet-desktop/flet-desktop-light/g' pyproject.toml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Ensure that the sed substitution for replacing 'flet-desktop' with 'flet-desktop-light' in pyproject.toml is idempotent and targets only the intended configuration lines. Consider refining the match pattern to avoid inadvertent changes to unrelated parts of the file.
sed -i 's/flet-desktop/flet-desktop-light/g' pyproject.toml | |
sed -i '/^name = "flet-desktop"$/s/flet-desktop/flet-desktop-light/' pyproject.toml |
Copilot uses AI. Check for mistakes.
* v1: Migrated `poetry` to `uv` (#5253) * poetry replaced with uv * Try building with CI * add uv to path * Fix sdk path * Support for desktop light * unpack pyodide * Update contributing guide * Enable Ruff * Cleanup after merge
…le()` call (#5378) * v1: Migrated `poetry` to `uv` (#5253) * poetry replaced with uv * Try building with CI * add uv to path * Fix sdk path * Support for desktop light * unpack pyodide * Update contributing guide * Enable Ruff * Cleanup after merge * Filepicker entitlements for macOS * Android and iOS: allow passing `src_bytes` in FilePicker.save_file() call Fix #5373 * Added `com.apple.security.files.user-selected.read-write` to default macOS entitlements
Summary by Sourcery
Migrate Python dependency management and building from Poetry to uv.
Build:
pyproject.toml
files to use standard PEP 621 metadata andsetuptools
build backend.uv
workspace.poetry.lock
files withuv.lock
.CI:
uv
instead ofpoetry
.uv
.Documentation:
CONTRIBUTING.md
) withuv
installation and commands.