Skip to content

Commit be58db6

Browse files
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
1 parent 12f2490 commit be58db6

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ for:
414414

415415
install:
416416
- . ci/common.sh
417-
- flutter upgrade --force
417+
- source ci/install_flutter.sh
418418

419419
build_script:
420420
# Flutter Web client

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-desktop/src/flet_desktop/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import zipfile
1010
from pathlib import Path
1111

12+
import flet_desktop
13+
import flet_desktop.version
1214
from flet.utils import (
1315
get_arch,
1416
is_linux,
@@ -18,9 +20,6 @@
1820
safe_tar_extractall,
1921
)
2022

21-
import flet_desktop
22-
import flet_desktop.version
23-
2423
logger = logging.getLogger(flet_desktop.__name__)
2524

2625

@@ -74,6 +73,7 @@ def __locate_and_unpack_flet_view(page_url, assets_dir, hidden):
7473

7574
# check if flet_view.exe exists in "bin" directory (user mode)
7675
flet_path = os.path.join(get_package_bin_dir(), "flet", flet_exe)
76+
logger.info(f"Looking for Flet executable at: {flet_path}")
7777
if os.path.exists(flet_path):
7878
logger.info(f"Flet View found in: {flet_path}")
7979
else:
@@ -109,6 +109,7 @@ def __locate_and_unpack_flet_view(page_url, assets_dir, hidden):
109109
# check if flet.tar.gz exists
110110
gz_filename = "flet-macos.tar.gz"
111111
tar_file = os.path.join(get_package_bin_dir(), gz_filename)
112+
logger.info(f"Looking for Flet.app archive at: {tar_file}")
112113
if not os.path.exists(tar_file):
113114
tar_file = __download_flet_client(gz_filename)
114115

@@ -145,6 +146,7 @@ def __locate_and_unpack_flet_view(page_url, assets_dir, hidden):
145146
# check if flet.tar.gz exists
146147
gz_filename = f"flet-linux-{get_arch()}.tar.gz"
147148
tar_file = os.path.join(get_package_bin_dir(), gz_filename)
149+
logger.info(f"Looking for Flet bundle archive at: {tar_file}")
148150
if not os.path.exists(tar_file):
149151
tar_file = __download_flet_client(gz_filename)
150152

0 commit comments

Comments
 (0)