flet-cli 0.86.4__tar.gz → 1.0.0.dev0__tar.gz

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.
Files changed (77) hide show
  1. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/PKG-INFO +3 -2
  2. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/pyproject.toml +6 -2
  3. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/__pyinstaller/macos_utils.py +14 -3
  4. flet_cli-1.0.0.dev0/src/flet_cli/__pyinstaller/rthooks/pyi_rth_localhost_fletd.py +52 -0
  5. flet_cli-1.0.0.dev0/src/flet_cli/__pyinstaller/rthooks.dat +5 -0
  6. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/__pyinstaller/utils.py +19 -0
  7. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/cli.py +5 -1
  8. flet_cli-1.0.0.dev0/src/flet_cli/commands/build.py +905 -0
  9. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/commands/build_base.py +913 -451
  10. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/commands/create.py +10 -3
  11. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/commands/flutter_base.py +5 -4
  12. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/commands/pack.py +239 -15
  13. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/commands/publish.py +37 -16
  14. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/commands/run.py +62 -18
  15. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/commands/test.py +20 -1
  16. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/utils/android_sdk.py +2 -1
  17. flet_cli-1.0.0.dev0/src/flet_cli/utils/cli.py +44 -0
  18. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/utils/hash_stamp.py +14 -0
  19. flet_cli-1.0.0.dev0/src/flet_cli/utils/ios_sign.py +142 -0
  20. flet_cli-1.0.0.dev0/src/flet_cli/utils/macos_sign.py +1320 -0
  21. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/utils/python_versions.py +1 -1
  22. flet_cli-1.0.0.dev0/src/flet_cli/version.py +1 -0
  23. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli.egg-info/PKG-INFO +3 -2
  24. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli.egg-info/SOURCES.txt +14 -0
  25. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli.egg-info/requires.txt +2 -1
  26. flet_cli-1.0.0.dev0/tests/test_build_icons.py +42 -0
  27. flet_cli-1.0.0.dev0/tests/test_build_ios.py +254 -0
  28. flet_cli-1.0.0.dev0/tests/test_build_linux.py +481 -0
  29. flet_cli-1.0.0.dev0/tests/test_build_macos_signing.py +450 -0
  30. flet_cli-1.0.0.dev0/tests/test_build_splash.py +561 -0
  31. flet_cli-1.0.0.dev0/tests/test_build_template.py +107 -0
  32. flet_cli-1.0.0.dev0/tests/test_create.py +104 -0
  33. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/tests/test_find_platform_image.py +10 -21
  34. flet_cli-1.0.0.dev0/tests/test_flutter.py +164 -0
  35. flet_cli-1.0.0.dev0/tests/test_macos_sign.py +1392 -0
  36. flet_cli-1.0.0.dev0/tests/test_run_assets_dir.py +81 -0
  37. flet_cli-1.0.0.dev0/tests/test_run_desktop_dependency.py +252 -0
  38. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/tests/test_run_script_args.py +29 -0
  39. flet_cli-0.86.4/src/flet_cli/__pyinstaller/rthooks/pyi_rth_localhost_fletd.py +0 -16
  40. flet_cli-0.86.4/src/flet_cli/commands/build.py +0 -209
  41. flet_cli-0.86.4/src/flet_cli/utils/cli.py +0 -8
  42. flet_cli-0.86.4/src/flet_cli/version.py +0 -1
  43. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/README.md +0 -0
  44. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/setup.cfg +0 -0
  45. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/__pyinstaller/__init__.py +0 -0
  46. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/__pyinstaller/config.py +0 -0
  47. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/__pyinstaller/hook-flet.py +0 -0
  48. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/__pyinstaller/win_utils.py +0 -0
  49. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/commands/base.py +0 -0
  50. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/commands/clean.py +0 -0
  51. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/commands/debug.py +0 -0
  52. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/commands/devices.py +0 -0
  53. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/commands/doctor.py +0 -0
  54. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/commands/emulators.py +0 -0
  55. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/commands/mcp.py +0 -0
  56. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/commands/options.py +0 -0
  57. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/commands/serve.py +0 -0
  58. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/commands/test_host.py +0 -0
  59. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/utils/android.py +0 -0
  60. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/utils/distros.py +0 -0
  61. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/utils/flutter.py +0 -0
  62. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/utils/jdk.py +0 -0
  63. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/utils/linux_deps.py +0 -0
  64. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/utils/merge.py +0 -0
  65. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/utils/plist.py +0 -0
  66. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/utils/processes.py +0 -0
  67. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/utils/project_dependencies.py +0 -0
  68. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/utils/pyodide.py +0 -0
  69. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/utils/pyproject_toml.py +0 -0
  70. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli/utils/template_cache.py +0 -0
  71. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli.egg-info/dependency_links.txt +0 -0
  72. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli.egg-info/entry_points.txt +0 -0
  73. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/src/flet_cli.egg-info/top_level.txt +0 -0
  74. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/tests/test_clean.py +0 -0
  75. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/tests/test_plist.py +0 -0
  76. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/tests/test_project_dependencies.py +0 -0
  77. {flet_cli-0.86.4 → flet_cli-1.0.0.dev0}/tests/test_python_versions.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-cli
