From cfa25f12d389f850552a52f8329bd52bea01f71b Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Tue, 4 May 2021 09:12:45 -0400 Subject: [PATCH] 6.02, admin.googleapis.com as test, MacOS universal2 build --- .github/actions/macos-install.sh | 6 +---- .github/workflows/build.yml | 10 +++---- src/gam-universal2.spec | 46 -------------------------------- src/gam/__init__.py | 6 ++--- src/gam/var.py | 2 +- 5 files changed, 10 insertions(+), 60 deletions(-) delete mode 100644 src/gam-universal2.spec diff --git a/.github/actions/macos-install.sh b/.github/actions/macos-install.sh index f2ebeb64..a3d436db 100755 --- a/.github/actions/macos-install.sh +++ b/.github/actions/macos-install.sh @@ -4,11 +4,7 @@ echo "Xcode versionn:" xcodebuild -version export gampath=dist/gam rm -rf $gampath -if [ "$PLATFORM" == "x86_64" ]; then - export specfile="gam.spec" -else - export specfile="gam-universal2.spec" -fi +export specfile="gam.spec" $python -OO -m PyInstaller --clean --noupx --strip -F --distpath "${gampath}" "${specfile}" export gam="${gampath}/gam" $gam version extended diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4f984178..4bf29a7a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,11 +56,11 @@ jobs: goal: "build" gamos: "macos" platform: "x86_64" -# - os: macos-11.0 - #jid: 12 - #goal: "build" - #gamos: "macos" - #platform: "universal2" + - os: macos-11.0 + jid: 12 + goal: "build" + gamos: "macos" + platform: "universal2" - os: windows-2019 jid: 5 goal: "build" diff --git a/src/gam-universal2.spec b/src/gam-universal2.spec deleted file mode 100644 index 031c4b10..00000000 --- a/src/gam-universal2.spec +++ /dev/null @@ -1,46 +0,0 @@ -# -*- mode: python -*- - -import sys - -import importlib -from PyInstaller.utils.hooks import copy_metadata - -sys.modules['FixTk'] = None - -# 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') -extra_files += [('cbcm-v1.1beta1.json', '.')] - -a = Analysis(['gam/__main__.py'], - hiddenimports=[], - hookspath=None, - excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'], - datas=extra_files, - runtime_hooks=None) - -for d in a.datas: - if 'pyconfig' in d[0]: - a.datas.remove(d) - break - - -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 ) - -app = BUNDLE(exe, - name='gam.app', - icon=None, - bundle_identifier=None, - info_plist={'LSArchitecturePriority': 'arm64,x86_64'}) diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 07df3a67..2f3d7517 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -619,7 +619,7 @@ TIME_OFFSET_UNITS = [('day', 86400), ('hour', 3600), ('minute', 60), ('second', 1)] -def getLocalGoogleTimeOffset(testLocation='www.googleapis.com'): +def getLocalGoogleTimeOffset(testLocation='admin.googleapis.com'): localUTC = datetime.datetime.now(datetime.timezone.utc) try: # we disable SSL verify so we can still get time even if clock @@ -733,7 +733,7 @@ def getOSPlatform(): def doGAMVersion(checkForArgs=True): force_check = extended = simple = timeOffset = False - testLocation = 'www.googleapis.com' + testLocation = 'admin.googleapis.com' if checkForArgs: i = 2 while i < len(sys.argv): @@ -1169,7 +1169,7 @@ def doCheckServiceAccount(users): time_status = test_fail printPassFail( MESSAGE_YOUR_SYSTEM_TIME_DIFFERS_FROM_GOOGLE_BY % - ('www.googleapis.com', nicetime), time_status) + ('admin.googleapis.com', nicetime), time_status) oa2 = getService('oauth2', transport.create_http()) print('Service Account Private Key Authentication:') # We are explicitly not doing DwD here, just confirming service account can auth diff --git a/src/gam/var.py b/src/gam/var.py index ed139179..a7840f60 100644 --- a/src/gam/var.py +++ b/src/gam/var.py @@ -8,7 +8,7 @@ import platform import re GAM_AUTHOR = 'Jay Lee ' -GAM_VERSION = '6.01' +GAM_VERSION = '6.02' GAM_LICENSE = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' GAM_URL = 'https://git.io/gam'