flet-cli 0.85.0.dev0__py3-none-any.whl → 0.85.0.dev2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- flet_cli/__pyinstaller/rthooks/pyi_rth_localhost_fletd.py +7 -0
- flet_cli/commands/build_base.py +31 -12
- flet_cli/commands/pack.py +48 -6
- flet_cli/version.py +1 -1
- {flet_cli-0.85.0.dev0.dist-info → flet_cli-0.85.0.dev2.dist-info}/METADATA +2 -2
- {flet_cli-0.85.0.dev0.dist-info → flet_cli-0.85.0.dev2.dist-info}/RECORD +9 -9
- {flet_cli-0.85.0.dev0.dist-info → flet_cli-0.85.0.dev2.dist-info}/WHEEL +0 -0
- {flet_cli-0.85.0.dev0.dist-info → flet_cli-0.85.0.dev2.dist-info}/entry_points.txt +0 -0
- {flet_cli-0.85.0.dev0.dist-info → flet_cli-0.85.0.dev2.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import os
|
|
3
|
+
import sys
|
|
3
4
|
|
|
4
5
|
logger = logging.getLogger("flet")
|
|
5
6
|
|
|
@@ -7,3 +8,9 @@ logger = logging.getLogger("flet")
|
|
|
7
8
|
logger.info("Running PyInstaller runtime hook for Flet...")
|
|
8
9
|
|
|
9
10
|
os.environ["FLET_SERVER_IP"] = "127.0.0.1"
|
|
11
|
+
|
|
12
|
+
# On Windows, set AppUserModelID so the taskbar associates the Flet client window
|
|
13
|
+
# with the parent executable (a PyInstaller bundle in this case) rather than the cached
|
|
14
|
+
# flet.exe. This ensures taskbar pins and shortcuts point to the correct executable.
|
|
15
|
+
if sys.platform == "win32" and "FLET_APP_USER_MODEL_ID" not in os.environ:
|
|
16
|
+
os.environ["FLET_APP_USER_MODEL_ID"] = os.path.abspath(sys.executable)
|
flet_cli/commands/build_base.py
CHANGED
|
@@ -2272,7 +2272,13 @@ class BaseBuildCommand(BaseFlutterCommand):
|
|
|
2272
2272
|
hash: HashStamp,
|
|
2273
2273
|
):
|
|
2274
2274
|
"""
|
|
2275
|
-
Find
|
|
2275
|
+
Find the best matching image file for the current target platform.
|
|
2276
|
+
|
|
2277
|
+
When multiple files share the same base name (e.g. `icon.icns`,
|
|
2278
|
+
`icon.ico`, `icon.png`), the method filters out formats that are
|
|
2279
|
+
incompatible with the build target before selecting the first match.
|
|
2280
|
+
For example, `.icns` is skipped on Windows builds because
|
|
2281
|
+
`flutter_launcher_icons` cannot decode it.
|
|
2276
2282
|
|
|
2277
2283
|
Args:
|
|
2278
2284
|
src_path: Source assets directory.
|
|
@@ -2285,17 +2291,30 @@ class BaseBuildCommand(BaseFlutterCommand):
|
|
|
2285
2291
|
File name of matched image, or `None` if not found.
|
|
2286
2292
|
"""
|
|
2287
2293
|
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2294
|
+
# .icns is macOS-only and .ico is Windows-only; filter out
|
|
2295
|
+
# incompatible formats so flutter_launcher_icons gets a decodable file.
|
|
2296
|
+
images = list(
|
|
2297
|
+
filter(
|
|
2298
|
+
lambda p: not (
|
|
2299
|
+
(ext := Path(p).suffix.lower()) == ".icns"
|
|
2300
|
+
and self.target_platform != "macos"
|
|
2301
|
+
or ext == ".ico"
|
|
2302
|
+
and self.target_platform != "windows"
|
|
2303
|
+
),
|
|
2304
|
+
glob.glob(str(src_path.joinpath(f"{image_name}.*"))),
|
|
2305
|
+
)
|
|
2306
|
+
)
|
|
2307
|
+
|
|
2308
|
+
if not images:
|
|
2309
|
+
return None
|
|
2310
|
+
|
|
2311
|
+
best = images[0]
|
|
2312
|
+
if self.verbose > 0:
|
|
2313
|
+
console.log(f'Found "{image_name}" image at {best}', style=verbose1_style)
|
|
2314
|
+
copy_ops.append((best, dest_path))
|
|
2315
|
+
hash.update(best)
|
|
2316
|
+
hash.update(Path(best).stat().st_mtime)
|
|
2317
|
+
return Path(best).name
|
|
2299
2318
|
|
|
2300
2319
|
def run(self, args, cwd, env: Optional[dict] = None, capture_output=True):
|
|
2301
2320
|
"""
|
flet_cli/commands/pack.py
CHANGED
|
@@ -2,10 +2,12 @@ import argparse
|
|
|
2
2
|
import os
|
|
3
3
|
import shutil
|
|
4
4
|
import sys
|
|
5
|
+
import tarfile
|
|
6
|
+
import zipfile
|
|
5
7
|
from pathlib import Path
|
|
6
8
|
|
|
7
9
|
import flet_cli.__pyinstaller.config as hook_config
|
|
8
|
-
from flet.utils import is_macos, is_windows
|
|
10
|
+
from flet.utils import is_linux, is_macos, is_windows
|
|
9
11
|
from flet_cli.commands.base import BaseCommand
|
|
10
12
|
|
|
11
13
|
|
|
@@ -152,6 +154,31 @@ class Command(BaseCommand):
|
|
|
152
154
|
help="Enable non-interactive mode. All prompts will be skipped",
|
|
153
155
|
)
|
|
154
156
|
|
|
157
|
+
def compress_flet_client_dir(self, temp_bin_dir: str, archive_name: str) -> None:
|
|
158
|
+
"""Compress the flet/ directory into an archive and remove the original.
|
|
159
|
+
|
|
160
|
+
Args:
|
|
161
|
+
temp_bin_dir: Path to the temporary directory containing the flet/
|
|
162
|
+
subdirectory with client binaries.
|
|
163
|
+
archive_name: Target archive filename. Uses zip for `.zip`
|
|
164
|
+
extensions and gzipped tar for everything else.
|
|
165
|
+
"""
|
|
166
|
+
flet_dir = os.path.join(temp_bin_dir, "flet")
|
|
167
|
+
if not os.path.isdir(flet_dir):
|
|
168
|
+
return
|
|
169
|
+
archive_path = os.path.join(temp_bin_dir, archive_name)
|
|
170
|
+
if archive_name.endswith(".zip"): # windows
|
|
171
|
+
with zipfile.ZipFile(archive_path, "w", zipfile.ZIP_DEFLATED) as zf:
|
|
172
|
+
for root, _dirs, files in os.walk(flet_dir):
|
|
173
|
+
for f in files:
|
|
174
|
+
full = os.path.join(root, f)
|
|
175
|
+
arcname = os.path.relpath(full, temp_bin_dir)
|
|
176
|
+
zf.write(full, arcname)
|
|
177
|
+
else:
|
|
178
|
+
with tarfile.open(archive_path, "w:gz") as tar:
|
|
179
|
+
tar.add(flet_dir, arcname="flet")
|
|
180
|
+
shutil.rmtree(flet_dir)
|
|
181
|
+
|
|
155
182
|
def handle(self, options: argparse.Namespace) -> None:
|
|
156
183
|
"""
|
|
157
184
|
Package the app into a standalone desktop artifact.
|
|
@@ -293,6 +320,12 @@ class Command(BaseCommand):
|
|
|
293
320
|
|
|
294
321
|
pyi_args.extend(["--version-file", version_info_path])
|
|
295
322
|
|
|
323
|
+
# Compress the patched flet/ directory into flet-windows.zip
|
|
324
|
+
# so ensure_client_cached() finds it at runtime.
|
|
325
|
+
self.compress_flet_client_dir(
|
|
326
|
+
hook_config.temp_bin_dir, "flet-windows.zip"
|
|
327
|
+
)
|
|
328
|
+
|
|
296
329
|
elif is_macos():
|
|
297
330
|
from flet_cli.__pyinstaller.macos_utils import (
|
|
298
331
|
assemble_app_bundle,
|
|
@@ -341,12 +374,12 @@ class Command(BaseCommand):
|
|
|
341
374
|
copyright=options.copyright,
|
|
342
375
|
)
|
|
343
376
|
|
|
344
|
-
#
|
|
377
|
+
# Compress the patched .app bundle back into flet-macos.tar.gz so
|
|
378
|
+
# ensure_client_cached() finds it at runtime.
|
|
345
379
|
assemble_app_bundle(app_path, tar_path)
|
|
346
380
|
|
|
347
|
-
# Remove everything except the tar.gz so
|
|
348
|
-
#
|
|
349
|
-
# framework binaries.
|
|
381
|
+
# Remove everything except the tar.gz so PyInstaller doesn't try
|
|
382
|
+
# to process loose framework binaries.
|
|
350
383
|
for entry in os.listdir(hook_config.temp_bin_dir):
|
|
351
384
|
entry_path = os.path.join(hook_config.temp_bin_dir, entry)
|
|
352
385
|
if entry_path == tar_path:
|
|
@@ -356,7 +389,16 @@ class Command(BaseCommand):
|
|
|
356
389
|
else:
|
|
357
390
|
os.remove(entry_path)
|
|
358
391
|
|
|
359
|
-
|
|
392
|
+
elif is_linux():
|
|
393
|
+
from flet_desktop import get_artifact_filename
|
|
394
|
+
|
|
395
|
+
# Compress the flet/ directory into a tar.gz
|
|
396
|
+
# so ensure_client_cached() finds it at runtime.
|
|
397
|
+
self.compress_flet_client_dir(
|
|
398
|
+
hook_config.temp_bin_dir, get_artifact_filename()
|
|
399
|
+
)
|
|
400
|
+
|
|
401
|
+
# run PyInstaller
|
|
360
402
|
print("Running PyInstaller:", pyi_args)
|
|
361
403
|
PyInstaller.__main__.run(pyi_args)
|
|
362
404
|
|
flet_cli/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version = "0.85.0.
|
|
1
|
+
version = "0.85.0.dev2"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flet-cli
|
|
3
|
-
Version: 0.85.0.
|
|
3
|
+
Version: 0.85.0.dev2
|
|
4
4
|
Summary: Flet CLI
|
|
5
5
|
Author-email: "Appveyor Systems Inc." <hello@flet.dev>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -9,7 +9,7 @@ Project-URL: Repository, https://github.com/flet-dev/flet
|
|
|
9
9
|
Project-URL: Documentation, https://flet.dev/docs
|
|
10
10
|
Requires-Python: >=3.10
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
|
-
Requires-Dist: flet==0.85.0.
|
|
12
|
+
Requires-Dist: flet==0.85.0.dev2
|
|
13
13
|
Requires-Dist: watchdog>=4.0.0
|
|
14
14
|
Requires-Dist: packaging>=25.0
|
|
15
15
|
Requires-Dist: qrcode>=7.4.2
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
flet_cli/cli.py,sha256=iDtpgVnrdrHapnE42bkTe7Sf_bNK724bqXISozNWTRQ,3586
|
|
2
|
-
flet_cli/version.py,sha256=
|
|
2
|
+
flet_cli/version.py,sha256=4qzS3nhbTRgnLWeZ2Qw2hfFPlngICuhRKPpuMcLFq70,24
|
|
3
3
|
flet_cli/__pyinstaller/__init__.py,sha256=KJsKpQ6uSVslADmFaOKaxCu-GOZZtcVKnti-ripD-ug,164
|
|
4
4
|
flet_cli/__pyinstaller/config.py,sha256=MN2IPu53K1RDyh_KE4wIcQH8El_n4Z3fD6NO2iq8y74,20
|
|
5
5
|
flet_cli/__pyinstaller/hook-flet.py,sha256=RbiFE8-7VBsY4Dwt7a9-9gW0gUFQGjOLY1-OBsZm_mI,506
|
|
6
6
|
flet_cli/__pyinstaller/macos_utils.py,sha256=4Y29CrZ5Uyys6CCLFEPq8qFmbTvV6wRU6A9hFiuYVSM,4423
|
|
7
7
|
flet_cli/__pyinstaller/utils.py,sha256=EbGuUIM1ce_Lc0VZlaJQ2WlSAahlgTLoMFDFigibImg,1316
|
|
8
8
|
flet_cli/__pyinstaller/win_utils.py,sha256=wu0G98CUMkGfloZa2LTqJE7axAZPB2-TLBOHJiYUc0Q,4428
|
|
9
|
-
flet_cli/__pyinstaller/rthooks/pyi_rth_localhost_fletd.py,sha256=
|
|
9
|
+
flet_cli/__pyinstaller/rthooks/pyi_rth_localhost_fletd.py,sha256=Q5r19b95nWjDdF-D6civD6_M8jzSDIi26WBHlVJOhdY,584
|
|
10
10
|
flet_cli/commands/base.py,sha256=6MTAuA7kKdaKIZI4AyWPM1TJfFCxmRj7kc7z2h6E_4k,3496
|
|
11
11
|
flet_cli/commands/build.py,sha256=lDqO-O9ug9Cy5gU2oGUYDhj9_m8E4mkaytzNHEwJwcA,5741
|
|
12
|
-
flet_cli/commands/build_base.py,sha256
|
|
12
|
+
flet_cli/commands/build_base.py,sha256=-39crXtLvcpFzxSSMgO2-oJW4KjoONPWOiv5bf0pa2o,88510
|
|
13
13
|
flet_cli/commands/create.py,sha256=LLgxC7Sbxhy9es21YS9nmR5oGOCJjsYDCdXWztIV44A,5305
|
|
14
14
|
flet_cli/commands/debug.py,sha256=7RhwJCKLVSf9_hunWGKd9vBnR9EgujCWmgs6aOzQVr4,6656
|
|
15
15
|
flet_cli/commands/devices.py,sha256=7kn56lrZLN5LuG_X3IyMdSfdFa421yE4R1otTJr5Yrc,7953
|
|
@@ -17,7 +17,7 @@ flet_cli/commands/doctor.py,sha256=uG2xUAT_FASB9cnLD9G83NTYdP9iuKhaHyQLjMB_E4c,1
|
|
|
17
17
|
flet_cli/commands/emulators.py,sha256=2VCpu-B70JMsmqNpQoDJoXAvOV-Ex_Kkosa27D16iRk,13215
|
|
18
18
|
flet_cli/commands/flutter_base.py,sha256=cvWrB_fWqb8wft7-Wr5isvOFxsgKgc0HcCHyK2IAe2w,17525
|
|
19
19
|
flet_cli/commands/options.py,sha256=tSqztnV4uvXhMEk6VhYe_szoq7CGVTrYlrkdZwMK4ek,1068
|
|
20
|
-
flet_cli/commands/pack.py,sha256=
|
|
20
|
+
flet_cli/commands/pack.py,sha256=xayvQpkKFDQvckPnxyahKYXbUpEfV8tUMEBn5y-orzk,16586
|
|
21
21
|
flet_cli/commands/publish.py,sha256=scTAR9fnjdPJz48EA42AcW2fYpHRgHkx3xP8b9Lg73o,11985
|
|
22
22
|
flet_cli/commands/run.py,sha256=uonKi-l40mHsN87E-nnDKq74q6o-565vhG05yOKlxek,16840
|
|
23
23
|
flet_cli/commands/serve.py,sha256=YrollC80u9JvuXHbI_qQ3wxpjcqpIQwFxdD5nIOeOT4,3143
|
|
@@ -32,8 +32,8 @@ flet_cli/utils/plist.py,sha256=oqBCkeUjUqPIf5y7XaE2seSx64FEs7yc2cukvbjFoSU,1135
|
|
|
32
32
|
flet_cli/utils/processes.py,sha256=S0ErmI5x9S6RNMe89cf5M4ROIofMtjNZRQ29foUllJ4,2885
|
|
33
33
|
flet_cli/utils/project_dependencies.py,sha256=kC8gZZyaGk-coNXrh6cyPM6i9RhUaXcBIvZmQ50PufY,4064
|
|
34
34
|
flet_cli/utils/pyproject_toml.py,sha256=o4fAWKXMyK8vdnAO41BLI7Lt3ohMlVdlwrpaifq30Cs,1408
|
|
35
|
-
flet_cli-0.85.0.
|
|
36
|
-
flet_cli-0.85.0.
|
|
37
|
-
flet_cli-0.85.0.
|
|
38
|
-
flet_cli-0.85.0.
|
|
39
|
-
flet_cli-0.85.0.
|
|
35
|
+
flet_cli-0.85.0.dev2.dist-info/METADATA,sha256=mECw5axns_48JFne-HdDa3NeaoagFHqUw6EUgMv5_S8,1214
|
|
36
|
+
flet_cli-0.85.0.dev2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
37
|
+
flet_cli-0.85.0.dev2.dist-info/entry_points.txt,sha256=UZFR426y3mfr0wgikEFPbZ6wtGwfgykif9Obw6R7Wnc,65
|
|
38
|
+
flet_cli-0.85.0.dev2.dist-info/top_level.txt,sha256=4_BPVAJpcNofDe3XMxajlZLBNWzWqKhRynNSBCYTKVQ,9
|
|
39
|
+
flet_cli-0.85.0.dev2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|