3
- Version: 0.86.4
3
+ Version: 1.0.0.dev0
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,8 @@ 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.86.4
12
+ Requires-Dist: flet==1.0.0.dev0
13
+ Requires-Dist: flet-platform-assets==1.0.0.dev0
13
14
  Requires-Dist: watchdog>=4.0.0
14
15
  Requires-Dist: packaging>=25.0
15
16
  Requires-Dist: qrcode>=7.4.2
@@ -1,13 +1,14 @@
1
1
  [project]
2
2
  name = "flet-cli"
3
- version = "0.86.4"
3
+ version = "1.0.0.dev0"
4
4
  description = "Flet CLI"
5
5
  authors = [{ name = "Appveyor Systems Inc.", email = "hello@flet.dev" }]
6
6
  license = "Apache-2.0"
7
7
  readme = "README.md"
8
8
  requires-python = ">=3.10"
9
9
  dependencies = [
10
- "flet==0.86.4",
10
+ "flet==1.0.0.dev0",
11
+ "flet-platform-assets==1.0.0.dev0",
11
12
  "watchdog >=4.0.0",
12
13
  "packaging >=25.0",
13
14
  "qrcode >=7.4.2",
@@ -29,6 +30,9 @@ Documentation = "https://flet.dev/docs"
29
30
  [project.entry-points."pyinstaller40"]
30
31
  hook-dirs = "flet_cli.__pyinstaller:get_hook_dirs"
31
32
 
33
+ [tool.setuptools.package-data]
34
+ "flet_cli.__pyinstaller" = ["rthooks.dat", "rthooks/*.py"]
35
+
32
36
  [build-system]
33
37
  requires = ["setuptools"]
34
38
  build-backend = "setuptools.build_meta"
@@ -1,3 +1,4 @@
1
+ import gzip
1
2
  import os
2
3
  import plistlib
3
4
  import shutil
@@ -8,6 +9,7 @@ from pathlib import Path
8
9
  from PyInstaller.building.icon import normalize_icon_type
9
10
 
10
11
  from flet.utils import safe_tar_extractall
12
+ from flet_cli.__pyinstaller.utils import normalize_tar_entry
11
13
 
12
14
 
13
15
  def unpack_app_bundle(tar_path):
@@ -143,9 +145,18 @@ def assemble_app_bundle(app_path, tar_path):
143
145
  f"error code {p.returncode}!\noutput: {p.stdout}"
144
146
  )
145
147
 
146
- # pack tar
147
- with tarfile.open(tar_path, "w:gz") as tar:
148
- tar.add(app_path, arcname=os.path.basename(app_path))
148
+ # Pack tar with fixed timestamps, so archives of identical content are
149
+ # byte-identical and the runtime cache fingerprint stays stable
150
+ with (
151
+ open(tar_path, "wb") as raw,
152
+ gzip.GzipFile(fileobj=raw, mode="wb", mtime=0) as gz,
153
+ tarfile.open(fileobj=gz, mode="w") as tar,
154
+ ):
155
+ tar.add(
156
+ app_path,
157
+ arcname=os.path.basename(app_path),
158
+ filter=normalize_tar_entry,
159
+ )
149
160
 
150
161
  # cleanup
151
162
  shutil.rmtree(app_path, ignore_errors=True)
