flet-cli 0.85.0.dev0__tar.gz → 0.85.0.dev2__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 (48) hide show
  1. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/PKG-INFO +2 -2
  2. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/pyproject.toml +2 -2
  3. flet_cli-0.85.0.dev2/src/flet_cli/__pyinstaller/rthooks/pyi_rth_localhost_fletd.py +16 -0
  4. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/commands/build_base.py +31 -12
  5. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/commands/pack.py +48 -6
  6. flet_cli-0.85.0.dev2/src/flet_cli/version.py +1 -0
  7. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli.egg-info/PKG-INFO +2 -2
  8. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli.egg-info/requires.txt +1 -1
  9. flet_cli-0.85.0.dev0/src/flet_cli/__pyinstaller/rthooks/pyi_rth_localhost_fletd.py +0 -9
  10. flet_cli-0.85.0.dev0/src/flet_cli/version.py +0 -1
  11. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/README.md +0 -0
  12. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/setup.cfg +0 -0
  13. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/__pyinstaller/__init__.py +0 -0
  14. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/__pyinstaller/config.py +0 -0
  15. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/__pyinstaller/hook-flet.py +0 -0
  16. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/__pyinstaller/macos_utils.py +0 -0
  17. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/__pyinstaller/utils.py +0 -0
  18. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/__pyinstaller/win_utils.py +0 -0
  19. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/cli.py +0 -0
  20. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/commands/base.py +0 -0
  21. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/commands/build.py +0 -0
  22. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/commands/create.py +0 -0
  23. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/commands/debug.py +0 -0
  24. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/commands/devices.py +0 -0
  25. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/commands/doctor.py +0 -0
  26. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/commands/emulators.py +0 -0
  27. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/commands/flutter_base.py +0 -0
  28. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/commands/options.py +0 -0
  29. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/commands/publish.py +0 -0
  30. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/commands/run.py +0 -0
  31. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/commands/serve.py +0 -0
  32. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/utils/android_sdk.py +0 -0
  33. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/utils/cli.py +0 -0
  34. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/utils/distros.py +0 -0
  35. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/utils/flutter.py +0 -0
  36. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/utils/hash_stamp.py +0 -0
  37. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/utils/jdk.py +0 -0
  38. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/utils/merge.py +0 -0
  39. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/utils/plist.py +0 -0
  40. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/utils/processes.py +0 -0
  41. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/utils/project_dependencies.py +0 -0
  42. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli/utils/pyproject_toml.py +0 -0
  43. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli.egg-info/SOURCES.txt +0 -0
  44. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli.egg-info/dependency_links.txt +0 -0
  45. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli.egg-info/entry_points.txt +0 -0
  46. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/src/flet_cli.egg-info/top_level.txt +0 -0
  47. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/tests/test_plist.py +0 -0
  48. {flet_cli-0.85.0.dev0 → flet_cli-0.85.0.dev2}/tests/test_project_dependencies.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-cli
3
- Version: 0.85.0.dev0
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.dev0
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,13 +1,13 @@
1
1
  [project]
2
2
  name = "flet-cli"
3
- version = "0.85.0.dev0"
3
+ version = "0.85.0.dev2"
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.85.0.dev0",
10
+ "flet==0.85.0.dev2",
11
11
  "watchdog >=4.0.0",
12
12
  "packaging >=25.0",
13
13
  "qrcode >=7.4.2",
@@ -0,0 +1,16 @@
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 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)
@@ -2272,7 +2272,13 @@ class BaseBuildCommand(BaseFlutterCommand):
2272
2272
  hash: HashStamp,
2273
2273
  ):
2274
2274
  """
2275
- Find first matching image file by base name and queue it for copy.
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
- images = glob.glob(str(src_path.joinpath(f"{image_name}.*")))
2289
- if len(images) > 0:
2290
- if self.verbose > 0:
2291
- console.log(
2292
- f'Found "{image_name}" image at {images[0]}', style=verbose1_style
2293
- )
2294
- copy_ops.append((images[0], dest_path))
2295
- hash.update(images[0])
2296
- hash.update(Path(images[0]).stat().st_mtime)
2297
- return Path(images[0]).name
2298
- return None
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
  """
@@ -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
- # assemble
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
- # PyInstaller doesn't try to process loose
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
- # run PyInstaller!
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
 
@@ -0,0 +1 @@
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.dev0
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.dev0
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,4 +1,4 @@
1
- flet==0.85.0.dev0
1
+ flet==0.85.0.dev2
2
2
  watchdog>=4.0.0
3
3
  packaging>=25.0
4
4
  qrcode>=7.4.2
@@ -1,9 +0,0 @@
1
- import logging
2
- import os
3
-
4
- logger = logging.getLogger("flet")
5
-
6
-
7
- logger.info("Running PyInstaller runtime hook for Flet...")
8
-
9
- os.environ["FLET_SERVER_IP"] = "127.0.0.1"
@@ -1 +0,0 @@
1
- version = "0.85.0.dev0"
File without changes
File without changes