mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 20:31:35 +00:00
Switch to PyInstaller onedir for better performance
This commit is contained in:
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@@ -450,7 +450,7 @@ jobs:
|
|||||||
- name: Copy extra package files
|
- name: Copy extra package files
|
||||||
if: matrix.goal == 'build'
|
if: matrix.goal == 'build'
|
||||||
run: |
|
run: |
|
||||||
cp -v roots.pem $gampath
|
#cp -v roots.pem $gampath
|
||||||
cp -v LICENSE $gampath
|
cp -v LICENSE $gampath
|
||||||
cp -v GamCommands.txt $gampath
|
cp -v GamCommands.txt $gampath
|
||||||
if [[ "${RUNNER_OS}" == "Windows" ]]; then
|
if [[ "${RUNNER_OS}" == "Windows" ]]; then
|
||||||
@@ -515,9 +515,9 @@ jobs:
|
|||||||
GAM_ARCHIVE="../gam-${GAMVERSION}-windows-${GAM_ARCHIVE_ARCH}.zip"
|
GAM_ARCHIVE="../gam-${GAMVERSION}-windows-${GAM_ARCHIVE_ARCH}.zip"
|
||||||
/c/Program\ Files/7-Zip/7z.exe a -tzip $GAM_ARCHIVE gam "-xr@${GITHUB_WORKSPACE}/.github/actions/package_exclusions.txt" -bb3
|
/c/Program\ Files/7-Zip/7z.exe a -tzip $GAM_ARCHIVE gam "-xr@${GITHUB_WORKSPACE}/.github/actions/package_exclusions.txt" -bb3
|
||||||
cd ..
|
cd ..
|
||||||
/c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.11/bin/candle.exe -arch "${WIX_ARCH}" gam.wxs
|
#/c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.11/bin/candle.exe -arch "${WIX_ARCH}" gam.wxs
|
||||||
/c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.11/bin/light.exe -ext /c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.11/bin/WixUIExtension.dll gam.wixobj -o "gam-${GAMVERSION}-windows-${GAM_ARCHIVE_ARCH}.msi" || true;
|
#/c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.11/bin/light.exe -ext /c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.11/bin/WixUIExtension.dll gam.wixobj -o "gam-${GAMVERSION}-windows-${GAM_ARCHIVE_ARCH}.msi" || true;
|
||||||
rm -v -f *.wixpdb
|
#rm -v -f *.wixpdb
|
||||||
|
|
||||||
- name: Basic Tests build jobs only
|
- name: Basic Tests build jobs only
|
||||||
if: matrix.goal != 'test' && steps.cache-python-ssl.outputs.cache-hit != 'true'
|
if: matrix.goal != 'test' && steps.cache-python-ssl.outputs.cache-hit != 'true'
|
||||||
|
|||||||
87
src/gam.spec
87
src/gam.spec
@@ -1,53 +1,76 @@
|
|||||||
# -*- mode: python -*-
|
# -*- mode: python ; coding: utf-8 -*-
|
||||||
|
from sys import platform
|
||||||
import sys
|
|
||||||
|
|
||||||
import importlib
|
|
||||||
from PyInstaller.utils.hooks import copy_metadata
|
from PyInstaller.utils.hooks import copy_metadata
|
||||||
|
|
||||||
extra_files = []
|
|
||||||
|
|
||||||
|
extra_files = []
|
||||||
extra_files += copy_metadata('google-api-python-client')
|
extra_files += copy_metadata('google-api-python-client')
|
||||||
extra_files += [('cbcm-v1.1beta1.json', '.')]
|
extra_files += [('cbcm-v1.1beta1.json', '.')]
|
||||||
extra_files += [('contactdelegation-v1.json', '.')]
|
extra_files += [('contactdelegation-v1.json', '.')]
|
||||||
extra_files += [('admin-directory_v1.1beta1.json', '.')]
|
extra_files += [('admin-directory_v1.1beta1.json', '.')]
|
||||||
|
extra_files += [('roots.pem', '.')]
|
||||||
hidden_imports = [
|
hidden_imports = [
|
||||||
'gam.auth.yubikey',
|
'gam.auth.yubikey',
|
||||||
]
|
]
|
||||||
|
a = Analysis(
|
||||||
a = Analysis(['gam/__main__.py'],
|
['gam/__main__.py'],
|
||||||
hiddenimports=hidden_imports,
|
pathex=[],
|
||||||
hookspath=None,
|
binaries=[],
|
||||||
excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'],
|
|
||||||
datas=extra_files,
|
datas=extra_files,
|
||||||
runtime_hooks=None)
|
hiddenimports=hidden_imports,
|
||||||
|
hookspath=[],
|
||||||
|
hooksconfig={},
|
||||||
|
runtime_hooks=[],
|
||||||
|
excludes=[],
|
||||||
|
win_no_prefer_redirects=False,
|
||||||
|
win_private_assemblies=False,
|
||||||
|
cipher=None,
|
||||||
|
noarchive=False,
|
||||||
|
)
|
||||||
for d in a.datas:
|
for d in a.datas:
|
||||||
if 'pyconfig' in d[0]:
|
if 'pyconfig' in d[0]:
|
||||||
a.datas.remove(d)
|
a.datas.remove(d)
|
||||||
break
|
break
|
||||||
|
pyz = PYZ(a.pure,
|
||||||
|
a.zipped_data,
|
||||||
pyz = PYZ(a.pure)
|
cipher=None)
|
||||||
|
# requires Python 3.10+ but no one should be compiling
|
||||||
|
# GAM with older versions anyway
|
||||||
if sys.platform == "darwin":
|
match platform:
|
||||||
target_arch="universal2"
|
case "darwin":
|
||||||
else:
|
target_arch = "universal2"
|
||||||
target_arch=None
|
strip = True
|
||||||
|
case "win32":
|
||||||
# use strip on all non-Windows platforms
|
target_arch = None
|
||||||
strip = not sys.platform == 'win32'
|
strip = False
|
||||||
|
case _:
|
||||||
exe = EXE(pyz,
|
target_arch = None
|
||||||
|
strip = True
|
||||||
|
exe = EXE(
|
||||||
|
pyz,
|
||||||
a.scripts,
|
a.scripts,
|
||||||
|
[],
|
||||||
|
exclude_binaries=True,
|
||||||
|
name='gam',
|
||||||
|
debug=False,
|
||||||
|
bootloader_ignore_signals=False,
|
||||||
|
strip=strip,
|
||||||
|
upx=False,
|
||||||
|
console=True,
|
||||||
|
disable_windowed_traceback=False,
|
||||||
|
argv_emulation=False,
|
||||||
|
target_arch=target_arch,
|
||||||
|
codesign_identity=None,
|
||||||
|
entitlements_file=None,
|
||||||
|
)
|
||||||
|
coll = COLLECT(
|
||||||
|
exe,
|
||||||
a.binaries,
|
a.binaries,
|
||||||
a.zipfiles,
|
a.zipfiles,
|
||||||
a.datas,
|
a.datas,
|
||||||
name='gam',
|
|
||||||
debug=False,
|
|
||||||
strip=strip,
|
strip=strip,
|
||||||
upx=False,
|
upx=False,
|
||||||
target_arch=target_arch,
|
upx_exclude=[],
|
||||||
console=True)
|
name='gam',
|
||||||
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user