diff --git a/.github/actions/macos-before-install.sh b/.github/actions/macos-before-install.sh index 2e566484..86c4d7dc 100755 --- a/.github/actions/macos-before-install.sh +++ b/.github/actions/macos-before-install.sh @@ -129,4 +129,3 @@ $pip install pyscard $python -V cd $whereibelong - diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e528d61..0766f627 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: jid: 4 goal: "build" gamos: "windows" - pyarch: "x64" + pyarch: "x64" platform: "x86_64" - os: windows-2022 jid: 5 @@ -136,7 +136,7 @@ jobs: Invoke-WebRequest -Uri $python_url -OutFile $python_file Start-Process -wait -FilePath $python_file -ArgumentList "/quiet","InstallAllUsers=0","TargetDir=c:\\python","AssociateFiles=1","PrependPath=1" shell: pwsh - + - name: Install packages for test if: matrix.goal == 'test' run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c44ebe0..f92aa985 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,4 @@ # See https://pre-commit.com for more information -# See https://pre-commit.com/hooks.html for more hooks -default_language_version: - python: python3.7 repos: - repo: https://github.com/pre-commit/pre-commit-hooks @@ -27,3 +24,9 @@ repos: hooks: - id: pylint args: [--output-format=colorized] + +- repo: https://github.com/asottile/pyupgrade + rev: v2.31.0 + hooks: + - id: pyupgrade + args: [--py37-plus] diff --git a/src/GamCommands.txt b/src/GamCommands.txt index 028cf6b4..9ca99eae 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -1335,7 +1335,7 @@ gam print chromeversions [todrive] name| platform| version| - ::= + ::= channel| endtime| fraction| @@ -1364,7 +1364,7 @@ gam show chromeschema [filter ] ::= devices/ ::= android|chrome_os|google_sync|ios|linux|mac_os|windows ::= devices//deviceUsers/ - ::= + ::= createtime|devicetype|lastsynctime|model|osversion|serialnumber gam create device serialnumber devicetype [assetid ] diff --git a/src/contactdelegation-v1.json b/src/contactdelegation-v1.json index 44bd5182..dee13d03 100644 --- a/src/contactdelegation-v1.json +++ b/src/contactdelegation-v1.json @@ -4,13 +4,13 @@ "scopes": { "https://www.googleapis.com/auth/admin.contact.delegation": { "description": "View and manage your Contact Delegation" - }, + }, "https://www.googleapis.com/auth/admin.contact.delegation.readonly": { "description": "View your Contact Delegation" } } } - }, + }, "basePath": "", "baseUrl": "https://admin.googleapis.com/admin/contacts/v1/", "batchPath": "batch", diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 0bf25cde..64ba2155 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -3734,7 +3734,7 @@ def getDriveFileAttribute(i, body, parameters, myarg, update=False): i += 2 else: controlflow.invalid_argument_exit( - myarg, f"gam {operation} drivefile") + myarg, f'gam {operation} drivefile') return i diff --git a/src/gam/gapi/cbcm.py b/src/gam/gapi/cbcm.py index 0aa0890a..8bce4da9 100644 --- a/src/gam/gapi/cbcm.py +++ b/src/gam/gapi/cbcm.py @@ -211,7 +211,7 @@ def update(): browser.update(body) result = gapi.call(cbcm.chromebrowsers(), 'update', deviceId=device_id, customer=customer_id, body=browser, - projection='BASIC', fields="deviceId") + projection='BASIC', fields='deviceId') print(f'Updated browser {result["deviceId"]}') diff --git a/src/gam/gapi/chat.py b/src/gam/gapi/chat.py index 85bba75b..4d0f4331 100644 --- a/src/gam/gapi/chat.py +++ b/src/gam/gapi/chat.py @@ -76,7 +76,7 @@ def print_members(): todrive = True i += 1 else: - controlflow.invalid_argument_exit(myarg, "gam print chatmembers") + controlflow.invalid_argument_exit(myarg, 'gam print chatmembers') if not space: controlflow.system_error_exit(2, 'space is required.') @@ -117,7 +117,7 @@ def create_message(): body['thread'] = {'name': sys.argv[i+1]} i += 2 else: - controlflow.invalid_argument_exit(myarg, "gam create chat") + controlflow.invalid_argument_exit(myarg, 'gam create chat') if not space: controlflow.system_error_exit(2, 'space is required.') @@ -151,7 +151,7 @@ def delete_message(): name = sys.argv[i+1] i += 2 else: - controlflow.invalid_argument_exit(myarg, "gam delete chat") + controlflow.invalid_argument_exit(myarg, 'gam delete chat') if not name: controlflow.system_error_exit(2, 'name is required.') @@ -182,7 +182,7 @@ def update_message(): name = sys.argv[i+1] i += 2 else: - controlflow.invalid_argument_exit(myarg, "gam update chat") + controlflow.invalid_argument_exit(myarg, 'gam update chat') if not name: controlflow.system_error_exit(2, 'name is required.') diff --git a/src/gam/gapi/chromehistory.py b/src/gam/gapi/chromehistory.py index 99ed9207..9e063967 100644 --- a/src/gam/gapi/chromehistory.py +++ b/src/gam/gapi/chromehistory.py @@ -203,7 +203,7 @@ def printHistory(): if 'channel' in citem: citem['channel'] = citem['channel'].lower() else: - channel_match = re.search(r"\/channels\/([^/]*)", citem['name']) + channel_match = re.search(r'\/channels\/([^/]*)', citem['name']) if channel_match: try: citem['channel'] = channel_match.group(1) @@ -212,7 +212,7 @@ def printHistory(): if 'platform' in citem: citem['platform'] = citem['platform'].lower() else: - platform_match = re.search(r"\/platforms\/([^/]*)", citem['name']) + platform_match = re.search(r'\/platforms\/([^/]*)', citem['name']) if platform_match: try: citem['platform'] = platform_match.group(1) diff --git a/src/requirements.txt b/src/requirements.txt index b781ddfd..d1256d35 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -1,4 +1,3 @@ -yubikey-manager>=4.0.0 cryptography distro; sys_platform == 'linux' filelock @@ -9,5 +8,6 @@ google-auth>=2.3.2 httplib2>=0.17.0 importlib.metadata; python_version < '3.8' passlib>=1.7.2 -python-dateutil pathvalidate +python-dateutil +yubikey-manager>=4.0.0