@@ -0,0 +1,52 @@
1
+ import logging
2
+ import os
3
+ import sys
4
+
5
+ logger = logging.getLogger("flet")
6
+
7
+
8
+ logger.info("Running PyInstaller runtime hook for Flet...")
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
14
+ # cached flet.exe. flet_desktop additionally stamps this ID and the relaunch
15
+ # properties below onto the client window (see flet_desktop.win_taskbar) so the
16
+ # taskbar name, icon, jump list and pins all resolve to the bundle exe.
17
+ if sys.platform == "win32" and "FLET_APP_USER_MODEL_ID" not in os.environ:
18
+ exe_path = os.path.abspath(sys.executable)
19
+ os.environ["FLET_APP_USER_MODEL_ID"] = exe_path
20
+ os.environ.setdefault("FLET_APP_RELAUNCH_COMMAND", f'"{exe_path}"')
21
+ os.environ.setdefault(
22
+ "FLET_APP_RELAUNCH_DISPLAY_NAME",
23
+ os.path.splitext(os.path.basename(exe_path))[0],
24
+ )
25
+ os.environ.setdefault("FLET_APP_RELAUNCH_ICON", f"{exe_path},0")
26
+
27
+
28
+ # On Linux the taskbar keys on the window's WM_CLASS (X11) or app_id
29
+ # (Wayland), both of which GTK takes from the client binary's argv[0]. That
30
+ # binary is the shared, prebuilt `flet`, so every packed app shows up as
31
+ # "flet". flet_desktop relaunches it under this id instead -- the bundle's
32
+ # own name -- so the app groups and labels as itself, and can be matched by
33
+ # a desktop entry carrying StartupWMClass.
34
+ if sys.platform.startswith("linux") and "FLET_APP_ID" not in os.environ:
35
+ # --bundle-id when it was given, so the identity matches what `flet build`
36
+ # uses and what a desktop entry's StartupWMClass would name. Otherwise the
37
+ # executable's own name, which reads better bare than a reverse-DNS id and
38
+ # follows the binary if it is renamed.
39
+ app_id = ""
40
+ meipass = getattr(sys, "_MEIPASS", None)
41
+ if meipass:
42
+ try:
43
+ with open(os.path.join(meipass, "flet_app_id"), encoding="utf-8") as f:
44
+ app_id = f.read().strip()
45
+ except OSError:
46
+ pass
47
+ # No splitext here: a Linux executable has no extension, so it would eat
48
+ # whatever follows the last dot in the app's own name -- turning
49
+ # `myapp-1.2.3` into `myapp-1.2`, which then matches no desktop entry.
50
+ os.environ["FLET_APP_ID"] = (
51
+ app_id or os.path.basename(os.path.abspath(sys.executable)).strip()
52
+ )
@@ -0,0 +1,5 @@
1
+ {
2
+ 'flet': [
3
+ 'pyi_rth_localhost_fletd.py'
4
+ ],
5
+ }
@@ -1,4 +1,5 @@
1
1
  import os
2
+ import tarfile
2
3
  import tempfile
3
4
  import uuid
4
5
  from pathlib import Path
@@ -33,6 +34,24 @@ def get_flet_bin_path():
33
34
  return None
34
35
 
35
36
 
37
+ def normalize_tar_entry(tarinfo: tarfile.TarInfo) -> tarfile.TarInfo:
38
+ """
39
+ Normalize a tar entry's metadata (mtime, owner) so that archives built
40
+ from identical content are byte-identical across builds.
41
+
42
+ Args:
43
+ tarinfo: Entry to normalize, as passed by `tarfile.TarFile.add`.
44
+
45
+ Returns:
46
+ The same entry, with mtime and ownership zeroed.
47
+ """
48
+
49
+ tarinfo.mtime = 0
50
+ tarinfo.uid = tarinfo.gid = 0
51
+ tarinfo.uname = tarinfo.gname = ""
52
+ return tarinfo
53
+
54
+
36
55
  def copy_flet_bin():
37
56
  """
38
57
  Copy packaged Flet desktop binaries into a temporary directory.
@@ -16,6 +16,7 @@ import flet_cli.commands.publish
16
16
  import flet_cli.commands.run
17
17
  import flet_cli.commands.serve
18
18
  import flet_cli.commands.test
19
+ from flet_cli.utils.cli import quote_for_shell
19
20
  from flet_cli.utils.linux_deps import linux_dependencies
20
21
 
21
22
 
@@ -184,10 +185,13 @@ def parse_command_line(argv: list) -> argparse.Namespace:
184
185
  if unrecognized:
185
186
  message = f"unrecognized arguments: {' '.join(unrecognized)}"
186
187
  if getattr(args, "command", None) == "run":
188
+ # The example is meant to be pasted, so both the script path and
189
+ # the arguments being forwarded have to survive the shell.
190
+ forwarded = " ".join(quote_for_shell(arg) for arg in unrecognized)
187
191
  message += (
188
192
  "\nIf these are arguments for your app script, put them after "
189
193
  "a `--` separator, e.g. "
190
- f"`flet run {args.script} -- {' '.join(unrecognized)}`"
194
+ f"`flet run {quote_for_shell(args.script)} -- {forwarded}`"
191
195
  )
192
196
  parser.error(message)
193
197