flet-desktop-light 0.26.0.dev3957__py3-none-musllinux_1_2_x86_64.whl → 0.26.0.dev3997__py3-none-musllinux_1_2_x86_64.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_desktop/__init__.py CHANGED
@@ -2,6 +2,7 @@ import asyncio
2
2
  import logging
3
3
  import os
4
4
  import signal
5
+ import stat
5
6
  import subprocess
6
7
  import tarfile
7
8
  import tempfile
@@ -66,98 +67,129 @@ def __locate_and_unpack_flet_view(page_url, assets_dir, hidden):
66
67
  pid_file = str(Path(tempfile.gettempdir()).joinpath(random_string(20)))
67
68
 
68
69
  if is_windows():
69
- flet_exe = "flet.exe"
70
- temp_flet_dir = Path.home().joinpath(
71
- ".flet", "bin", f"flet-{flet_desktop.version.version}"
72
- )
73
-
74
- # check if flet_view.exe exists in "bin" directory (user mode)
75
- flet_path = os.path.join(get_package_bin_dir(), "flet", flet_exe)
76
- logger.info(f"Looking for Flet executable at: {flet_path}")
77
- if os.path.exists(flet_path):
78
- logger.info(f"Flet View found in: {flet_path}")
79
- else:
70
+ flet_path = None
71
+ # try loading Flet client built with the latest run of `flet build`
72
+ build_windows = os.path.join(os.getcwd(), "build", "windows")
73
+ if os.path.exists(build_windows):
74
+ for f in os.listdir(build_windows):
75
+ if f.endswith(".exe"):
76
+ flet_path = os.path.join(build_windows, f)
77
+
78
+ if not flet_path:
79
+ flet_exe = "flet.exe"
80
+ temp_flet_dir = Path.home().joinpath(
81
+ ".flet", "bin", f"flet-{flet_desktop.version.version}"
82
+ )
83
+
84
+ # check if flet_view.exe exists in "bin" directory (user mode)
85
+ flet_path = os.path.join(get_package_bin_dir(), "flet", flet_exe)
86
+ logger.info(f"Looking for Flet executable at: {flet_path}")
87
+ if os.path.exists(flet_path):
88
+ logger.info(f"Flet View found in: {flet_path}")
89
+ else:
90
+ # check if flet.exe is in FLET_VIEW_PATH (flet developer mode)
91
+ flet_path = os.environ.get("FLET_VIEW_PATH")
92
+ if flet_path and os.path.exists(flet_path):
93
+ logger.info(f"Flet View found in PATH: {flet_path}")
94
+ flet_path = os.path.join(flet_path, flet_exe)
95
+ else:
96
+ if not temp_flet_dir.exists():
97
+ zip_file = __download_flet_client("flet-windows.zip")
98
+
99
+ logger.info(
100
+ f"Extracting flet.exe from archive to {temp_flet_dir}"
101
+ )
102
+ temp_flet_dir.mkdir(parents=True, exist_ok=True)
103
+ with zipfile.ZipFile(zip_file, "r") as zip_arch:
104
+ zip_arch.extractall(str(temp_flet_dir))
105
+ flet_path = str(temp_flet_dir.joinpath("flet", flet_exe))
106
+ args = [flet_path, page_url, pid_file]
107
+ elif is_macos():
108
+ app_path = None
109
+ # try loading Flet client built with the latest run of `flet build`
110
+ build_macos = os.path.join(os.getcwd(), "build", "macos")
111
+ if os.path.exists(build_macos):
112
+ for f in os.listdir(build_macos):
113
+ if f.endswith(".app"):
114
+ app_path = os.path.join(build_macos, f)
115
+
116
+ if not app_path:
117
+ # build version-specific path to Flet.app
118
+ temp_flet_dir = Path.home().joinpath(
119
+ ".flet", "bin", f"flet-{flet_desktop.version.version}"
120
+ )
121
+
80
122
  # check if flet.exe is in FLET_VIEW_PATH (flet developer mode)
81
123
  flet_path = os.environ.get("FLET_VIEW_PATH")
