mirror of
https://github.com/rbreu/beeref.git
synced 2026-03-11 08:54:28 +00:00
48 lines
1.2 KiB
Python
48 lines
1.2 KiB
Python
"""Build release files."""
|
|
|
|
|
|
from distutils.sysconfig import get_python_lib
|
|
import os.path
|
|
import shutil
|
|
import subprocess
|
|
import sys
|
|
|
|
from beeref import constants
|
|
|
|
|
|
def datapath(src, dest):
|
|
return os.path.join(*src) + os.pathsep + os.path.join(*dest)
|
|
|
|
|
|
pyqt_dir = os.path.join(get_python_lib(), 'PyQt6', 'Qt6')
|
|
appname= f'{constants.APPNAME}-{constants.VERSION}'
|
|
|
|
subprocess.run(
|
|
[
|
|
'pyinstaller',
|
|
'--noconfirm',
|
|
'--onedir',
|
|
'--windowed',
|
|
'--name', appname,
|
|
'--hidden-import', 'PyQt6.sip',
|
|
'--hidden-import', 'PyQt6.QtPrintSupport',
|
|
'--icon', os.path.join('beeref', 'assets', 'logo.png'),
|
|
'--paths', os.path.join(pyqt_dir, 'bin'),
|
|
'--add-data', datapath(
|
|
[pyqt_dir, 'plugins', 'platforms'], ['platforms']),
|
|
'--add-data', datapath([pyqt_dir, 'lib'], ['.']),
|
|
'--add-data', datapath(
|
|
['beeref', 'documentation'], ['beeref', 'documentation']),
|
|
'--add-data', datapath(
|
|
['beeref', 'assets', '*.png'], ['beeref', 'assets']),
|
|
'beeref/__main__.py'
|
|
])
|
|
|
|
print('Zipping output...')
|
|
shutil.make_archive(
|
|
os.path.join('dist', appname),
|
|
'zip',
|
|
root_dir='dist',
|
|
base_dir=appname)
|
|
|
|
print('Done')
|