Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3b3fb15

Browse files
busunkim96parthea
andauthored
fix(deps): allow google-api-core 2.x for python 3 users (googleapis#1649)
* fix(deps): allow google-api-core 2.x for python 3 users Fixes googleapis#1611 * attempt to fix docs build Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent 09155f1 commit 3b3fb15

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

describe.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,13 +402,25 @@ def document_api(name, version, uri):
402402
FLAGS.discovery_uri_template, {"api": name, "apiVersion": version}
403403
)
404404
)
405-
discovery = json.loads(content)
406405

407-
version = safe_version(version)
406+
if response.status == 200:
407+
discovery = json.loads(content)
408408

409-
document_collection_recursive(
410-
service, "{}_{}.".format(name, version), discovery, discovery
411-
)
409+
version = safe_version(version)
410+
411+
document_collection_recursive(
412+
service, "{}_{}.".format(name, version), discovery, discovery
413+
)
414+
elif resp.status == 404:
415+
print(
416+
"Warning: {} {} not found. HTTP Code: {}".format(name, version, resp.status)
417+
)
418+
else:
419+
print(
420+
"Warning: {} {} could not be built. HTTP Code: {}".format(
421+
name, version, resp.status
422+
)
423+
)
412424

413425

414426
def document_api_from_discovery_document(uri):

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@
3636

3737
install_requires = [
3838
"httplib2>=0.15.0,<1dev",
39-
"google-auth>=1.16.0",
39+
"google-auth>=1.16.0, <2dev; python_version<'3'",
40+
"google-auth>=1.16.0, <3dev; python_version>='3'",
4041
"google-auth-httplib2>=0.0.3",
41-
"google-api-core>=1.21.0,<2dev",
42+
"google-api-core>=1.21.0, <2dev; python_version<'3'",
43+
"google-api-core>=1.21.0, <3dev; python_version>='3'",
4244
# rsa version 4.5 is the last version that is compatible with Python 2.7
4345
"rsa==4.5;python_version<'3'",
4446
"six>=1.13.0,<2dev",

0 commit comments

Comments
 (0)