diff --git a/src/gam.spec b/src/gam.spec index 7c857bc3..6d7cf4fa 100644 --- a/src/gam.spec +++ b/src/gam.spec @@ -1,19 +1,15 @@ # -*- mode: python ; coding: utf-8 -*- -from importlib.util import find_spec from os import getenv from re import search from sys import platform from PyInstaller.utils.hooks import copy_metadata +from gam.var import GAM_VER_LIBS extra_files = [] -with open('requirements.txt', 'r') as reqs: - for req in reqs: - r = search('^[a-z,A-Z,0-9-_]*', req) - pkg = r.group(0) if r else '' - if find_spec(pkg): - extra_files += copy_metadata(pkg, recursive=True) +for pkg in GAM_VER_LIBS: + copy_metadata(pkg, recursive=True) extra_files += [('cbcm-v1.1beta1.json', '.')] extra_files += [('contactdelegation-v1.json', '.')] extra_files += [('admin-directory_v1.1beta1.json', '.')] diff --git a/src/gam/__init__.py b/src/gam/__init__.py index c981aeae..2ca4ff13 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -884,20 +884,11 @@ def doGAMVersion(checkForArgs=True): doGAMCheckForUpdates(forceCheck) if extended: print(ssl.OPENSSL_VERSION) - libs = ['cryptography', - 'filelock', - 'google-auth-httplib2', - 'google-auth-oauthlib', - 'google-auth', - 'httplib2', - 'passlib', - 'python-dateutil', - 'yubikey-manager', - ] - for lib in libs: + for lib in GAM_VER_LIBS: try: print(f'{lib} {lib_version(lib)}') - except: + except Exception as e: + print(e) pass tls_ver, cipher_name, used_ip = _getServerTLSUsed(testLocation) print( diff --git a/src/gam/var.py b/src/gam/var.py index e7dbb591..4f6b892b 100644 --- a/src/gam/var.py +++ b/src/gam/var.py @@ -17,6 +17,18 @@ GAM_INFO = ( f'Python {platform.python_version()} {sys.version_info.releaselevel} / ' f'{platform.platform()} {platform.machine()}') +# Packages we want version info available +# for "gam version extended" +GAM_VER_LIBS = ['cryptography', + 'filelock', + 'google-auth-httplib2', + 'google-auth-oauthlib', + 'google-auth', + 'httplib2', + 'passlib', + 'python-dateutil', + 'yubikey-manager', + ] GAM_RELEASES = 'https://github.com/GAM-team/GAM/releases' GAM_WIKI = 'https://github.com/GAM-team/GAM/wiki' GAM_ALL_RELEASES = 'https://api.github.com/repos/GAM-team/GAM/releases'