Skip to content

Commit

Permalink
Wrapped --codesign-identity & --add-binary for flet pack (#1789)
Browse files Browse the repository at this point in the history
Wrapping --codesign-identity & --add-binary for flet pack allows end to end code signing on macOS. This avoids having to use pyinstaller directly which leads to app naming issues.
  • Loading branch information
joshvisionalgo authored Sep 1, 2023
1 parent 6155b3a commit fdfff95
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sdk/python/packages/flet/src/flet/cli/commands/pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ def add_arguments(self, parser: argparse.ArgumentParser) -> None:
nargs="*",
help="additional non-binary files or folders to be added to the executable",
)
parser.add_argument(
"--add-binary",
dest="add_binary",
action="append",
nargs="*",
help="additional binary files to be added to the executable",
)
parser.add_argument(
"--hidden-import",
dest="hidden_import",
Expand Down Expand Up @@ -85,6 +92,11 @@ def add_arguments(self, parser: argparse.ArgumentParser) -> None:
dest="copyright",
help="executable (Windows) or bundle (macOS) copyright",
)
parser.add_argument(
"--codesign-identity",
dest="codesign_identity",
help="Code signing identity (macOS)",
)
parser.add_argument(
"--bundle-id",
dest="bundle_id",
Expand Down Expand Up @@ -117,10 +129,16 @@ def handle(self, options: argparse.Namespace) -> None:
for add_data_arr in options.add_data:
for add_data_item in add_data_arr:
pyi_args.extend(["--add-data", add_data_item])
if options.add_binary:
for add_binary_arr in options.add_binary:
for add_binary_item in add_binary_arr:
pyi_args.extend(["--add-binary", add_binary_item])
if options.hidden_import:
for hidden_import_arr in options.hidden_import:
for hidden_import_item in hidden_import_arr:
pyi_args.extend(["--hidden-import", hidden_import_item])
if options.codesign_identity:
pyi_args.extend(["--codesign-identity", options.codesign_identity])
if options.bundle_id:
pyi_args.extend(["--osx-bundle-identifier", options.bundle_id])
if options.onedir:
Expand Down

0 comments on commit fdfff95

Please sign in to comment.