Explorar o código

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 hai 7 meses
pai
achega
ee51a680e2
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  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=[
     parser.add_argument('--add-data', type=str, action='append', default=[
         f'{Path(nicegui.__file__).parent}{os.pathsep}nicegui',
         f'{Path(nicegui.__file__).parent}{os.pathsep}nicegui',
     ], help='Include additional data.')
     ], 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()`.')
     parser.add_argument('main', default='main.py', help='Main file which calls `ui.run()`.')
     args = parser.parse_args()
     args = parser.parse_args()
 
 
@@ -57,6 +59,11 @@ def main() -> None:
         command.append('--onefile')
         command.append('--onefile')
     for data in args.add_data:
     for data in args.add_data:
         command.extend(['--add-data', 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])
     command.extend([args.main])
 
 
     print('PyInstaller command:')
     print('PyInstaller command:')