Skip to content

Commit

Permalink
CLI version-related fixes and Flet 0.22.1 release notes (flet-dev#3148)
Browse files Browse the repository at this point in the history
* Fix `flet --version` command for source checkout

* Fix message

* update `file_picker` to 8.0.3

* Added logo in png

* Added `--exclude` option to `flet build` command

Close flet-dev#3125

* Flet version bumped to 0.22.1

* Fixed: OAuth expiry of token will hang fastapi server

Fix flet-dev#3150

* Update changelog

* Make `dependency_overrides` optional

Fix flet-dev#3187

* Updated changelog
  • Loading branch information
FeodorFitsner authored and 50Bytes-dev committed May 18, 2024
1 parent df1a167 commit e3e003b
Show file tree
Hide file tree
Showing 20 changed files with 114 additions and 31 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Flet changelog

# 0.22.1

* `AutoComplete` control ([#3003](https://github.com/flet-dev/flet/issues/3003))
* Added `--exclude` option to `flet build` command ([#3125](https://github.com/flet-dev/flet/issues/3125))
* `CupertinoTimePicker.alignment` property ([#3036](https://github.com/flet-dev/flet/issues/3036))
* Bump `file_picker` dependency to 8.0.3.
* Fix latest flet-build-template version in development mode ([#3021](https://github.com/flet-dev/flet/issues/3021))
* Fix `flet --version` command for source checkout.
* LineChart: fix regression ([#3033](https://github.com/flet-dev/flet/issues/3033))
* Fixed: OAuth expiry of token will hang fastapi server ([#3150](https://github.com/flet-dev/flet/issues/3150))
* Fixed: Disabled the dropwown, but the color isnot gray ([#2989](https://github.com/flet-dev/flet/issues/2989))
* Fixed: `pubspec.yaml` for adding custom Flutter packages requires `dependency_overrides` ([#3187](https://github.com/flet-dev/flet/issues/3187))
* Fixed `disabled` dropdown ([#3183](https://github.com/flet-dev/flet/issues/3183))
* Fixed default value for scrollbar thickness ([#3147](https://github.com/flet-dev/flet/issues/3147))
* Fixed: autoreload, restrict eventhandler from restart on open ([#3098](https://github.com/flet-dev/flet/issues/3098))
* Fixed ([#3035](https://github.com/flet-dev/flet/issues/3035)) switch Flutter RichText to Text.rich ([#3066](https://github.com/flet-dev/flet/issues/3066))

# 0.22.0

* Controls enhancement (see [#2882](https://github.com/flet-dev/flet/issues/2882) for details).
Expand Down
30 changes: 19 additions & 11 deletions client/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.1"
cross_file:
dependency: transitive
description:
name: cross_file
sha256: "55d7b444feb71301ef6b8838dbc1ae02e63dd48c8773f3810ff53bb1e2945b32"
url: "https://pub.dev"
source: hosted
version: "0.3.4+1"
crypto:
dependency: transitive
description:
Expand Down Expand Up @@ -197,10 +205,10 @@ packages:
dependency: transitive
description:
name: file_picker
sha256: "4e42aacde3b993c5947467ab640882c56947d9d27342a5b6f2895b23956954a6"
sha256: "29c90806ac5f5fb896547720b73b17ee9aed9bba540dc5d91fe29f8c5745b10a"
url: "https://pub.dev"
source: hosted
version: "6.1.1"
version: "8.0.3"
fixnum:
dependency: transitive
description:
Expand All @@ -223,49 +231,49 @@ packages:
path: "../packages/flet"
relative: true
source: path
version: "0.22.0"
version: "0.22.1"
flet_audio:
dependency: "direct main"
description:
path: "../packages/flet_audio"
relative: true
source: path
version: "0.22.0"
version: "0.22.1"
flet_audio_recorder:
dependency: "direct main"
description:
path: "../packages/flet_audio_recorder"
relative: true
source: path
version: "0.22.0"
version: "0.22.1"
flet_lottie:
dependency: "direct main"
description:
path: "../packages/flet_lottie"
relative: true
source: path
version: "0.22.0"
version: "0.22.1"
flet_rive:
dependency: "direct main"
description:
path: "../packages/flet_rive"
relative: true
source: path
version: "0.22.0"
version: "0.22.1"
flet_video:
dependency: "direct main"
description:
path: "../packages/flet_video"
relative: true
source: path
version: "0.22.0"
version: "0.22.1"
flet_webview:
dependency: "direct main"
description:
path: "../packages/flet_webview"
relative: true
source: path
version: "0.22.0"
version: "0.22.1"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -1158,10 +1166,10 @@ packages:
dependency: transitive
description:
name: web
sha256: "1d9158c616048c38f712a6646e317a3426da10e884447626167240d45209cbad"
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
url: "https://pub.dev"
source: hosted
version: "0.5.0"
version: "0.5.1"
web_socket_channel:
dependency: transitive
description:
Expand Down
Binary file added media/logo/flet-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions packages/flet/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# 0.22.1

* `AutoComplete` control ([#3003](https://github.com/flet-dev/flet/issues/3003))
* Added `--exclude` option to `flet build` command ([#3125](https://github.com/flet-dev/flet/issues/3125))
* `CupertinoTimePicker.alignment` property ([#3036](https://github.com/flet-dev/flet/issues/3036))
* Bump `file_picker` dependency to 8.0.3.
* Fix latest flet-build-template version in development mode ([#3021](https://github.com/flet-dev/flet/issues/3021))
* Fix `flet --version` command for source checkout.
* LineChart: fix regression ([#3033](https://github.com/flet-dev/flet/issues/3033))
* Fixed: OAuth expiry of token will hang fastapi server ([#3150](https://github.com/flet-dev/flet/issues/3150))
* Fixed: Disabled the dropwown, but the color isnot gray ([#2989](https://github.com/flet-dev/flet/issues/2989))
* Fixed: `pubspec.yaml` for adding custom Flutter packages requires `dependency_overrides` ([#3187](https://github.com/flet-dev/flet/issues/3187))
* Fixed `disabled` dropdown ([#3183](https://github.com/flet-dev/flet/issues/3183))
* Fixed default value for scrollbar thickness ([#3147](https://github.com/flet-dev/flet/issues/3147))
* Fixed: autoreload, restrict eventhandler from restart on open ([#3098](https://github.com/flet-dev/flet/issues/3098))
* Fixed ([#3035](https://github.com/flet-dev/flet/issues/3035)) switch Flutter RichText to Text.rich ([#3066](https://github.com/flet-dev/flet/issues/3066))

# 0.22.0

* Controls enhancement (see [#2882](https://github.com/flet-dev/flet/issues/2882) for details).
Expand Down
4 changes: 2 additions & 2 deletions 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.22.0
version: 0.22.1

# This package supports all platforms listed below.
platforms:
Expand Down Expand Up @@ -34,7 +34,7 @@ dependencies:
flutter_highlight: ^0.7.0
highlight: ^0.7.0
markdown: ^7.1.1
file_picker: ^8.0.0+1
file_picker: ^8.0.3
shared_preferences: ^2.0.15
flutter_svg: ^2.0.9
window_to_front: ^0.0.3
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.22.1

No changes in this release. Version bumped to follow parent `flet` package.

# 0.22.0

No changes in this release. Version bumped to follow 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.22.0
version: 0.22.1

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.22.1

No changes in this release. Version bumped to follow parent `flet` package.

# 0.22.0

No changes in this release. Version bumped to follow 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.22.0
version: 0.22.1

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.22.1

No changes in this release. Version bumped to follow parent `flet` package.

# 0.22.0

No changes in this release. Version bumped to follow 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.22.0
version: 0.22.1

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.22.1

No changes in this release. Version bumped to follow parent `flet` package.

# 0.22.0

Initial release of the package.
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.22.0
version: 0.22.1

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.22.1

No changes in this release. Version bumped to follow parent `flet` package.

# 0.22.0

No changes in this release. Version bumped to follow 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.22.0
version: 0.22.1

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.22.1

No changes in this release. Version bumped to follow parent `flet` package.

# 0.22.0

No changes in this release. Version bumped to follow 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.22.0
version: 0.22.1

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
7 changes: 6 additions & 1 deletion sdk/python/packages/flet/src/flet/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import flet.cli.commands.publish
import flet.cli.commands.run
import flet.version
from flet.version import update_version


# Source https://stackoverflow.com/a/26379693
Expand Down Expand Up @@ -60,7 +61,11 @@ def set_default_subparser(self, name, args=None, positional_args=0):

def main():
parser = argparse.ArgumentParser()
parser.add_argument("--version", action="version", version=flet.version.version)
parser.add_argument(
"--version",
action="version",
version=flet.version.version if flet.version.version else update_version(),
)
sp = parser.add_subparsers(dest="command")
# sp.default = "run"

Expand Down
28 changes: 20 additions & 8 deletions sdk/python/packages/flet/src/flet/cli/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
from pathlib import Path
from typing import Optional

import flet.version
import yaml
from flet.cli.commands.base import BaseCommand
from flet.version import update_version
from flet_core.utils import random_string, slugify
from flet_runtime.utils import calculate_file_hash, copy_tree, is_windows
from packaging import version
from rich import print

import flet.version
from flet.cli.commands.base import BaseCommand
from flet.version import update_version

if is_windows():
from ctypes import windll

Expand Down Expand Up @@ -104,6 +103,13 @@ def add_arguments(self, parser: argparse.ArgumentParser) -> None:
default=".",
help="path to a directory with a Python program",
)
parser.add_argument(
"--exclude",
dest="exclude",
nargs="+",
default=[],
help="exclude files and directories from a Python app package",
)
parser.add_argument(
"-o",
"--output",
Expand Down Expand Up @@ -397,7 +403,7 @@ def handle(self, options: argparse.Namespace) -> None:

# create Flutter project from a template
print(
f"Creating Flutter bootstrap project from {template_url} with ref {template_ref} ... ",
f"Creating Flutter bootstrap project from {template_url} with ref {template_ref}...",
end="",
)
try:
Expand All @@ -423,7 +429,7 @@ def handle(self, options: argparse.Namespace) -> None:
for k, v in flutter_dependencies.items():
pubspec["dependencies"][k] = v

if src_pubspec and src_pubspec["dependency_overrides"]:
if src_pubspec and "dependency_overrides" in src_pubspec:
pubspec["dependency_overrides"] = {}
for k, v in src_pubspec["dependency_overrides"].items():
pubspec["dependency_overrides"][k] = v
Expand Down Expand Up @@ -635,6 +641,11 @@ def fallback_image(yaml_path: str, images: list):

print("[spring_green3]OK[/spring_green3]")

exclude_list = ["build"]

if options.exclude:
exclude_list.extend(options.exclude)

# package Python app
print(f"Packaging Python app...", end="")
package_args = [
Expand All @@ -646,6 +657,7 @@ def fallback_image(yaml_path: str, images: list):
]
if target_platform == "web":
pip_platform, find_links_path = self.create_pyodide_find_links()
exclude_list.append("assets")
package_args.extend(
[
"--web",
Expand All @@ -658,7 +670,7 @@ def fallback_image(yaml_path: str, images: list):
"--find-links",
find_links_path,
"--exclude",
"assets,build",
",".join(exclude_list),
]
)
else:
Expand All @@ -677,7 +689,7 @@ def fallback_image(yaml_path: str, images: list):
"--req-deps",
"flet-embed",
"--exclude",
"build",
",".join(exclude_list),
]
)

Expand Down
6 changes: 3 additions & 3 deletions sdk/python/packages/flet/src/flet/fastapi/flet_app_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ async def __evict_expired_oauth_states(self):
and datetime.now(timezone.utc) > state.expires_at
):
ids.append(id)
for id in ids:
logger.info(f"Delete expired oauth state: {id}")
self.retrieve_state(id)
for id in ids:
logger.info(f"Delete expired oauth state: {id}")
self.retrieve_state(id)

def delete_temp_dirs(self):
for temp_dir in self.__temp_dirs.keys():
Expand Down

0 comments on commit e3e003b

Please sign in to comment.