diff --git a/buildPy2App.py b/buildPy2App.py new file mode 100644 index 0000000..0cb9291 --- /dev/null +++ b/buildPy2App.py @@ -0,0 +1,44 @@ +from setuptools import setup +from glob import glob +from datetime import datetime + +module_name = "project" +name = "Project" +version = "" +main_file = "main.py" + +# 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': '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': f'pl.{module_name}.{name}', + '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'], +) diff --git a/info.cfg b/info.cfg new file mode 100644 index 0000000..cd1ca59 --- /dev/null +++ b/info.cfg @@ -0,0 +1,3 @@ +version="0.1.0" +name="Project" +module_name="project" diff --git a/info.py b/info.py new file mode 100644 index 0000000..29f6aee --- /dev/null +++ b/info.py @@ -0,0 +1,6 @@ +version="0.1.0" +name="Project" +module_name="project" +company_name="Project Company" +bundle_identifier="com.projectcompany.project.Project" +main_file="main.py" diff --git a/project/__init__.py b/project/__init__.py new file mode 100644 index 0000000..8e4bbd7 --- /dev/null +++ b/project/__init__.py @@ -0,0 +1,5 @@ +from .. import info + +version = info.version +name = info.name +module_name = info.module_name diff --git a/project/resources/icon.icns b/project/resources/icon.icns new file mode 100644 index 0000000..9af3bcb Binary files /dev/null and b/project/resources/icon.icns differ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a7d0472 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pyside6==6.4.0.1