Skip to content

Commit 5554fa6

Browse files
Last-minute fixes for Flet 0.27.0 release (#4938)
* Check ios_provisioning_profile for iOS target only * Fix slugify to replace underscore
1 parent 10ea749 commit 5554fa6

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

sdk/python/packages/flet-cli/src/flet_cli/commands/build.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,11 @@
99
from typing import Optional, cast
1010

1111
import flet.version
12+
import flet_cli.utils.processes as processes
1213
import yaml
1314
from flet.utils import cleanup_path, copy_tree, is_windows, slugify
1415
from flet.utils.platform_utils import get_bool_env_var
1516
from flet.version import update_version
16-
from packaging import version
17-
from rich.console import Console, Group
18-
from rich.live import Live
19-
from rich.panel import Panel
20-
from rich.progress import Progress
21-
from rich.style import Style
22-
from rich.table import Column, Table
23-
from rich.theme import Theme
24-
25-
import flet_cli.utils.processes as processes
2617
from flet_cli.commands.base import BaseCommand
2718
from flet_cli.utils.hash_stamp import HashStamp
2819
from flet_cli.utils.merge import merge_dict
@@ -31,6 +22,14 @@
3122
get_project_dependencies,
3223
)
3324
from flet_cli.utils.pyproject_toml import load_pyproject_toml
25+
from packaging import version
26+
from rich.console import Console, Group
27+
from rich.live import Live
28+
from rich.panel import Panel
29+
from rich.progress import Progress
30+
from rich.style import Style
31+
from rich.table import Column, Table
32+
from rich.theme import Theme
3433

3534
PYODIDE_ROOT_URL = "https://cdn.jsdelivr.net/pyodide/v0.27.2/full"
3635
DEFAULT_TEMPLATE_URL = "gh:flet-dev/flet-build-template"
@@ -1064,7 +1063,7 @@ def setup_template_data(self):
10641063
or ios_export_method_opts.get("team_id")
10651064
)
10661065

1067-
if not ios_provisioning_profile:
1066+
if self.options.target_platform in ["ipa"] and not ios_provisioning_profile:
10681067
console.print(
10691068
Panel(
10701069
"This build will generate an .xcarchive (Xcode Archive). To produce an .ipa (iOS App Package), please specify a Provisioning Profile.",
@@ -1131,9 +1130,7 @@ def setup_template_data(self):
11311130
"target_arch": (
11321131
target_arch
11331132
if isinstance(target_arch, list)
1134-
else [target_arch]
1135-
if isinstance(target_arch, str)
1136-
else []
1133+
else [target_arch] if isinstance(target_arch, str) else []
11371134
),
11381135
"info_plist": info_plist,
11391136
"macos_entitlements": macos_entitlements,

sdk/python/packages/flet/src/flet/utils/slugify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ def slugify(value: str) -> str:
1111
unicodedata.normalize("NFKD", value).encode("ascii", "ignore").decode("ascii")
1212
)
1313
value = re.sub(r"[^\w\s-]", "", value).strip().lower()
14-
return re.sub(r"[-\s]+", "-", value).strip("-")
14+
return re.sub(r"[-_\s]+", "-", value).strip("-")

0 commit comments

Comments
 (0)