82
- if flet_path and os.path.exists(flet_path):
83
- logger.info(f"Flet View found in PATH: {flet_path}")
84
- flet_path = os.path.join(flet_path, flet_exe)
124
+ if flet_path:
125
+ logger.info(f"Flet.app is set via FLET_VIEW_PATH: {flet_path}")
126
+ temp_flet_dir = Path(flet_path)
85
127
  else:
128
+ # check if flet_view.app exists in a temp directory
86
129
  if not temp_flet_dir.exists():
87
- zip_file = __download_flet_client("flet-windows.zip")
88
-
89
- logger.info(f"Extracting flet.exe from archive to {temp_flet_dir}")
130
+ # check if flet.tar.gz exists
131
+ gz_filename = "flet-macos.tar.gz"
132
+ tar_file = os.path.join(get_package_bin_dir(), gz_filename)
133
+ logger.info(f"Looking for Flet.app archive at: {tar_file}")
134
+ if not os.path.exists(tar_file):
135
+ tar_file = __download_flet_client(gz_filename)
136
+
137
+ logger.info(f"Extracting Flet.app from archive to {temp_flet_dir}")
90
138
  temp_flet_dir.mkdir(parents=True, exist_ok=True)
91
- with zipfile.ZipFile(zip_file, "r") as zip_arch:
92
- zip_arch.extractall(str(temp_flet_dir))
93
- flet_path = str(temp_flet_dir.joinpath("flet", flet_exe))
94
- args = [flet_path, page_url, pid_file]
95
- elif is_macos():
96
- # build version-specific path to Flet.app
97
- temp_flet_dir = Path.home().joinpath(
98
- ".flet", "bin", f"flet-{flet_desktop.version.version}"
99
- )
100
-
101
- # check if flet.exe is in FLET_VIEW_PATH (flet developer mode)
102
- flet_path = os.environ.get("FLET_VIEW_PATH")
103
- if flet_path:
104
- logger.info(f"Flet.app is set via FLET_VIEW_PATH: {flet_path}")
105
- temp_flet_dir = Path(flet_path)
106
- else:
107
- # check if flet_view.app exists in a temp directory
108
- if not temp_flet_dir.exists():
109
- # check if flet.tar.gz exists
110
- gz_filename = "flet-macos.tar.gz"
111
- tar_file = os.path.join(get_package_bin_dir(), gz_filename)
112
- logger.info(f"Looking for Flet.app archive at: {tar_file}")
113
- if not os.path.exists(tar_file):
114
- tar_file = __download_flet_client(gz_filename)
115
-
116
- logger.info(f"Extracting Flet.app from archive to {temp_flet_dir}")
117
- temp_flet_dir.mkdir(parents=True, exist_ok=True)
118
- with tarfile.open(str(tar_file), "r:gz") as tar_arch:
119
- safe_tar_extractall(tar_arch, str(temp_flet_dir))
120
- else:
121
- logger.info(f"Flet View found in: {temp_flet_dir}")
122
-
123
- app_name = None
124
- for f in os.listdir(temp_flet_dir):
125
- if f.endswith(".app"):
126
- app_name = f
127
- assert app_name is not None, f"Application bundle not found in {temp_flet_dir}"
128
- app_path = temp_flet_dir.joinpath(app_name)
139
+ with tarfile.open(str(tar_file), "r:gz") as tar_arch:
140
+ safe_tar_extractall(tar_arch, str(temp_flet_dir))
141
+ else:
142
+ logger.info(f"Flet View found in: {temp_flet_dir}")
143
+
144
+ app_name = None
145
+ for f in os.listdir(temp_flet_dir):
146
+ if f.endswith(".app"):
147
+ app_name = f
148
+ assert (
149
+ app_name is not None
150
+ ), f"Application bundle not found in {temp_flet_dir}"
151
+ app_path = temp_flet_dir.joinpath(app_name)
129
152
  args = ["open", str(app_path), "-n", "-W", "--args", page_url, pid_file]
130
153
  elif is_linux():
131
- # build version-specific path to flet folder
132
- temp_flet_dir = Path.home().joinpath(
133
- ".flet", "bin", f"flet-{flet_desktop.version.version}"
134
- )
135
-
136
154
  app_path = None
