Pyside6Template/buildPy2App.py
Joey Yakimowich-Payne 062b7d4fe0 Maybe fix mac build
2022-11-08 09:55:40 -07:00

45 lines
1.3 KiB
Python

from setuptools import setup
from glob import glob
from datetime import datetime
module_name = "project"
name = "Project"
version = ""
main_file = "main.py"
bundle_identifier = "com.project.Project"
# Overrides the above
exec(open("info.py").read())
APP = [f'{module_name}/{main_file}']
DATA_FILES = [
('resources', glob(module_name + '/resources/*.png') + glob(module_name + '/resources/*.rtf') + glob(module_name + '/resources/*.txt')),
]
OPTIONS = {
'iconfile': module_name + '/resources/icon.icns',
'extra_scripts': module_name + '/info.py',
'includes': {'PySide6.QtCore', 'PySide6.QtUiTools', 'PySide6.QtGui', 'PySide6.QtWidgets', 'certifi', 'cffi', 'pem'},
'excludes': {'tkinter'},
'qt_plugins': [
'platforms/libqcocoa.dylib',
'platforms/libqminimal.dylib',
'platforms/libqoffscreen.dylib',
'styles/libqmacstyle.dylib'
],
'plist': {
'CFBundleName': name,
'CFBundleShortVersionString': version,
'CFBundleIdentifier': bundle_identifier,
'LSMinimumSystemVersion': '10.12.0',
'NSHumanReadableCopyright': f'Copyright © {datetime.now().year} {name} All Rights Reserved',
}
}
setup(
app=APP,
name=name,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)