mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 12:21:35 +00:00
fix pyinstaller googleapiclient handling and unify spec files again
This commit is contained in:
@@ -2,23 +2,31 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import importlib
|
||||||
|
from PyInstaller.utils.hooks import copy_metadata
|
||||||
|
|
||||||
sys.modules['FixTk'] = None
|
sys.modules['FixTk'] = None
|
||||||
|
|
||||||
|
extra_files = [('cloudprint-v2.json', 'cloudprint-v2.json')]
|
||||||
|
|
||||||
|
# dynamically determine where httplib2/cacerts.txt lives
|
||||||
|
proot = os.path.dirname(importlib.import_module('httplib2').__file__)
|
||||||
|
extra_files += [(os.path.join(proot, 'cacerts.txt'), 'httplib2')]
|
||||||
|
|
||||||
|
extra_files += copy_metadata('google-api-python-client')
|
||||||
|
|
||||||
a = Analysis(['gam.py'],
|
a = Analysis(['gam.py'],
|
||||||
hiddenimports=[],
|
hiddenimports=[],
|
||||||
hookspath=None,
|
hookspath=None,
|
||||||
excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'],
|
excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'],
|
||||||
|
datas=extra_files,
|
||||||
runtime_hooks=None)
|
runtime_hooks=None)
|
||||||
|
|
||||||
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
|
||||||
a.datas += [('cloudprint-v2.json', 'cloudprint-v2.json', 'DATA')]
|
|
||||||
|
|
||||||
# dynamically determine where httplib2/cacerts.txt lives
|
|
||||||
import importlib
|
|
||||||
proot = os.path.dirname(importlib.import_module('httplib2').__file__)
|
|
||||||
a.datas += [('httplib2/cacerts.txt', os.path.join(proot, 'cacerts.txt'), 'DATA')]
|
|
||||||
|
|
||||||
pyz = PYZ(a.pure)
|
pyz = PYZ(a.pure)
|
||||||
exe = EXE(pyz,
|
exe = EXE(pyz,
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
# -*- mode: python -*-
|
|
||||||
import sys
|
|
||||||
|
|
||||||
sys.modules['FixTk'] = None
|
|
||||||
|
|
||||||
a = Analysis(['gam.py'],
|
|
||||||
hiddenimports=[],
|
|
||||||
hookspath=None,
|
|
||||||
excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'],
|
|
||||||
runtime_hooks=None)
|
|
||||||
for d in a.datas:
|
|
||||||
if 'pyconfig' in d[0]:
|
|
||||||
a.datas.remove(d)
|
|
||||||
break
|
|
||||||
a.datas += [('cloudprint-v2.json', 'cloudprint-v2.json', 'DATA')]
|
|
||||||
|
|
||||||
# dynamically determine where httplib2/cacerts.txt lives
|
|
||||||
import importlib
|
|
||||||
proot = os.path.dirname(importlib.import_module('httplib2').__file__)
|
|
||||||
a.datas += [('httplib2/cacerts.txt', os.path.join(proot, 'cacerts.txt'), 'DATA')]
|
|
||||||
|
|
||||||
pyz = PYZ(a.pure)
|
|
||||||
exe = EXE(pyz,
|
|
||||||
a.scripts,
|
|
||||||
a.binaries,
|
|
||||||
a.zipfiles,
|
|
||||||
a.datas,
|
|
||||||
name='gam',
|
|
||||||
debug=False,
|
|
||||||
strip=None,
|
|
||||||
upx=False,
|
|
||||||
console=True )
|
|
||||||
@@ -3,7 +3,7 @@ if [[ "$TRAVIS_JOB_NAME" == *"Testing" ]]; then
|
|||||||
export gam="$python gam.py"
|
export gam="$python gam.py"
|
||||||
export gampath=$(readlink -e .)
|
export gampath=$(readlink -e .)
|
||||||
else
|
else
|
||||||
$python -OO -m PyInstaller --clean --noupx --strip -F --distpath=gam $GAMOS-gam.spec
|
$python -OO -m PyInstaller --clean --noupx --strip -F --distpath=gam gam.spec
|
||||||
export gam="gam/gam"
|
export gam="gam/gam"
|
||||||
export gampath=$(readlink -e gam)
|
export gampath=$(readlink -e gam)
|
||||||
export GAMVERSION=`$gam version simple`
|
export GAMVERSION=`$gam version simple`
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
cd src
|
cd src
|
||||||
echo "MacOS Version Info According to Python:"
|
echo "MacOS Version Info According to Python:"
|
||||||
python -c "import platform; print(platform.mac_ver())"
|
python -c "import platform; print(platform.mac_ver())"
|
||||||
$python -OO -m PyInstaller --clean --noupx --strip -F --distpath=gam $GAMOS-gam.spec
|
$python -OO -m PyInstaller --clean --noupx --strip -F --distpath=gam gam.spec
|
||||||
export gam="gam/gam"
|
export gam="gam/gam"
|
||||||
export gampath=gam
|
export gampath=gam
|
||||||
$gam version extended
|
$gam version extended
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
cd src
|
cd src
|
||||||
echo "compiling GAM with pyinstaller..."
|
echo "compiling GAM with pyinstaller..."
|
||||||
pyinstaller --clean --noupx -F --distpath=gam $GAMOS-gam.spec
|
pyinstaller --clean --noupx -F --distpath=gam gam.spec
|
||||||
export gam="gam/gam"
|
export gam="gam/gam"
|
||||||
export gampath=$(readlink -e gam)
|
export gampath=$(readlink -e gam)
|
||||||
echo "running compiled GAM..."
|
echo "running compiled GAM..."
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
# -*- mode: python -*-
|
|
||||||
import sys
|
|
||||||
|
|
||||||
sys.modules['FixTk'] = None
|
|
||||||
|
|
||||||
a = Analysis(['gam.py'],
|
|
||||||
pathex=['C:\\Users\\jlee\\Documents\\GitHub\\GAM'],
|
|
||||||
hiddenimports=[],
|
|
||||||
hookspath=None,
|
|
||||||
excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'],
|
|
||||||
runtime_hooks=None)
|
|
||||||
for d in a.datas:
|
|
||||||
if 'pyconfig' in d[0]:
|
|
||||||
a.datas.remove(d)
|
|
||||||
break
|
|
||||||
a.datas += [('cloudprint-v2.json', 'cloudprint-v2.json', 'DATA')]
|
|
||||||
|
|
||||||
# dynamically determine where httplib2/cacerts.txt lives
|
|
||||||
import importlib
|
|
||||||
proot = os.path.dirname(importlib.import_module('httplib2').__file__)
|
|
||||||
a.datas += [('httplib2/cacerts.txt', os.path.join(proot, 'cacerts.txt'), 'DATA')]
|
|
||||||
|
|
||||||
pyz = PYZ(a.pure)
|
|
||||||
exe = EXE(pyz,
|
|
||||||
a.scripts,
|
|
||||||
a.binaries,
|
|
||||||
a.zipfiles,
|
|
||||||
a.datas,
|
|
||||||
name='gam.exe',
|
|
||||||
debug=False,
|
|
||||||
strip=None,
|
|
||||||
upx=True,
|
|
||||||
console=True )
|
|
||||||
Reference in New Issue
Block a user