137
- # check if flet.exe is in FLET_VIEW_PATH (flet developer mode)
138
- flet_path = os.environ.get("FLET_VIEW_PATH")
139
- if flet_path:
140
- logger.info(f"Flet View is set via FLET_VIEW_PATH: {flet_path}")
141
- temp_flet_dir = Path(flet_path)
142
- app_path = temp_flet_dir.joinpath("flet")
143
- else:
144
- # check if flet_view.app exists in a temp directory
145
- if not temp_flet_dir.exists():
146
- # check if flet.tar.gz exists
147
- gz_filename = f"flet-linux-{get_arch()}.tar.gz"
148
- tar_file = os.path.join(get_package_bin_dir(), gz_filename)
149
- logger.info(f"Looking for Flet bundle archive at: {tar_file}")
150
- if not os.path.exists(tar_file):
151
- tar_file = __download_flet_client(gz_filename)
152
-
153
- logger.info(f"Extracting Flet from archive to {temp_flet_dir}")
154
- temp_flet_dir.mkdir(parents=True, exist_ok=True)
155
- with tarfile.open(str(tar_file), "r:gz") as tar_arch:
156
- safe_tar_extractall(tar_arch, str(temp_flet_dir))
155
+ # try loading Flet client built with the latest run of `flet build`
156
+ build_linux = os.path.join(os.getcwd(), "build", "linux")
157
+ if os.path.exists(build_linux):
158
+ for f in os.listdir(build_linux):
159
+ ef = os.path.join(build_linux, f)
160
+ if os.path.isfile(ef) and stat.S_IXUSR & os.stat(ef)[stat.ST_MODE]:
161
+ app_path = ef
162
+
163
+ if not app_path:
164
+ # build version-specific path to flet folder
165
+ temp_flet_dir = Path.home().joinpath(
166
+ ".flet", "bin", f"flet-{flet_desktop.version.version}"
167
+ )
168
+
169
+ # check if flet.exe is in FLET_VIEW_PATH (flet developer mode)
170
+ flet_path = os.environ.get("FLET_VIEW_PATH")
171
+ if flet_path:
172
+ logger.info(f"Flet View is set via FLET_VIEW_PATH: {flet_path}")
173
+ temp_flet_dir = Path(flet_path)
174
+ app_path = temp_flet_dir.joinpath("flet")
157
175
  else:
158
- logger.info(f"Flet View found in: {temp_flet_dir}")
176
+ # check if flet_view.app exists in a temp directory
177
+ if not temp_flet_dir.exists():
178
+ # check if flet.tar.gz exists
179
+ gz_filename = f"flet-linux-{get_arch()}.tar.gz"
180
+ tar_file = os.path.join(get_package_bin_dir(), gz_filename)
181
+ logger.info(f"Looking for Flet bundle archive at: {tar_file}")
182
+ if not os.path.exists(tar_file):
183
+ tar_file = __download_flet_client(gz_filename)
184
+
185
+ logger.info(f"Extracting Flet from archive to {temp_flet_dir}")
186
+ temp_flet_dir.mkdir(parents=True, exist_ok=True)
187
+ with tarfile.open(str(tar_file), "r:gz") as tar_arch:
188
+ safe_tar_extractall(tar_arch, str(temp_flet_dir))
189
+ else:
190
+ logger.info(f"Flet View found in: {temp_flet_dir}")
159
191
 
160
- app_path = temp_flet_dir.joinpath("flet", "flet")
192
+ app_path = temp_flet_dir.joinpath("flet", "flet")
161
193
  args = [str(app_path), page_url, pid_file]
162
194
 
163
195
  flet_env = {**os.environ}
@@ -173,8 +205,13 @@ def __locate_and_unpack_flet_view(page_url, assets_dir, hidden):
173
205
 
174
206
  def __download_flet_client(file_name):
175
207
  ver = flet_desktop.version.version
208
+ if not ver:
209
+ import flet.version
210
+ from flet.version import update_version
211
+
212
+ ver = flet.version.version or update_version()
176
213
  temp_arch = Path(tempfile.gettempdir()).joinpath(file_name)
