flet-desktop 1.0.0.dev2__tar.gz → 1.0.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-desktop
3
- Version: 1.0.0.dev2
3
+ Version: 1.0.2
4
4
  Summary: Flet Desktop client in Flutter
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==1.0.0.dev2
12
+ Requires-Dist: flet==1.0.2
13
13
  Requires-Dist: rich>=13.0.0
14
14
 
15
15
  # Flet Desktop client in Flutter
@@ -18,3 +18,7 @@ Requires-Dist: rich>=13.0.0
18
18
  [![docstring coverage](https://flet.dev/docs/assets/badges/docs-coverage/flet-desktop.svg)](https://flet.dev/docs/assets/badges/docs-coverage/flet-desktop.svg)
19
19
 
20
20
  This package contains a compiled Flutter Flet desktop client.
21
+
22
+ > **[Try Flet online in Flet Studio](https://studio.flet.dev)**
23
+ >
24
+ > Try Flet in your browser with no installation, then bring your Python app to the desktop. Write your own Python code or get help from the AI agent.
@@ -4,3 +4,7 @@
4
4
  [![docstring coverage](https://flet.dev/docs/assets/badges/docs-coverage/flet-desktop.svg)](https://flet.dev/docs/assets/badges/docs-coverage/flet-desktop.svg)
5
5
 
6
6
  This package contains a compiled Flutter Flet desktop client.
7
+
8
+ > **[Try Flet online in Flet Studio](https://studio.flet.dev)**
9
+ >
10
+ > Try Flet in your browser with no installation, then bring your Python app to the desktop. Write your own Python code or get help from the AI agent.
@@ -1,13 +1,13 @@
1
1
  [project]
2
2
  name = "flet-desktop"
3
- version = "1.0.0.dev2"
3
+ version = "1.0.2"
4
4
  description = "Flet Desktop client in Flutter"
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==1.0.0.dev2",
10
+ "flet==1.0.2",
11
11
  "rich >=13.0.0"
12
12
  ]
13
13
 
@@ -399,6 +399,47 @@ def ensure_client_cached():
399
399
  return cache_dir
400
400
 
401
401
 
402
+ def find_macos_app_bundle(directory) -> Path | None:
403
+ """
404
+ Returns the first `.app` bundle directly inside `directory`.
405
+
406
+ Args:
407
+ directory: Directory to look in. It need not exist.
408
+
409
+ Returns:
410
+ Path to the bundle, or `None` when the directory is missing or holds
411
+ no `.app` — which lets a caller fall through to the next client
412
+ source instead of raising from a directory listing.
413
+ """
414
+ path = Path(directory)
415
+ if not path.is_dir():
416
+ return None
417
+
418
+ for name in sorted(os.listdir(path)):
419
+ if name.endswith(".app"):
420
+ return path.joinpath(name)
421
+ return None
422
+
423
+
424
+ def __log_build_client(build_dir: str, client_path: str | Path) -> None:
425
+ """
426
+ Reports that a client from a previous `flet build` is used instead of the
427
+ standard one.
428
+
429
+ Logged as a warning, so it is shown even without `flet run -v`: a client
430
+ built before an extension was added lacks that extension, and the app's
431
+ calls to it then time out without pointing at the client.
432
+
433
+ Args:
434
+ build_dir: The `build/<platform>` directory the client was found in.
435
+ client_path: The client executable or `.app` bundle that is launched.
436
+ """
437
+ logger.warning(
438
+ f"Using the Flet client from a previous `flet build`: {client_path}. "
439
+ f"Move, rename or delete {build_dir} to use the standard client."
440
+ )
441
+
442
+
402
443
  def __linux_identity_args(args: list) -> tuple:
403
444
  """
404
445
  Give the client window a per-app identity on Linux, without touching it.
@@ -489,9 +530,7 @@ async def open_flet_view_async(page_url, assets_dir, hidden):
489
530
  page_url, assets_dir, hidden
490
531
  )
491
532
  args, extra = __linux_identity_args(args)
492
- p = await asyncio.create_subprocess_exec(
493
- args[0], *args[1:], env=flet_env, **extra
494
- )
533
+ p = await asyncio.create_subprocess_exec(args[0], *args[1:], env=flet_env, **extra)
495
534
  __apply_taskbar_props(p.pid)
496
535
  return p, pid_file
497
536
 
@@ -584,6 +623,8 @@ def __locate_and_unpack_flet_view(page_url, assets_dir, hidden):
584
623
  for f in os.listdir(build_windows):
585
624
  if f.endswith(".exe"):
586
625
  flet_path = os.path.join(build_windows, f)
626
+ if flet_path:
627
+ __log_build_client(build_windows, flet_path)
587
628
 
588
629
  # 2. Check FLET_VIEW_PATH (developer mode)
589
630
  if not flet_path:
@@ -607,33 +648,33 @@ def __locate_and_unpack_flet_view(page_url, assets_dir, hidden):
607
648
  args = [flet_path, page_url, pid_file]
608
649
 
609
650
  elif is_macos():
610
- app_path = None
611
651
  # 1. Try loading Flet client built with the latest run of `flet build`
612
652
  build_macos = os.path.join(os.getcwd(), "build", "macos")
613
- if os.path.exists(build_macos):
614
- for f in os.listdir(build_macos):
615
- if f.endswith(".app"):
616
- app_path = os.path.join(build_macos, f)
653
+ app_path = find_macos_app_bundle(build_macos)
654
+ if app_path:
655
+ __log_build_client(build_macos, app_path)
617
656
 
618
657
  # 2. Check FLET_VIEW_PATH (developer mode)
619
658
  if not app_path:
620
659
  flet_view_path = os.environ.get("FLET_VIEW_PATH")
621
660
  if flet_view_path:
622
- logger.info(f"Flet.app is set via FLET_VIEW_PATH: {flet_view_path}")
623
- temp_flet_dir = Path(flet_view_path)
624
- else:
625
- # 3. Use cached or downloaded client
626
- temp_flet_dir = ensure_client_cached()
661
+ app_path = find_macos_app_bundle(flet_view_path)
662
+ if app_path:
663
+ logger.info(f"Flet.app is set via FLET_VIEW_PATH: {flet_view_path}")
664
+ else:
665
+ logger.warning(
666
+ f"FLET_VIEW_PATH set to {flet_view_path} "
667
+ f"but no .app bundle found there"
668
+ )
627
669
 
628
- app_name = None
629
- for f in os.listdir(temp_flet_dir):
630
- if f.endswith(".app"):
631
- app_name = f
632
- if app_name is None:
670
+ # 3. Use cached or downloaded client
671
+ if not app_path:
672
+ temp_flet_dir = ensure_client_cached()
673
+ app_path = find_macos_app_bundle(temp_flet_dir)
674
+ if not app_path:
633
675
  raise FileNotFoundError(
634
676
  f"Application bundle not found in {temp_flet_dir}"
635
677
  )
636
- app_path = temp_flet_dir.joinpath(app_name)
637
678
 
638
679
  logger.info(f"page_url: {page_url}")
639
680
  logger.info(f"pid_file: {pid_file}")
@@ -648,6 +689,8 @@ def __locate_and_unpack_flet_view(page_url, assets_dir, hidden):
648
689
  ef = os.path.join(build_linux, f)
649
690
  if os.path.isfile(ef) and stat.S_IXUSR & os.stat(ef)[stat.ST_MODE]:
650
691
  app_path = ef
692
+ if app_path:
693
+ __log_build_client(build_linux, app_path)
651
694
 
652
695
  # 2. Check FLET_VIEW_PATH (developer mode)
653
696
  if not app_path:
@@ -0,0 +1 @@
1
+ version = "1.0.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-desktop
3
- Version: 1.0.0.dev2
3
+ Version: 1.0.2
4
4
  Summary: Flet Desktop client in Flutter
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==1.0.0.dev2
12
+ Requires-Dist: flet==1.0.2
13
13
  Requires-Dist: rich>=13.0.0
14
14
 
15
15
  # Flet Desktop client in Flutter
@@ -18,3 +18,7 @@ Requires-Dist: rich>=13.0.0
18
18
  [![docstring coverage](https://flet.dev/docs/assets/badges/docs-coverage/flet-desktop.svg)](https://flet.dev/docs/assets/badges/docs-coverage/flet-desktop.svg)
19
19
 
20
20
  This package contains a compiled Flutter Flet desktop client.
21
+
22
+ > **[Try Flet online in Flet Studio](https://studio.flet.dev)**
23
+ >
24
+ > Try Flet in your browser with no installation, then bring your Python app to the desktop. Write your own Python code or get help from the AI agent.
@@ -0,0 +1,2 @@
1
+ flet==1.0.2
2
+ rich>=13.0.0
@@ -1 +0,0 @@
1
- version = "1.0.0.dev2"
@@ -1,2 +0,0 @@
1
- flet==1.0.0.dev2
2
- rich>=13.0.0