diff --git a/describe.py b/describe.py index 2537e7c06ee..7bf5f50beb6 100755 --- a/describe.py +++ b/describe.py @@ -402,13 +402,25 @@ def document_api(name, version, uri): FLAGS.discovery_uri_template, {"api": name, "apiVersion": version} ) ) - discovery = json.loads(content) - version = safe_version(version) + if response.status == 200: + discovery = json.loads(content) - document_collection_recursive( - service, "{}_{}.".format(name, version), discovery, discovery - ) + version = safe_version(version) + + document_collection_recursive( + service, "{}_{}.".format(name, version), discovery, discovery + ) + elif resp.status == 404: + print( + "Warning: {} {} not found. HTTP Code: {}".format(name, version, resp.status) + ) + else: + print( + "Warning: {} {} could not be built. HTTP Code: {}".format( + name, version, resp.status + ) + ) def document_api_from_discovery_document(uri): diff --git a/setup.py b/setup.py index 8086749c18d..0c43a8917b6 100644 --- a/setup.py +++ b/setup.py @@ -36,9 +36,11 @@ install_requires = [ "httplib2>=0.15.0,<1dev", - "google-auth>=1.16.0", + "google-auth>=1.16.0, <2dev; python_version<'3'", + "google-auth>=1.16.0, <3dev; python_version>='3'", "google-auth-httplib2>=0.0.3", - "google-api-core>=1.21.0,<2dev", + "google-api-core>=1.21.0, <2dev; python_version<'3'", + "google-api-core>=1.21.0, <3dev; python_version>='3'", # rsa version 4.5 is the last version that is compatible with Python 2.7 "rsa==4.5;python_version<'3'", "six>=1.13.0,<2dev",