setup-gcloud
setup-gcloud copied to clipboard
Python 3.9 support
TL;DR
Getting error when trying to install gcloud sdk using python 3.9.0 Expected behavior Successfully installed gcloud sdk
Observed behavior
Traceback (most recent call last):
File "/opt/hostedtoolcache/gcloud/314.0.0/x64/lib/gcloud.py", line 104, in <module>
main()
File "/opt/hostedtoolcache/gcloud/314.0.0/x64/lib/gcloud.py", line 62, in main
from googlecloudsdk.core.util import encoding
File "/opt/hostedtoolcache/gcloud/314.0.0/x64/lib/googlecloudsdk/__init__.py", line 23, in <module>
from googlecloudsdk.core.util import importing
File "/opt/hostedtoolcache/gcloud/314.0.0/x64/lib/googlecloudsdk/core/util/importing.py", line 23, in <module>
import imp
File "/opt/hostedtoolcache/Python/3.9.0/x64/lib/python3.9/imp.py", line 23, in <module>
from importlib import util
File "/opt/hostedtoolcache/Python/3.9.0/x64/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/opt/hostedtoolcache/Python/3.9.0/x64/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/opt/hostedtoolcache/Python/3.9.0/x64/lib/python3.9/typing.py", line 26, in <module>
import re as stdlib_re # Avoid confusion with the re we export.
File "/opt/hostedtoolcache/Python/3.9.0/x64/lib/python3.9/re.py", line 124, in <module>
import enum
File "/opt/hostedtoolcache/gcloud/314.0.0/x64/lib/third_party/enum/__init__.py", line 26, in <module>
spec = importlib.util.find_spec('enum')
AttributeError: module 'importlib' has no attribute 'util'
Error: The process '/opt/hostedtoolcache/gcloud/314.0.0/x64/bin/gcloud' failed with exit code 1
Reproduction
Action YAML
jobs:
build:
runs-on: ubuntu-latest
strategy:
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Setup gcloud environment
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
project_id: <project_id>
service_account_key: <sa_key>
@anisf thanks for the report. This seems like a known gcloud incompatibility. Tracking here: https://issuetracker.google.com/issues/169249645
Closing as the issue has been fixed upstream in 319.0.0+: https://b.corp.google.com/issues/170125513