Skip to content

Commit 76483ab

Browse files
committed
Merge branch 'main' into v1-integration-tests-p2
2 parents ef6f0c3 + 4ea9558 commit 76483ab

File tree

93 files changed

+1113
-563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+1113
-563
lines changed

.appveyor.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ for:
139139
# patch pubspecs
140140
for dir in packages/flet*; do
141141
echo "Patching $dir/pubspec.yaml"
142-
uv run --with pyyaml ci/patch_pubspec.py $dir/pubspec.yaml $PKG_VER
142+
uv run ci/patch_pubspec.py $dir/pubspec.yaml $PKG_VER
143143
done
144144
145145
cd packages/flet
@@ -209,7 +209,7 @@ for:
209209
$ErrorActionPreference = "Stop"
210210
$env:PYPI_VER = $env:APPVEYOR_BUILD_VERSION.replace("+", ".dev")
211211
$vp = "$env:flet_sdk_root/packages/flet-desktop/src/flet_desktop/version.py"; (Get-Content $vp).replace("version = `"`"", "version = `"$env:PYPI_VER`"") | Set-Content $vp
212-
- uv run --with tomlkit ci/patch_toml_versions.py %flet_sdk_root%/packages/flet-desktop/pyproject.toml %PYPI_VER%
212+
- uv run ci/patch_toml_versions.py %flet_sdk_root%/packages/flet-desktop/pyproject.toml %PYPI_VER%
213213

214214
- cd client
215215
- set RELEASE_DIR=build\windows\x64\runner\Release
@@ -230,8 +230,8 @@ for:
230230
- uv build --wheel --package flet-desktop
231231
- ps: |
232232
Get-ChildItem -Path dist/*-py3-none-any.whl | ForEach-Object {
233-
Start-ProcessWithOutput "uv run --with wheel --no-project $env:APPVEYOR_BUILD_FOLDER\ci\repackage_wheel_with_tag.py $($_.FullName) py3-none-win_amd64"
234-
Start-ProcessWithOutput "uv run --with wheel --no-project $env:APPVEYOR_BUILD_FOLDER\ci\repackage_wheel_with_tag.py $($_.FullName) py3-none-win32"
233+
Start-ProcessWithOutput "uv run $env:APPVEYOR_BUILD_FOLDER\ci\repackage_wheel_with_tag.py $($_.FullName) py3-none-win_amd64"
234+
Start-ProcessWithOutput "uv run $env:APPVEYOR_BUILD_FOLDER\ci\repackage_wheel_with_tag.py $($_.FullName) py3-none-win32"
235235
Remove-Item $_.FullName
236236
}
237237
- dir dist
@@ -291,8 +291,8 @@ for:
291291
- uv build --wheel --package flet-desktop
292292
- sh: |
293293
for file in dist/*-py3-none-any.whl; do
294-
uv run --with wheel --no-project $root/ci/repackage_wheel_with_tag.py $file "py3-none-macosx_12_0_arm64"
295-
uv run --with wheel --no-project $root/ci/repackage_wheel_with_tag.py $file "py3-none-macosx_10_14_x86_64"
294+
uv run $root/ci/repackage_wheel_with_tag.py $file "py3-none-macosx_12_0_arm64"
295+
uv run $root/ci/repackage_wheel_with_tag.py $file "py3-none-macosx_10_14_x86_64"
296296
rm $file
297297
done
298298
@@ -378,7 +378,7 @@ for:
378378
for file in dist/*-py3-none-any.whl; do
379379
for tag in "${wheel_tags[@]}"; do
380380
wheel_tag=$(echo "$tag" | sed "s/{arch}/$platform_arch/g")
381-
uv run --with wheel --no-project $root/ci/repackage_wheel_with_tag.py $file $wheel_tag
381+
uv run $root/ci/repackage_wheel_with_tag.py $file $wheel_tag
382382
done
383383
rm "$file"
384384
done
@@ -488,7 +488,7 @@ for:
488488
- uv build --wheel --package flet
489489

490490
# update deps
491-
- uv run --with wheel $root/ci/update-flet-wheel-deps.py dist
491+
- uv run $root/ci/update-flet-wheel-deps.py dist
492492

493493
# publish packages
494494
- publish_to_pypi dist/*.whl

.github/workflows/macos-integration-tests.yml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,24 @@ name: macOS Integration Tests
22

33
on:
44
push:
5+
paths:
6+
- 'sdk/python/packages/flet/src/**'
7+
- 'sdk/python/packages/flet/integration_tests/**'
8+
- 'packages/flet/**'
9+
- 'client/**'
510
pull_request:
11+
paths:
12+
- 'sdk/python/packages/flet/src/**'
13+
- 'sdk/python/packages/flet/integration_tests/**'
14+
- 'packages/flet/**'
15+
- 'client/**'
16+
17+
# Ensure only one run per branch (PR or push), cancel older ones
18+
concurrency:
19+
group: macos-integration-tests-${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref_name }}
20+
cancel-in-progress: true
621

722
env:
8-
FLUTTER_VERSION: "3.32.8"
923
FLET_TEST_SCREENSHOTS_PIXEL_RATIO: "2.0"
1024
FLET_TEST_SCREENSHOTS_SIMILARITY_THRESHOLD: "99.0"
1125
FLET_TEST_DISABLE_FVM: "1"
@@ -16,28 +30,25 @@ jobs:
1630
steps:
1731
- uses: actions/checkout@v4
1832

19-
- name: Install CocoaPods
20-
run: brew install cocoapods
33+
- name: Configure FVM
34+
uses: kuhnroyal/flutter-fvm-config-action/config@v3
35+
id: fvm-config-action
36+
with:
37+
path: 'client/.fvmrc'
2138

2239
- name: Setup Flutter
2340
uses: subosito/flutter-action@v2
2441
with:
25-
flutter-version: ${{ env.FLUTTER_VERSION }}
26-
channel: stable
42+
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
43+
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
2744
cache: true
2845

2946
- name: Install uv
30-
shell: bash
31-
run: |
32-
curl -LsSf https://astral.sh/uv/install.sh | sh
33-
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
47+
uses: astral-sh/setup-uv@v6
3448

3549
- name: Show tool versions
3650
run: |
37-
python3 --version
38-
uv --version
39-
pod --version
40-
flutter --version
51+
python3 --version && uv --version && pod --version && flutter --version
4152
4253
- name: Run integration tests
4354
working-directory: sdk/python

ci/patch_pubspec.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# /// script
2+
# dependencies = ["pyyaml"]
3+
# ///
4+
15
import os
26
import pathlib
37
import sys
@@ -17,7 +21,7 @@
1721
"flet",
1822
]
1923

20-
with open(pubspec_path, "r") as f:
24+
with open(pubspec_path) as f:
2125
data = yaml.safe_load(f)
2226

2327
# patch version

ci/patch_toml_package_name.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# /// script
2+
# dependencies = ["tomlkit"]
3+
# ///
4+
15
import os
26
import pathlib
37
import sys
@@ -14,7 +18,7 @@
1418
print(f"Patching TOML file {toml_path} to {package_name}")
1519

1620
# read
17-
with open(toml_path, "r") as f:
21+
with open(toml_path) as f:
1822
t = tomlkit.parse(f.read())
1923

2024
# patch name

ci/patch_toml_versions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# /// script
2+
# dependencies = ["tomlkit"]
3+
# ///
4+
15
import os
26
import pathlib
37
import sys
@@ -14,7 +18,7 @@
1418
print(f"Patching TOML file {toml_path} to {ver}")
1519

1620
# read
17-
with open(toml_path, "r") as f:
21+
with open(toml_path) as f:
1822
t = tomlkit.parse(f.read())
1923

2024
# patch version

ci/repackage_wheel_with_tag.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# /// script
2+
# dependencies = ["wheel"]
3+
# ///
4+
15
import os
26
import sys
37
import tempfile
@@ -38,7 +42,7 @@ def repackage_wheel(wheel_path, new_tag):
3842
# Process metadata files and replace the tag
3943
metadata_files = list(wheel_dir.glob("*.dist-info/WHEEL"))
4044
for metadata_file in metadata_files:
41-
with open(metadata_file, "r") as f:
45+
with open(metadata_file) as f:
4246
content = f.read()
4347
new_content = content.replace(
4448
"Tag: py3-none-any",

ci/update-flet-wheel-deps.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# /// script
2+
# dependencies = ["wheel"]
3+
# ///
4+
15
import os
26
import re
37
import sys
@@ -27,7 +31,7 @@ def extract_version(wheel_file):
2731

2832
# Process the METADATA file
2933
def update_metadata(metadata_file, version):
30-
with open(metadata_file, "r") as file:
34+
with open(metadata_file) as file:
3135
lines = file.readlines()
3236

3337
i = 0

client/.fvmrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"flutter": "3.32.4"
3-
}
2+
"flutter": "3.32.8"
3+
}

packages/flet/lib/src/controls/button.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class _ButtonControlState extends State<ButtonControl> with FletStoreMixin {
5353
bool isTextButton = widget.control.type == "TextButton";
5454
bool isOutlinedButton = widget.control.type == "OutlinedButton";
5555

56-
var url = widget.control.getString("url");
56+
var url = widget.control.getUrl("url");
5757
var iconColor = widget.control.getColor("icon_color", context);
5858
var clipBehavior =
5959
widget.control.getClipBehavior("clip_behavior", Clip.none)!;
@@ -65,8 +65,7 @@ class _ButtonControlState extends State<ButtonControl> with FletStoreMixin {
6565
Function()? onPressed = !widget.control.disabled
6666
? () {
6767
if (url != null) {
68-
openWebBrowser(url,
69-
webWindowName: widget.control.getString("url_target"));
68+
openWebBrowser(url);
7069
}
7170
widget.control.triggerEvent("click");
7271
}

packages/flet/lib/src/controls/canvas.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,11 @@ class FletCustomPainter extends CustomPainter {
471471
}
472472
for (var elem in (j as List)) {
473473
var type = elem["_type"];
474-
if (type == "moveto") {
474+
if (type == "MoveTo") {
475475
path.moveTo(parseDouble(elem["x"], 0)!, parseDouble(elem["y"], 0)!);
476-
} else if (type == "lineto") {
476+
} else if (type == "LineTo") {
477477
path.lineTo(parseDouble(elem["x"], 0)!, parseDouble(elem["y"], 0)!);
478-
} else if (type == "arc") {
478+
} else if (type == "Arc") {
479479
path.addArc(
480480
Rect.fromLTWH(
481481
parseDouble(elem["x"], 0)!,
@@ -484,20 +484,20 @@ class FletCustomPainter extends CustomPainter {
484484
parseDouble(elem["height"], 0)!),
485485
parseDouble(elem["start_angle"], 0)!,
486486
parseDouble(elem["sweep_angle"], 0)!);
487-
} else if (type == "arcto") {
487+
} else if (type == "ArcTo") {
488488
path.arcToPoint(
489489
Offset(parseDouble(elem["x"], 0)!, parseDouble(elem["y"], 0)!),
490490
radius: Radius.circular(parseDouble(elem["radius"], 0)!),
491491
rotation: parseDouble(elem["rotation"], 0)!,
492492
largeArc: parseBool(elem["large_arc"], false)!,
493493
clockwise: parseBool(elem["clockwise"], true)!);
494-
} else if (type == "oval") {
494+
} else if (type == "Oval") {
495495
path.addOval(Rect.fromLTWH(
496496
parseDouble(elem["x"], 0)!,
497497
parseDouble(elem["y"], 0)!,
498498
parseDouble(elem["width"], 0)!,
499499
parseDouble(elem["height"], 0)!));
500-
} else if (type == "rect") {
500+
} else if (type == "Rect") {
501501
var borderRadius = parseBorderRadius(elem["border_radius"]);
502502
path.addRRect(RRect.fromRectAndCorners(
503503
Rect.fromLTWH(
@@ -509,25 +509,25 @@ class FletCustomPainter extends CustomPainter {
509509
topRight: borderRadius?.topRight ?? Radius.zero,
510510
bottomLeft: borderRadius?.bottomLeft ?? Radius.zero,
511511
bottomRight: borderRadius?.bottomRight ?? Radius.zero));
512-
} else if (type == "conicto") {
512+
} else if (type == "QuadraticTo") {
513513
path.conicTo(
514514
parseDouble(elem["cp1x"], 0)!,
515515
parseDouble(elem["cp1y"], 0)!,
516516
parseDouble(elem["x"], 0)!,
517517
parseDouble(elem["y"], 0)!,
518518
parseDouble(elem["w"], 0)!);
519-
} else if (type == "cubicto") {
519+
} else if (type == "CubicTo") {
520520
path.cubicTo(
521521
parseDouble(elem["cp1x"], 0)!,
522522
parseDouble(elem["cp1y"], 0)!,
523523
parseDouble(elem["cp2x"], 0)!,
524524
parseDouble(elem["cp2y"], 0)!,
525525
parseDouble(elem["x"], 0)!,
526526
parseDouble(elem["y"], 0)!);
527-
} else if (type == "subpath") {
527+
} else if (type == "SubPath") {
528528
path.addPath(buildPath(elem["elements"]),
529529
Offset(parseDouble(elem["x"], 0)!, parseDouble(elem["y"], 0)!));
530-
} else if (type == "close") {
530+
} else if (type == "Close") {
531531
path.close();
532532
}
533533
}

0 commit comments

Comments
 (0)