瀏覽代碼

Expose additional PyInstaller arguments (#3853)

The optional added arguments are useful for building on OSX.

It would probably make sense to expose all arguments of PyInstaller as
far as they don't conflict, although this would require manually
respecifying them all.

(Alternatively, you could also provide documentation on how to package
with PyInstaller if the user prefers not to use the wrapper.)

---------

Co-authored-by: David Reis <post@d-reis.com>
Co-authored-by: Falko Schindler <falko@zauberzeug.com>
David 7 月之前
父節點
當前提交
ee51a680e2
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      nicegui/scripts/pack.py

+ 8 - 1
nicegui/scripts/pack.py

@@ -41,7 +41,9 @@ def main() -> None:
     parser.add_argument('--add-data', type=str, action='append', default=[
         f'{Path(nicegui.__file__).parent}{os.pathsep}nicegui',
     ], help='Include additional data.')
-    parser.add_argument('--dry-run', action='store_true', help='Dry run', default=False)
+    parser.add_argument('--icon', type=str, help='Path to an icon file.')
+    parser.add_argument('--osx-bundle-identifier', type=str, help='Mac OS .app bundle identifier.')
+    parser.add_argument('--dry-run', action='store_true', help='Dry run.', default=False)
     parser.add_argument('main', default='main.py', help='Main file which calls `ui.run()`.')
     args = parser.parse_args()
 
@@ -57,6 +59,11 @@ def main() -> None:
         command.append('--onefile')
     for data in args.add_data:
         command.extend(['--add-data', data])
+    if args.icon:
+        command.extend(['--icon', args.icon])
+    if args.osx_bundle_identifier:
+        command.extend(['--osx-bundle-identifier', args.osx_bundle_identifier])
+
     command.extend([args.main])
 
     print('PyInstaller command:')