flet-cli 0.80.6.dev7605__tar.gz → 0.80.6.dev7615__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.
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/PKG-INFO +4 -1
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/README.md +4 -1
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/pyproject.toml +1 -1
- flet_cli-0.80.6.dev7615/src/flet_cli/__pyinstaller/__init__.py +9 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/__pyinstaller/macos_utils.py +64 -3
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/__pyinstaller/utils.py +15 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/__pyinstaller/win_utils.py +27 -3
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/commands/base.py +11 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/commands/build.py +39 -3
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/commands/build_base.py +242 -2
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/commands/create.py +14 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/commands/debug.py +33 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/commands/devices.py +52 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/commands/emulators.py +79 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/commands/flutter_base.py +101 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/commands/options.py +14 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/commands/pack.py +14 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/commands/publish.py +23 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/commands/run.py +79 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/commands/serve.py +26 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/utils/android_sdk.py +163 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/utils/flutter.py +26 -0
- flet_cli-0.80.6.dev7615/src/flet_cli/utils/hash_stamp.py +50 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/utils/jdk.py +37 -1
- flet_cli-0.80.6.dev7615/src/flet_cli/utils/merge.py +23 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/utils/processes.py +24 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/utils/project_dependencies.py +37 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/utils/pyproject_toml.py +21 -0
- flet_cli-0.80.6.dev7615/src/flet_cli/version.py +1 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli.egg-info/PKG-INFO +4 -1
- flet_cli-0.80.6.dev7605/src/flet_cli/__pyinstaller/__init__.py +0 -5
- flet_cli-0.80.6.dev7605/src/flet_cli/utils/hash_stamp.py +0 -22
- flet_cli-0.80.6.dev7605/src/flet_cli/utils/merge.py +0 -7
- flet_cli-0.80.6.dev7605/src/flet_cli/version.py +0 -1
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/setup.cfg +0 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/__pyinstaller/config.py +0 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/__pyinstaller/hook-flet.py +0 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/__pyinstaller/rthooks/pyi_rth_localhost_fletd.py +0 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/cli.py +0 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/commands/doctor.py +0 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/utils/distros.py +0 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli.egg-info/SOURCES.txt +0 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli.egg-info/dependency_links.txt +0 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli.egg-info/entry_points.txt +0 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli.egg-info/requires.txt +0 -0
- {flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flet-cli
|
|
3
|
-
Version: 0.80.6.
|
|
3
|
+
Version: 0.80.6.dev7615
|
|
4
4
|
Summary: Flet CLI
|
|
5
5
|
Author-email: "Appveyor Systems Inc." <hello@flet.dev>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -18,6 +18,9 @@ Requires-Dist: cookiecutter>=2.6.0
|
|
|
18
18
|
|
|
19
19
|
# Flet CLI
|
|
20
20
|
|
|
21
|
+
[](https://pypi.org/project/flet-cli)
|
|
22
|
+
[](https://github.com/flet-dev/flet/tree/main/sdk/python/packages/flet/docs/assets/badges/docs-coverage)
|
|
23
|
+
|
|
21
24
|
Flet CLI is a command-line interface tool for Flet, a framework for building interactive multi-platform applications using Python.
|
|
22
25
|
|
|
23
26
|
## Features
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Flet CLI
|
|
2
2
|
|
|
3
|
+
[](https://pypi.org/project/flet-cli)
|
|
4
|
+
[](https://github.com/flet-dev/flet/tree/main/sdk/python/packages/flet/docs/assets/badges/docs-coverage)
|
|
5
|
+
|
|
3
6
|
Flet CLI is a command-line interface tool for Flet, a framework for building interactive multi-platform applications using Python.
|
|
4
7
|
|
|
5
8
|
## Features
|
|
@@ -14,4 +17,4 @@ To create a new Flet project:
|
|
|
14
17
|
|
|
15
18
|
```
|
|
16
19
|
flet create myapp
|
|
17
|
-
```
|
|
20
|
+
```
|
{flet_cli-0.80.6.dev7605 → flet_cli-0.80.6.dev7615}/src/flet_cli/__pyinstaller/macos_utils.py
RENAMED
|
@@ -5,11 +5,22 @@ import subprocess
|
|
|
5
5
|
import tarfile
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
|
|
8
|
-
from flet.utils import safe_tar_extractall
|
|
9
8
|
from PyInstaller.building.icon import normalize_icon_type
|
|
10
9
|
|
|
10
|
+
from flet.utils import safe_tar_extractall
|
|
11
|
+
|
|
11
12
|
|
|
12
13
|
def unpack_app_bundle(tar_path):
|
|
14
|
+
"""
|
|
15
|
+
Extract a macOS app bundle archive and remove the source tarball.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
tar_path: Path to a `*.tar.gz` archive containing `Flet.app`.
|
|
19
|
+
|
|
20
|
+
Returns:
|
|
21
|
+
Path to extracted `Flet.app`.
|
|
22
|
+
"""
|
|
23
|
+
|
|
13
24
|
bin_dir = str(Path(tar_path).parent)
|
|
14
25
|
|
|
15
26
|
with tarfile.open(tar_path, "r:gz") as tar_arch:
|
|
@@ -20,6 +31,14 @@ def unpack_app_bundle(tar_path):
|
|
|
20
31
|
|
|
21
32
|
|
|
22
33
|
def update_flet_view_icon(app_path, icon_path):
|
|
34
|
+
"""
|
|
35
|
+
Replace app icon in a macOS app bundle and update Info.plist metadata.
|
|
36
|
+
|
|
37
|
+
Args:
|
|
38
|
+
app_path: Path to app bundle directory.
|
|
39
|
+
icon_path: Path to source icon file.
|
|
40
|
+
"""
|
|
41
|
+
|
|
23
42
|
print("Updating Flet View icon", app_path, icon_path)
|
|
24
43
|
|
|
25
44
|
icon_file = "AppIcon.icns"
|
|
@@ -50,6 +69,20 @@ def update_flet_view_version_info(
|
|
|
50
69
|
product_version,
|
|
51
70
|
copyright,
|
|
52
71
|
):
|
|
72
|
+
"""
|
|
73
|
+
Update selected Info.plist metadata fields in a macOS app bundle.
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
app_path: Path to app bundle directory.
|
|
77
|
+
bundle_id: Optional bundle identifier override.
|
|
78
|
+
product_name: Optional display/bundle name override.
|
|
79
|
+
product_version: Optional version string.
|
|
80
|
+
copyright: Optional copyright text.
|
|
81
|
+
|
|
82
|
+
Returns:
|
|
83
|
+
Final app bundle path (may change when app bundle is renamed).
|
|
84
|
+
"""
|
|
85
|
+
|
|
53
86
|
print("Updating Flet View plist", app_path)
|
|
54
87
|
|
|
55
88
|
pl = __load_info_plist(app_path)
|
|
@@ -75,6 +108,17 @@ def update_flet_view_version_info(
|
|
|
75
108
|
|
|
76
109
|
|
|
77
110
|
def assemble_app_bundle(app_path, tar_path):
|
|
111
|
+
"""
|
|
112
|
+
Code-sign a macOS app bundle, package it as tar.gz, and remove unpacked bundle.
|
|
113
|
+
|
|
114
|
+
Args:
|
|
115
|
+
app_path: Path to app bundle directory.
|
|
116
|
+
tar_path: Destination tar.gz path.
|
|
117
|
+
|
|
118
|
+
Raises:
|
|
119
|
+
SystemError: If `codesign` fails.
|
|
120
|
+
"""
|
|
121
|
+
|
|
78
122
|
# sign app bundle
|
|
79
123
|
print(f"Signing file {app_path}")
|
|
80
124
|
cmd_args = [
|
|
@@ -91,11 +135,12 @@ def assemble_app_bundle(app_path, tar_path):
|
|
|
91
135
|
cmd_args,
|
|
92
136
|
stdout=subprocess.PIPE,
|
|
93
137
|
stderr=subprocess.STDOUT,
|
|
94
|
-
|
|
138
|
+
text=True,
|
|
95
139
|
)
|
|
96
140
|
if p.returncode:
|
|
97
141
|
raise SystemError(
|
|
98
|
-
f"codesign command ({cmd_args}) failed with
|
|
142
|
+
f"codesign command ({cmd_args}) failed with "
|
|
143
|
+
f"error code {p.returncode}!\noutput: {p.stdout}"
|
|
99
144
|
)
|
|
100
145
|
|
|
101
146
|
# pack tar
|
|
@@ -107,14 +152,30 @@ def assemble_app_bundle(app_path, tar_path):
|
|
|
107
152
|
|
|
108
153
|
|
|
109
154
|
def __load_info_plist(app_path):
|
|
155
|
+
"""
|
|
156
|
+
Load Info.plist content from a macOS app bundle.
|
|
157
|
+
"""
|
|
158
|
+
|
|
110
159
|
with open(__get_plist_path(app_path), "rb") as fp:
|
|
111
160
|
return plistlib.load(fp)
|
|
112
161
|
|
|
113
162
|
|
|
114
163
|
def __save_info_plist(app_path, pl):
|
|
164
|
+
"""
|
|
165
|
+
Save Info.plist content to a macOS app bundle.
|
|
166
|
+
|
|
167
|
+
Args:
|
|
168
|
+
app_path: Path to app bundle directory.
|
|
169
|
+
pl: Parsed plist dictionary to persist.
|
|
170
|
+
"""
|
|
171
|
+
|
|
115
172
|
with open(__get_plist_path(app_path), "wb") as fp:
|
|
116
173
|
plistlib.dump(pl, fp)
|
|
117
174
|
|
|
118
175
|
|
|
119
176
|
def __get_plist_path(app_path):
|
|
177
|
+
"""
|
|
178
|
+
Return path to `Info.plist` inside a macOS app bundle.
|
|
179
|
+
"""
|
|
180
|
+
|
|
120
181
|
return os.path.join(app_path, "Contents", "Info.plist")
|
|
@@ -8,6 +8,13 @@ from flet_desktop import get_package_bin_dir
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
def get_flet_bin_path():
|
|
11
|
+
"""
|
|
12
|
+
Return path to packaged Flet desktop binaries, if available.
|
|
13
|
+
|
|
14
|
+
Returns:
|
|
15
|
+
Absolute binaries directory path or `None` when not found.
|
|
16
|
+
"""
|
|
17
|
+
|
|
11
18
|
bin_path = get_package_bin_dir()
|
|
12
19
|
if not os.path.exists(bin_path):
|
|
13
20
|
return None
|
|
@@ -15,6 +22,14 @@ def get_flet_bin_path():
|
|
|
15
22
|
|
|
16
23
|
|
|
17
24
|
def copy_flet_bin():
|
|
25
|
+
"""
|
|
26
|
+
Copy packaged Flet desktop binaries into a temporary directory.
|
|
27
|
+
|
|
28
|
+
Returns:
|
|
29
|
+
Path to the temporary copied binaries directory, or `None` when source
|
|
30
|
+
binaries are unavailable.
|
|
31
|
+
"""
|
|
32
|
+
|
|
18
33
|
bin_path = get_flet_bin_path()
|
|
19
34
|
if not bin_path:
|
|
20
35
|
return None
|
|
@@ -12,6 +12,14 @@ from PyInstaller.utils.win32.icon import IconFile, normalize_icon_type
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def update_flet_view_icon(exe_path, icon_path):
|
|
15
|
+
"""
|
|
16
|
+
Replace icon resources in a Windows executable.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
exe_path: Path to target executable file.
|
|
20
|
+
icon_path: Path to source icon file or executable resource.
|
|
21
|
+
"""
|
|
22
|
+
|
|
15
23
|
print("Updating Flet View icon", exe_path, icon_path)
|
|
16
24
|
|
|
17
25
|
RT_ICON = 3
|
|
@@ -26,8 +34,8 @@ def update_flet_view_icon(exe_path, icon_path):
|
|
|
26
34
|
hdst = win32api.BeginUpdateResource(exe_path, 0)
|
|
27
35
|
|
|
28
36
|
iconid = 1
|
|
29
|
-
# Each step in the following enumerate() will instantiate an IconFile object,
|
|
30
|
-
# of the map() above.
|
|
37
|
+
# Each step in the following enumerate() will instantiate an IconFile object,
|
|
38
|
+
# as a result of deferred execution of the map() above.
|
|
31
39
|
i = 101
|
|
32
40
|
data = icon.grp_icon_dir()
|
|
33
41
|
data = data + icon.grp_icondir_entries(iconid)
|
|
@@ -49,7 +57,23 @@ def update_flet_view_version_info(
|
|
|
49
57
|
file_version,
|
|
50
58
|
company_name,
|
|
51
59
|
copyright,
|
|
52
|
-
):
|
|
60
|
+
) -> str:
|
|
61
|
+
"""
|
|
62
|
+
Update VERSIONINFO resources in a Windows executable.
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
exe_path: Path to target executable file.
|
|
66
|
+
product_name: Optional product name value.
|
|
67
|
+
file_description: Optional file description value.
|
|
68
|
+
product_version: Optional product version string.
|
|
69
|
+
file_version: Optional file version string (`n.n.n.n` expected).
|
|
70
|
+
company_name: Optional company name value.
|
|
71
|
+
copyright: Optional legal copyright value.
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
Path to a temporary text file containing serialized version info.
|
|
75
|
+
"""
|
|
76
|
+
|
|
53
77
|
print("Updating Flet View version info", exe_path)
|
|
54
78
|
|
|
55
79
|
# load versioninfo from exe
|
|
@@ -16,6 +16,17 @@ class CustomArgumentDefaultsHelpFormatter(argparse.HelpFormatter):
|
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
18
|
def _get_help_string(self, action: argparse.Action) -> str:
|
|
19
|
+
"""
|
|
20
|
+
Return help text for an argparse action with optional default annotation.
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
action: Parser action whose help text should be formatted.
|
|
24
|
+
|
|
25
|
+
Returns:
|
|
26
|
+
The action help string, optionally suffixed with
|
|
27
|
+
`"(default: %(default)s)"` when the default is meaningful.
|
|
28
|
+
"""
|
|
29
|
+
|
|
19
30
|
help_text = action.help or ""
|
|
20
31
|
default = action.default
|
|
21
32
|
|
|
@@ -10,18 +10,34 @@ class Command(BaseBuildCommand):
|
|
|
10
10
|
"""
|
|
11
11
|
Build a Flet Python app into a platform-specific executable or
|
|
12
12
|
installable bundle. It supports building for desktop (macOS, Linux, Windows), web,
|
|
13
|
-
Android (APK/AAB), and iOS (IPA), with a wide range of
|
|
14
|
-
metadata, assets, splash screens, and signing.
|
|
13
|
+
Android (APK/AAB), and iOS (IPA and simulator .app), with a wide range of
|
|
14
|
+
customization options for metadata, assets, splash screens, and signing.
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
17
|
def __init__(self, parser: argparse.ArgumentParser) -> None:
|
|
18
18
|
super().__init__(parser)
|
|
19
19
|
|
|
20
20
|
def add_arguments(self, parser: argparse.ArgumentParser) -> None:
|
|
21
|
+
"""
|
|
22
|
+
Register build-specific CLI arguments.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
parser: Argument parser configured by the command runner.
|
|
26
|
+
"""
|
|
27
|
+
|
|
21
28
|
parser.add_argument(
|
|
22
29
|
"target_platform",
|
|
23
30
|
type=str.lower,
|
|
24
|
-
choices=[
|
|
31
|
+
choices=[
|
|
32
|
+
"macos",
|
|
33
|
+
"linux",
|
|
34
|
+
"windows",
|
|
35
|
+
"web",
|
|
36
|
+
"apk",
|
|
37
|
+
"aab",
|
|
38
|
+
"ipa",
|
|
39
|
+
"ios-simulator",
|
|
40
|
+
],
|
|
25
41
|
help="The target platform or type of package to build",
|
|
26
42
|
)
|
|
27
43
|
parser.add_argument(
|
|
@@ -35,6 +51,13 @@ class Command(BaseBuildCommand):
|
|
|
35
51
|
super().add_arguments(parser)
|
|
36
52
|
|
|
37
53
|
def handle(self, options: argparse.Namespace) -> None:
|
|
54
|
+
"""
|
|
55
|
+
Execute the full build pipeline for the selected target platform.
|
|
56
|
+
|
|
57
|
+
Args:
|
|
58
|
+
options: Parsed command-line options.
|
|
59
|
+
"""
|
|
60
|
+
|
|
38
61
|
super().handle(options)
|
|
39
62
|
assert self.target_platform
|
|
40
63
|
self.status = console.status(
|
|
@@ -74,6 +97,13 @@ class Command(BaseBuildCommand):
|
|
|
74
97
|
)
|
|
75
98
|
|
|
76
99
|
def add_flutter_command_args(self, args: list[str]):
|
|
100
|
+
"""
|
|
101
|
+
Append `flutter build` arguments derived from CLI options and project config.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
args: Mutable command argument list to extend.
|
|
105
|
+
"""
|
|
106
|
+
|
|
77
107
|
assert self.options
|
|
78
108
|
assert self.build_dir
|
|
79
109
|
assert self.get_pyproject
|
|
@@ -97,6 +127,8 @@ class Command(BaseBuildCommand):
|
|
|
97
127
|
)
|
|
98
128
|
else:
|
|
99
129
|
args.append("--no-codesign")
|
|
130
|
+
elif self.target_platform == "ios-simulator":
|
|
131
|
+
args.append("--simulator")
|
|
100
132
|
|
|
101
133
|
build_number = self.options.build_number or self.get_pyproject(
|
|
102
134
|
"tool.flet.build_number"
|
|
@@ -120,6 +152,10 @@ class Command(BaseBuildCommand):
|
|
|
120
152
|
args.append(arg)
|
|
121
153
|
|
|
122
154
|
def run_flutter(self):
|
|
155
|
+
"""
|
|
156
|
+
Run Flutter build command and log completion status.
|
|
157
|
+
"""
|
|
158
|
+
|
|
123
159
|
assert self.platforms
|
|
124
160
|
assert self.target_platform
|
|
125
161
|
|