Skip to content

Commit dcf6f60

Browse files
committed
Bump Flet version to 0.18.0
Add check for module name
1 parent 9f97fdd commit dcf6f60

File tree

5 files changed

+39
-4
lines changed

5 files changed

+39
-4
lines changed

CHANGELOG.md

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

3+
# 0.18.0
4+
5+
* `flet build` command to package Flet app for any platform ([#2271](https://github.com/flet-dev/flet/issues/2271)).
6+
* Added TextStyle for the Text control ([#2270](https://github.com/flet-dev/flet/issues/2270)).
7+
* Refactor code, add Enum deprecation utils ([#2259](https://github.com/flet-dev/flet/issues/2259)).
8+
* `CupertinoAppBar` control ([#2278](https://github.com/flet-dev/flet/issues/2278)).
9+
* Fix AlertDialog content updating ([#2277](https://github.com/flet-dev/flet/issues/2277)).
10+
* Fix FLET_VIEW_PATH ignored on linux ([#2244](https://github.com/flet-dev/flet/issues/2244)).
11+
* `MenuBar`, `SubMenuButton` and `MenuItemButton` controls ([#2252](https://github.com/flet-dev/flet/issues/2252)).
12+
* convert 'key' to a super parameter ([#2258](https://github.com/flet-dev/flet/issues/2258)).
13+
314
# 0.17.0
415

516
* `SearchBar` control ([#2212](https://github.com/flet-dev/flet/issues/2212)).

client/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ packages:
183183
path: "../package"
184184
relative: true
185185
source: path
186-
version: "0.17.0"
186+
version: "0.18.0"
187187
flutter:
188188
dependency: "direct main"
189189
description: flutter

package/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# 0.18.0
2+
3+
* `flet build` command to package Flet app for any platform ([#2271](https://github.com/flet-dev/flet/issues/2271)).
4+
* Added TextStyle for the Text control ([#2270](https://github.com/flet-dev/flet/issues/2270)).
5+
* Refactor code, add Enum deprecation utils ([#2259](https://github.com/flet-dev/flet/issues/2259)).
6+
* `CupertinoAppBar` control ([#2278](https://github.com/flet-dev/flet/issues/2278)).
7+
* Fix AlertDialog content updating ([#2277](https://github.com/flet-dev/flet/issues/2277)).
8+
* Fix FLET_VIEW_PATH ignored on linux ([#2244](https://github.com/flet-dev/flet/issues/2244)).
9+
* `MenuBar`, `SubMenuButton` and `MenuItemButton` controls ([#2252](https://github.com/flet-dev/flet/issues/2252)).
10+
* convert 'key' to a super parameter ([#2258](https://github.com/flet-dev/flet/issues/2258)).
11+
112
# 0.17.0
213

314
* `SearchBar` control ([#2212](https://github.com/flet-dev/flet/issues/2212)).

package/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
5-
version: 0.17.0
5+
version: 0.18.0
66

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

sdk/python/packages/flet/src/flet/cli/commands/build.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ def add_arguments(self, parser: argparse.ArgumentParser) -> None:
225225
parser.add_argument(
226226
"--module-name",
227227
dest="module_name",
228+
default="main",
228229
help="python module name with an app entry point",
229230
)
230231
parser.add_argument(
@@ -266,6 +267,19 @@ def handle(self, options: argparse.Namespace) -> None:
266267
self.verbose = options.verbose
267268

268269
python_app_path = Path(options.python_app_path).resolve()
270+
if not os.path.exists(python_app_path) or not os.path.isdir(python_app_path):
271+
print(
272+
f"Path to Flet app does not exist or is not a directory: {python_app_path}"
273+
)
274+
sys.exit(1)
275+
276+
python_module_name = Path(options.module_name).stem
277+
python_module_filename = f"{python_module_name}.py"
278+
if not os.path.exists(os.path.join(python_app_path, python_module_filename)):
279+
print(
280+
f"{python_module_filename} not found in the root of Flet app directory. Use --module-name option to specify an entry point for your Flet app."
281+
)
282+
sys.exit(1)
269283

270284
self.flutter_dir = Path(tempfile.gettempdir()).joinpath(
271285
f"flet_flutter_build_{random_string(10)}"
@@ -298,8 +312,7 @@ def handle(self, options: argparse.Namespace) -> None:
298312
template_data["description"] = options.description
299313

300314
template_data["sep"] = os.sep
301-
if options.module_name:
302-
template_data["python_module_name"] = Path(options.module_name).stem
315+
template_data["python_module_name"] = python_module_name
303316
if options.product_name:
304317
template_data["product_name"] = options.product_name
305318
if options.org_name:

0 commit comments

Comments
 (0)