Skip to content

Commit

Permalink
Merge 0.25.2 into main (#4672)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
4 people authored Jan 9, 2025
1 parent 10be7d4 commit 8d6adca
Show file tree
Hide file tree
Showing 69 changed files with 180 additions and 108 deletions.
8 changes: 7 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ for:
provider: GitHub
auth_token: $(GITHUB_TOKEN)
release: $(APPVEYOR_REPO_TAG_NAME)
artifact: flet_windows
on:
APPVEYOR_REPO_TAG: true

Expand Down Expand Up @@ -510,3 +509,10 @@ for:
artifacts:
- path: sdk/python/packages/flet-cli/dist/*
- path: sdk/python/packages/flet/dist/*

deploy:
provider: GitHub
auth_token: $(GITHUB_TOKEN)
release: $(APPVEYOR_REPO_TAG_NAME)
on:
APPVEYOR_REPO_TAG: true
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Flet changelog

## 0.25.2

### Bug fixes

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

## 0.25.1

### Changes
Expand Down
13 changes: 13 additions & 0 deletions packages/flet/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 0.25.2

## Bug fixes

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

# 0.25.1

## Changes
Expand Down
10 changes: 5 additions & 5 deletions packages/flet/lib/src/utils/material_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class WidgetStateFromJSON<T> extends WidgetStateProperty<T?> {

// preserve user-defined order
_states = LinkedHashMap<String, T>.from(
jsonDictValue?.map((key, value) {
var normalizedKey = key.trim().toLowerCase();
// "" is now deprecated; use "default" instead
if (normalizedKey == "") normalizedKey = "default";
return MapEntry(normalizedKey, converterFromJson(value));
jsonDictValue?.map((k, v) {
var key = k.trim().toLowerCase();
// "" is deprecated and renamed to "default"
if (key == "") key = "default";
return MapEntry(key, converterFromJson(v));
}) ??
{},
);
Expand Down
2 changes: 1 addition & 1 deletion packages/flet/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet
description: Write entire Flutter app in Python or add server-driven UI experience into existing Flutter app.
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet
version: 0.25.1
version: 0.25.2

# This package supports all platforms listed below.
platforms:
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_ads/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_ads/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_ads
description: Flet Ads control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_ads
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_audio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_audio/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_audio
description: Flet Audio control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_audio
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_audio_recorder/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_audio_recorder/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_audio_recorder
description: Flet AudioRecorder control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_audio_recorder
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_flashlight/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_flashlight/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_flashlight
description: Flet Flashlight control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_flashlight
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_geolocator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_geolocator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_geolocator
description: Flet Geolocator control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_geolocator
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_lottie/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_lottie/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_lottie
description: Flet Lottie control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_lottie
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_map/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_map/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_map
description: Flet Map control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_map
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_permission_handler/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_permission_handler/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_permission_handler
description: Flet PermissionHandler control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_permission_handler
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_rive/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_rive/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_rive
description: Flet Rive control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_rive
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_video/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_video/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_video
description: Flet Video control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_video
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_webview/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_webview/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_webview
description: Flet WebView control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_webview
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@
bin_path = get_flet_bin_path()

if bin_path:
# package "bin/fletd" only
if os.getenv("PACKAGE_FLETD_ONLY"):
bin_path = os.path.join(bin_path, "fletd*")

datas = [(bin_path, "flet/bin")]
datas = [(bin_path, "flet_desktop/app")]
4 changes: 4 additions & 0 deletions sdk/python/packages/flet-cli/src/flet_cli/commands/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def add_arguments(self, parser: argparse.ArgumentParser) -> None:
)

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

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

if len(deps) == 0:
deps = [f"flet=={flet.version.version}"]

temp_reqs_txt = Path(tempfile.gettempdir()).joinpath(random_string(10))
with open(temp_reqs_txt, "w") as f:
f.writelines(dep + "\n" for dep in deps)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,69 @@ def get_poetry_dependencies(
if poetry_dependencies is None:
return None

def format_dependency_version(dependency: str, version_value: Any):
def format_dependency_version(dependency_name: str, dependency_value: Any):
sep = "@"
value = ""
suffix = ""
if isinstance(version_value, dict):
version = version_value["version"]
markers = version_value.get("markers")

if isinstance(dependency_value, dict):
version = dependency_value.get("version")
if version:
sep = "=="
value = version
else:
git_url = dependency_value.get("git")
if git_url:
value = (
f"git+{git_url}" if not git_url.startswith("git@") else git_url
)
rev = (
dependency_value.get("branch")
or dependency_value.get("rev")
or dependency_value.get("tag")
)
if rev:
value = f"{value}@{rev}"
subdirectory = dependency_value.get("subdirectory")
if subdirectory:
value = f"{value}#subdirectory={subdirectory}"
else:
path = dependency_value.get("path")
if path:
value = path
dependency_name = ""
sep = ""
else:
url = dependency_value.get("url")
if url:
value = url
dependency_name = ""
sep = ""
else:
raise Exception(
f"Unsupported dependency specification: {dependency_name} = {dependency_value}"
)

# markers - common for all
markers = dependency_value.get("markers")
if markers is not None:
suffix = f";{markers}"
else:
version = version_value
value = dependency_value
sep = "=="

sep = "=="
if version.startswith("^"):
if value.startswith("^"):
sep = ">="
version = version[1:]
elif version.startswith("~"):
value = value[1:]
elif value.startswith("~"):
sep = "~="
version = version[1:]
return f"{dependency}~={version[1:]}"
elif "<" in version or ">" in version:
value = value[1:]
return f"{dependency_name}~={value[1:]}"
elif "<" in value or ">" in value:
sep = ""
version = version.replace(" ", "")
value = value.replace(" ", "")

return f"{dependency}{sep}{version}{suffix}"
return f"{dependency_name}{sep}{value}{suffix}"

dependencies: set[str] = {
format_dependency_version(dependency, version)
Expand Down
Loading

0 comments on commit 8d6adca

Please sign in to comment.