Skip to content

Commit 8d6adca

Browse files
FeodorFitsneromamkazndonkoHenri
authored
Merge 0.25.2 into main (#4672)
* Add `flet` if no dependencies provided for `flet publish` command (#4508) Fix #4493 * Update project_dependencies.py (#4459) # `Fixed` when I get no markers key in the version_value variable. ```bash Traceback (most recent call last): File "/opt/hostedtoolcache/Python/3.12.5/x64/bin/flet", line 8, in <module> sys.exit(main()) ^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet/cli.py", line 12, in main flet_cli.cli.main() File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/cli.py", line 89, in main args.handler(args) File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 557, in handle self.package_python_app() File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 1303, in package_python_app toml_dependencies = get_poetry_dependencies( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 41, in get_poetry_dependencies format_dependency_version(dependency, version) File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 21, in format_dependency_version if version_value["markers"]: ~~~~~~~~~~~~~^^^^^^^^^^^ KeyError: 'markers' ``` * Fix PyInstaller hook to avoid download Flet app bundle on first run (#4552) * Fix PyInstaller hook to avoid download Flet app bundle on first run Fix #4549 * Fix web job * Support `git`, `path`, `url` Poetry-style dependencies in pyproject.toml (#4554) Fix #4547 * Prepare Flet 0.25.2 (#4541) * feat: implement `Window.ignore_mouse_events` (#4465) * Update project_dependencies.py (#4459) # `Fixed` when I get no markers key in the version_value variable. ```bash Traceback (most recent call last): File "/opt/hostedtoolcache/Python/3.12.5/x64/bin/flet", line 8, in <module> sys.exit(main()) ^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet/cli.py", line 12, in main flet_cli.cli.main() File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/cli.py", line 89, in main args.handler(args) File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 557, in handle self.package_python_app() File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 1303, in package_python_app toml_dependencies = get_poetry_dependencies( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 41, in get_poetry_dependencies format_dependency_version(dependency, version) File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 21, in format_dependency_version if version_value["markers"]: ~~~~~~~~~~~~~^^^^^^^^^^^ KeyError: 'markers' ``` * Remove `v0.26.0` deprecations (#4479) * delete deprecations on py end * delete deprecations on dart end * fix: `SafeArea` object has no attribute `_SafeArea__minimum` (#4500) * remove minimum from SafeArea * remove deprecated props * Changelog updated * Fix publishing flet-windows.zip to releases * Revert "Merge branch 'main' into feodor/prepare-0-25-2" This reverts commit 32a7343, reversing changes made to 3dc01e1. * Changelog updated * Update changelog. * Changelog updated with cherry-picked bug fixes * fix broken `Map.center_on()` and default animations (#4519) * fix center_on * get default animation duration and curve * fix: Tooltip corruption in `Segment` and `BarChartRod` on `update()` (#4525) * avoid jsonDecoding `Segment` and `BarChartRod` tooltips * avoid jsonEncoding `Segment` and `BarChartRod` tooltips * Unset theme visual density default * Unset `SegmentedButton` border side default * `TextField.hint_text` should be displayed if `label` is not specified * fix: Setting `CheckBox.border_side.stroke_align` to an Enum fails (#4526) * `BorderSideStrokeAlign` should inherit from float * properly parse `Chip.border_side` * fix:`ControlState` should be resolved based on user-defined order (#4556) * ControlState: rename "" to "default" * resolve ControlState on user-defined order * fix failing tests * remove breaking line * fix wrong attribute name (#4557) * Publish flet wheels to GitHub releases * remove redeclared `MapPointerDeviceType` --------- Co-authored-by: TheEthicalBoy <[email protected]> Co-authored-by: Osama Mohammed Al-zabidi <[email protected]> Co-authored-by: ndonkoHenri <[email protected]> * restore `AudioRecorder.start_recording_async` * clean imports --------- Co-authored-by: Osama Mohammed Al-zabidi <[email protected]> Co-authored-by: TheEthicalBoy <[email protected]> Co-authored-by: ndonkoHenri <[email protected]>
1 parent 10be7d4 commit 8d6adca

Some content is hidden

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

69 files changed

+180
-108
lines changed

.appveyor.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ for:
259259
provider: GitHub
260260
auth_token: $(GITHUB_TOKEN)
261261
release: $(APPVEYOR_REPO_TAG_NAME)
262-
artifact: flet_windows
263262
on:
264263
APPVEYOR_REPO_TAG: true
265264

@@ -510,3 +509,10 @@ for:
510509
artifacts:
511510
- path: sdk/python/packages/flet-cli/dist/*
512511
- path: sdk/python/packages/flet/dist/*
512+
513+
deploy:
514+
provider: GitHub
515+
auth_token: $(GITHUB_TOKEN)
516+
release: $(APPVEYOR_REPO_TAG_NAME)
517+
on:
518+
APPVEYOR_REPO_TAG: true

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Flet changelog
22

3+
## 0.25.2
4+
5+
### Bug fixes
6+
7+
* Fix `flet publish` creates broken website if no `requirements.txt` or `pyproject.toml` found ([#4493](https://github.com/flet-dev/flet/pull/4493)).
8+
* Fix PyInstaller hook to avoid download Flet app bundle on first run ([#4549](https://github.com/flet-dev/flet/pull/4549)).
9+
* Support `git`, `path`, `url` Poetry-style dependencies in `pyproject.toml` ([#4554](https://github.com/flet-dev/flet/pull/4554)).
10+
* Fixed broken `Map.center_on()` and default animations ([#4519](https://github.com/flet-dev/flet/pull/4519)).
11+
* Fixed Tooltip corruption in `Segment` and `BarChartRod` on `update()` ([#4525](https://github.com/flet-dev/flet/pull/4525)).
12+
* Fixed Setting `CheckBox.border_side.stroke_align` to an Enum fails ([#4526](https://github.com/flet-dev/flet/pull/4526)).
13+
* Fixed `ControlState should` be resolved based on user-defined order ([#4556](https://github.com/flet-dev/flet/pull/4556)).
14+
* Fixed broken `Dismissible.dismiss_direction` ([#4557](https://github.com/flet-dev/flet/pull/4557)).
15+
316
## 0.25.1
417

518
### Changes

packages/flet/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# 0.25.2
2+
3+
## Bug fixes
4+
5+
* Fix `flet publish` creates broken website if no `requirements.txt` or `pyproject.toml` found ([#4493](https://github.com/flet-dev/flet/pull/4493)).
6+
* Fix PyInstaller hook to avoid download Flet app bundle on first run ([#4549](https://github.com/flet-dev/flet/pull/4549)).
7+
* Support `git`, `path`, `url` Poetry-style dependencies in `pyproject.toml` ([#4554](https://github.com/flet-dev/flet/pull/4554)).
8+
* Fixed broken `Map.center_on()` and default animations ([#4519](https://github.com/flet-dev/flet/pull/4519)).
9+
* Fixed Tooltip corruption in `Segment` and `BarChartRod` on `update()` ([#4525](https://github.com/flet-dev/flet/pull/4525)).
10+
* Fixed Setting `CheckBox.border_side.stroke_align` to an Enum fails ([#4526](https://github.com/flet-dev/flet/pull/4526)).
11+
* Fixed `ControlState should` be resolved based on user-defined order ([#4556](https://github.com/flet-dev/flet/pull/4556)).
12+
* Fixed broken `Dismissible.dismiss_direction` ([#4557](https://github.com/flet-dev/flet/pull/4557)).
13+
114
# 0.25.1
215

316
## Changes

packages/flet/lib/src/utils/material_state.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ class WidgetStateFromJSON<T> extends WidgetStateProperty<T?> {
2424

2525
// preserve user-defined order
2626
_states = LinkedHashMap<String, T>.from(
27-
jsonDictValue?.map((key, value) {
28-
var normalizedKey = key.trim().toLowerCase();
29-
// "" is now deprecated; use "default" instead
30-
if (normalizedKey == "") normalizedKey = "default";
31-
return MapEntry(normalizedKey, converterFromJson(value));
27+
jsonDictValue?.map((k, v) {
28+
var key = k.trim().toLowerCase();
29+
// "" is deprecated and renamed to "default"
30+
if (key == "") key = "default";
31+
return MapEntry(key, converterFromJson(v));
3232
}) ??
3333
{},
3434
);

packages/flet/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet
22
description: Write entire Flutter app in Python or add server-driven UI experience into existing Flutter app.
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet
5-
version: 0.25.1
5+
version: 0.25.2
66

77
# This package supports all platforms listed below.
88
platforms:

packages/flet_ads/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_ads/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_ads
22
description: Flet Ads control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_ads
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_audio/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_audio/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_audio
22
description: Flet Audio control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_audio
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_audio_recorder/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_audio_recorder/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_audio_recorder
22
description: Flet AudioRecorder control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_audio_recorder
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_flashlight/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_flashlight/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_flashlight
22
description: Flet Flashlight control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_flashlight
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_geolocator/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_geolocator/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_geolocator
22
description: Flet Geolocator control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_geolocator
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_lottie/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_lottie/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_lottie
22
description: Flet Lottie control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_lottie
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_map/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_map/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_map
22
description: Flet Map control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_map
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_permission_handler/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_permission_handler/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_permission_handler
22
description: Flet PermissionHandler control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_permission_handler
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_rive/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_rive/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_rive
22
description: Flet Rive control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_rive
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_video/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_video/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_video
22
description: Flet Video control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_video
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_webview/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_webview/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_webview
22
description: Flet WebView control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_webview
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

sdk/python/packages/flet-cli/src/flet_cli/__pyinstaller/hook-flet.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,4 @@
88
bin_path = get_flet_bin_path()
99

1010
if bin_path:
11-
# package "bin/fletd" only
12-
if os.getenv("PACKAGE_FLETD_ONLY"):
13-
bin_path = os.path.join(bin_path, "fletd*")
14-
15-
datas = [(bin_path, "flet/bin")]
11+
datas = [(bin_path, "flet_desktop/app")]

sdk/python/packages/flet-cli/src/flet_cli/commands/publish.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def add_arguments(self, parser: argparse.ArgumentParser) -> None:
113113
)
114114

115115
def handle(self, options: argparse.Namespace) -> None:
116+
import flet.version
116117
from flet.utils.pip import ensure_flet_web_package_installed
117118

118119
ensure_flet_web_package_installed()
@@ -197,6 +198,9 @@ def handle(self, options: argparse.Namespace) -> None:
197198
)
198199
print(f"{reqs_filename} dependencies: {deps}")
199200

201+
if len(deps) == 0:
202+
deps = [f"flet=={flet.version.version}"]
203+
200204
temp_reqs_txt = Path(tempfile.gettempdir()).joinpath(random_string(10))
201205
with open(temp_reqs_txt, "w") as f:
202206
f.writelines(dep + "\n" for dep in deps)

sdk/python/packages/flet-cli/src/flet_cli/utils/project_dependencies.py

Lines changed: 54 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,69 @@ def get_poetry_dependencies(
1414
if poetry_dependencies is None:
1515
return None
1616

17-
def format_dependency_version(dependency: str, version_value: Any):
17+
def format_dependency_version(dependency_name: str, dependency_value: Any):
18+
sep = "@"
19+
value = ""
1820
suffix = ""
19-
if isinstance(version_value, dict):
20-
version = version_value["version"]
21-
markers = version_value.get("markers")
21+
22+
if isinstance(dependency_value, dict):
23+
version = dependency_value.get("version")
24+
if version:
25+
sep = "=="
26+
value = version
27+
else:
28+
git_url = dependency_value.get("git")
29+
if git_url:
30+
value = (
31+
f"git+{git_url}" if not git_url.startswith("git@") else git_url
32+
)
33+
rev = (
34+
dependency_value.get("branch")
35+
or dependency_value.get("rev")
36+
or dependency_value.get("tag")
37+
)
38+
if rev:
39+
value = f"{value}@{rev}"
40+
subdirectory = dependency_value.get("subdirectory")
41+
if subdirectory:
42+
value = f"{value}#subdirectory={subdirectory}"
43+
else:
44+
path = dependency_value.get("path")
45+
if path:
46+
value = path
47+
dependency_name = ""
48+
sep = ""
49+
else:
50+
url = dependency_value.get("url")
51+
if url:
52+
value = url
53+
dependency_name = ""
54+
sep = ""
55+
else:
56+
raise Exception(
57+
f"Unsupported dependency specification: {dependency_name} = {dependency_value}"
58+
)
59+
60+
# markers - common for all
61+
markers = dependency_value.get("markers")
2262
if markers is not None:
2363
suffix = f";{markers}"
2464
else:
25-
version = version_value
65+
value = dependency_value
66+
sep = "=="
2667

27-
sep = "=="
28-
if version.startswith("^"):
68+
if value.startswith("^"):
2969
sep = ">="
30-
version = version[1:]
31-
elif version.startswith("~"):
70+
value = value[1:]
71+
elif value.startswith("~"):
3272
sep = "~="
33-
version = version[1:]
34-
return f"{dependency}~={version[1:]}"
35-
elif "<" in version or ">" in version:
73+
value = value[1:]
74+
return f"{dependency_name}~={value[1:]}"
75+
elif "<" in value or ">" in value:
3676
sep = ""
37-
version = version.replace(" ", "")
77+
value = value.replace(" ", "")
3878

39-
return f"{dependency}{sep}{version}{suffix}"
79+
return f"{dependency_name}{sep}{value}{suffix}"
4080

4181
dependencies: set[str] = {
4282
format_dependency_version(dependency, version)

0 commit comments

Comments
 (0)