177
- logger.info(f"Downloading Flet v{ver} to {temp_arch}")
178
214
  flet_url = f"https://github.com/flet-dev/flet/releases/download/v{ver}/{file_name}"
215
+ logger.info(f"Downloading Flet v{ver} from {flet_url} to {temp_arch}")
179
216
  urllib.request.urlretrieve(flet_url, temp_arch)
180
217
  return str(temp_arch)
Binary file
flet_desktop/version.py CHANGED
@@ -1 +1 @@
1
- version = "0.26.0.dev3957"
1
+ version = "0.26.0.dev3997"
@@ -1,20 +1,19 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: flet-desktop-light
3
- Version: 0.26.0.dev3957
3
+ Version: 0.26.0.dev3997
4
4
  Summary: Flet Desktop client in Flutter
5
5
  License: Apache-2.0
6
6
  Author: Appveyor Systems Inc.
7
7
  Author-email: hello@flet.dev
8
- Requires-Python: >=3.8,<4.0
8
+ Requires-Python: >=3.9,<4.0
9
9
  Classifier: License :: OSI Approved :: Apache Software License
10
10
  Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.8
12
11
  Classifier: Programming Language :: Python :: 3.9
13
12
  Classifier: Programming Language :: Python :: 3.10
14
13
  Classifier: Programming Language :: Python :: 3.11
15
14
  Classifier: Programming Language :: Python :: 3.12
16
15
  Classifier: Programming Language :: Python :: 3.13
17
- Requires-Dist: flet (==0.26.0.dev3957)
16
+ Requires-Dist: flet (==0.26.0.dev3997)
18
17
  Project-URL: Documentation, https://flet.dev/docs
19
18
  Project-URL: Homepage, https://flet.dev
20
19
  Project-URL: Repository, https://github.com/flet-dev/flet
@@ -0,0 +1,6 @@
1
+ flet_desktop/__init__.py,sha256=GU-Yzy2hPK_b7ZGzZYpHLh75C1tU-zqDAIXeNI2wdxE,8527
2
+ flet_desktop/version.py,sha256=OeLRwiV-2awklNFzT6RpQwE74-iP1GsbvGG70TLq1K0,27
3
+ flet_desktop/app/flet-linux-amd64.tar.gz,sha256=3f9zp60uD9gX85Ch31Ynz532roj_BWnoh0tGrhBtVSA,15330324
4
+ flet_desktop_light-0.26.0.dev3997.dist-info/METADATA,sha256=KHN5HZQUjbmlOiyR0a13Q3K-QGda2yyk9I-ZOhAdGB0,907
5
+ flet_desktop_light-0.26.0.dev3997.dist-info/WHEEL,sha256=WQ-SDk1xLTlz5VOWRG4XzOnbXle4cbC8zcjGjPPxY5w,105
6
+ flet_desktop_light-0.26.0.dev3997.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.0.0
2
+ Generator: poetry-core 2.0.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-musllinux_1_2_x86_64
@@ -1,6 +0,0 @@
1
- flet_desktop/__init__.py,sha256=jgIHwfHykMzu6q0o7OfkGSnlRiFsgKUg4dOWANoDZcY,6760
2
- flet_desktop/version.py,sha256=PVqV79xaXAjpE7l76K3l6M3sMEbh0lx2QbEMtjwjcb4,27
3
- flet_desktop/app/flet-linux-amd64.tar.gz,sha256=NRlSDLS3KDGXKKgUtI7ilD0p9wn_l4ckCWSPrij7QtQ,15330521
4
- flet_desktop_light-0.26.0.dev3957.dist-info/METADATA,sha256=HExNKnKd-Dz8RbKpiyuLA0kkVeuD2Hb7mKVtitIV8XI,957
5
- flet_desktop_light-0.26.0.dev3957.dist-info/WHEEL,sha256=8ceieSp9bae6cpoO_zLhUgU3t6Sjw5KK_R2saxqV3Ec,105
6
- flet_desktop_light-0.26.0.dev3957.dist-info/RECORD,,