google-api-core 2.28.1__tar.gz → 2.30.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. {google_api_core-2.28.1/google_api_core.egg-info → google_api_core-2.30.0}/PKG-INFO +12 -15
  2. {google_api_core-2.28.1 → google_api_core-2.30.0}/README.rst +5 -2
  3. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/__init__.py +1 -0
  4. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/_python_package_support.py +2 -9
  5. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/_python_version_support.py +17 -8
  6. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/bidi.py +3 -3
  7. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/bidi_async.py +3 -3
  8. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/gapic_v1/method.py +0 -3
  9. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/grpc_helpers.py +1 -36
  10. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/grpc_helpers_async.py +1 -1
  11. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/operation.py +1 -1
  12. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/operations_v1/abstract_operations_base_client.py +14 -8
  13. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/operations_v1/pagers.py +1 -1
  14. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/operations_v1/pagers_async.py +1 -1
  15. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/operations_v1/pagers_base.py +1 -1
  16. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/operations_v1/transports/base.py +7 -4
  17. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/retry/retry_base.py +4 -2
  18. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/version.py +1 -1
  19. {google_api_core-2.28.1 → google_api_core-2.30.0/google_api_core.egg-info}/PKG-INFO +12 -15
  20. {google_api_core-2.28.1 → google_api_core-2.30.0}/google_api_core.egg-info/requires.txt +3 -12
  21. {google_api_core-2.28.1 → google_api_core-2.30.0}/pyproject.toml +14 -23
  22. google_api_core-2.30.0/setup.cfg +4 -0
  23. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/asyncio/gapic/test_method_async.py +1 -1
  24. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/asyncio/test_bidi_async.py +15 -0
  25. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/asyncio/test_grpc_helpers_async.py +19 -14
  26. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/asyncio/test_operation_async.py +1 -1
  27. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/asyncio/test_rest_streaming_async.py +0 -2
  28. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/helpers.py +11 -0
  29. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/gapic/test_method.py +21 -0
  30. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/gapic/test_routing_header.py +2 -2
  31. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/operations_v1/test_operations_rest_client.py +52 -20
  32. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/retry/test_retry_base.py +20 -0
  33. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_bidi.py +10 -1
  34. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_client_logging.py +0 -1
  35. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_client_options.py +19 -19
  36. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_grpc_helpers.py +53 -110
  37. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_page_iterator.py +0 -1
  38. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_python_package_support.py +3 -11
  39. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_python_version_support.py +12 -8
  40. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_timeout.py +1 -1
  41. google_api_core-2.28.1/setup.cfg +0 -13
  42. {google_api_core-2.28.1 → google_api_core-2.30.0}/LICENSE +0 -0
  43. {google_api_core-2.28.1 → google_api_core-2.30.0}/MANIFEST.in +0 -0
  44. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/_rest_streaming_base.py +0 -0
  45. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/bidi_base.py +0 -0
  46. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/client_info.py +0 -0
  47. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/client_logging.py +0 -0
  48. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/client_options.py +0 -0
  49. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/datetime_helpers.py +0 -0
  50. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/exceptions.py +0 -0
  51. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/extended_operation.py +0 -0
  52. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/future/__init__.py +0 -0
  53. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/future/_helpers.py +0 -0
  54. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/future/async_future.py +0 -0
  55. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/future/base.py +0 -0
  56. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/future/polling.py +0 -0
  57. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/gapic_v1/__init__.py +0 -0
  58. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/gapic_v1/client_info.py +0 -0
  59. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/gapic_v1/config.py +0 -0
  60. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/gapic_v1/config_async.py +0 -0
  61. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/gapic_v1/method_async.py +0 -0
  62. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/gapic_v1/routing_header.py +0 -0
  63. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/general_helpers.py +0 -0
  64. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/iam.py +0 -0
  65. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/operation_async.py +0 -0
  66. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/operations_v1/__init__.py +0 -0
  67. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/operations_v1/abstract_operations_client.py +0 -0
  68. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/operations_v1/operations_async_client.py +0 -0
  69. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/operations_v1/operations_client.py +0 -0
  70. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/operations_v1/operations_client_config.py +0 -0
  71. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/operations_v1/operations_rest_client_async.py +0 -0
  72. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/operations_v1/transports/__init__.py +0 -0
  73. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/operations_v1/transports/rest.py +0 -0
  74. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/operations_v1/transports/rest_asyncio.py +0 -0
  75. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/page_iterator.py +0 -0
  76. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/page_iterator_async.py +0 -0
  77. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/path_template.py +0 -0
  78. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/protobuf_helpers.py +0 -0
  79. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/py.typed +0 -0
  80. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/rest_helpers.py +0 -0
  81. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/rest_streaming.py +0 -0
  82. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/rest_streaming_async.py +0 -0
  83. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/retry/__init__.py +0 -0
  84. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/retry/retry_streaming.py +0 -0
  85. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/retry/retry_streaming_async.py +0 -0
  86. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/retry/retry_unary.py +0 -0
  87. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/retry/retry_unary_async.py +0 -0
  88. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/retry_async.py +0 -0
  89. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/timeout.py +0 -0
  90. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/universe.py +0 -0
  91. {google_api_core-2.28.1 → google_api_core-2.30.0}/google/api_core/version_header.py +0 -0
  92. {google_api_core-2.28.1 → google_api_core-2.30.0}/google_api_core.egg-info/SOURCES.txt +0 -0
  93. {google_api_core-2.28.1 → google_api_core-2.30.0}/google_api_core.egg-info/dependency_links.txt +0 -0
  94. {google_api_core-2.28.1 → google_api_core-2.30.0}/google_api_core.egg-info/top_level.txt +0 -0
  95. {google_api_core-2.28.1 → google_api_core-2.30.0}/setup.py +0 -0
  96. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/__init__.py +0 -0
  97. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/asyncio/__init__.py +0 -0
  98. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/asyncio/future/__init__.py +0 -0
  99. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/asyncio/future/test_async_future.py +0 -0
  100. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/asyncio/gapic/test_config_async.py +0 -0
  101. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/asyncio/operations_v1/__init__.py +0 -0
  102. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/asyncio/operations_v1/test_operations_async_client.py +0 -0
  103. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/asyncio/retry/__init__.py +0 -0
  104. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/asyncio/retry/test_retry_streaming_async.py +0 -0
  105. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/asyncio/retry/test_retry_unary_async.py +0 -0
  106. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/asyncio/test_page_iterator_async.py +0 -0
  107. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/__init__.py +0 -0
  108. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/future/__init__.py +0 -0
  109. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/future/test__helpers.py +0 -0
  110. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/future/test_polling.py +0 -0
  111. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/gapic/test_client_info.py +0 -0
  112. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/gapic/test_config.py +0 -0
  113. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/operations_v1/__init__.py +0 -0
  114. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/operations_v1/test_operations_client.py +0 -0
  115. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/retry/__init__.py +0 -0
  116. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/retry/test_retry_imports.py +0 -0
  117. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/retry/test_retry_streaming.py +0 -0
  118. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/retry/test_retry_unary.py +0 -0
  119. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_client_info.py +0 -0
  120. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_datetime_helpers.py +0 -0
  121. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_exceptions.py +0 -0
  122. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_extended_operation.py +0 -0
  123. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_iam.py +0 -0
  124. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_operation.py +0 -0
  125. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_packaging.py +0 -0
  126. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_path_template.py +0 -0
  127. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_protobuf_helpers.py +0 -0
  128. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_rest_helpers.py +0 -0
  129. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_rest_streaming.py +0 -0
  130. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_universe.py +0 -0
  131. {google_api_core-2.28.1 → google_api_core-2.30.0}/tests/unit/test_version_header.py +0 -0
@@ -1,18 +1,17 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-api-core
3
- Version: 2.28.1
3
+ Version: 2.30.0
4
4
  Summary: Google API client core library
5
5
  Author-email: Google LLC <googleapis-packages@google.com>
6
6
  License: Apache 2.0
7
+ Project-URL: Homepage, https://github.com/googleapis/google-cloud-python/tree/main/packages/google-api-core
7
8
  Project-URL: Documentation, https://googleapis.dev/python/google-api-core/latest/
8
- Project-URL: Repository, https://github.com/googleapis/python-api-core
9
+ Project-URL: Repository, https://github.com/googleapis/google-cloud-python
9
10
  Classifier: Development Status :: 5 - Production/Stable
10
11
  Classifier: Intended Audience :: Developers
11
12
  Classifier: License :: OSI Approved :: Apache Software License
12
13
  Classifier: Programming Language :: Python
13
14
  Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.7
15
- Classifier: Programming Language :: Python :: 3.8
16
15
  Classifier: Programming Language :: Python :: 3.9
17
16
  Classifier: Programming Language :: Python :: 3.10
18
17
  Classifier: Programming Language :: Python :: 3.11
@@ -21,16 +20,15 @@ Classifier: Programming Language :: Python :: 3.13
21
20
  Classifier: Programming Language :: Python :: 3.14
22
21
  Classifier: Operating System :: OS Independent
23
22
  Classifier: Topic :: Internet
24
- Requires-Python: >=3.7
23
+ Requires-Python: >=3.9
25
24
  Description-Content-Type: text/x-rst
26
25
  License-File: LICENSE
27
- Requires-Dist: googleapis-common-protos<2.0.0,>=1.56.2
28
- Requires-Dist: protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<7.0.0,>=3.19.5
26
+ Requires-Dist: googleapis-common-protos<2.0.0,>=1.56.3
27
+ Requires-Dist: protobuf<7.0.0,>=4.25.8
29
28
  Requires-Dist: proto-plus<2.0.0,>=1.22.3
30
29
  Requires-Dist: proto-plus<2.0.0,>=1.25.0; python_version >= "3.13"
31
30
  Requires-Dist: google-auth<3.0.0,>=2.14.1
32
- Requires-Dist: requests<3.0.0,>=2.18.0
33
- Requires-Dist: importlib_metadata>=1.4; python_version < "3.8"
31
+ Requires-Dist: requests<3.0.0,>=2.20.0
34
32
  Provides-Extra: async-rest
35
33
  Requires-Dist: google-auth[aiohttp]<3.0.0,>=2.35.0; extra == "async-rest"
36
34
  Provides-Extra: grpc
@@ -40,10 +38,6 @@ Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14" and extra == "grp
40
38
  Requires-Dist: grpcio-status<2.0.0,>=1.33.2; extra == "grpc"
41
39
  Requires-Dist: grpcio-status<2.0.0,>=1.49.1; python_version >= "3.11" and extra == "grpc"
42
40
  Requires-Dist: grpcio-status<2.0.0,>=1.75.1; python_version >= "3.14" and extra == "grpc"
43
- Provides-Extra: grpcgcp
44
- Requires-Dist: grpcio-gcp<1.0.0,>=0.2.2; extra == "grpcgcp"
45
- Provides-Extra: grpcio-gcp
46
- Requires-Dist: grpcio-gcp<1.0.0,>=0.2.2; extra == "grpcio-gcp"
47
41
  Dynamic: license-file
48
42
 
49
43
  Core Library for Google Client Libraries
@@ -64,16 +58,19 @@ common helpers used by all Google API clients. For more information, see the
64
58
 
65
59
  Supported Python Versions
66
60
  -------------------------
67
- Python >= 3.7
61
+ Python >= 3.9
68
62
 
69
63
 
70
64
  Unsupported Python Versions
71
65
  ---------------------------
72
66
 
73
- Python == 2.7, Python == 3.5, Python == 3.6.
67
+ Python == 2.7, Python == 3.5, Python == 3.6, Python == 3.7, Python == 3.8.
74
68
 
75
69
  The last version of this library compatible with Python 2.7 and 3.5 is
76
70
  `google-api-core==1.31.1`.
77
71
 
78
72
  The last version of this library compatible with Python 3.6 is
79
73
  `google-api-core==2.8.2`.
74
+
75
+ The last version of this library compatible with Python 3.7 and 3.8 is
76
+ `google-api-core==2.29.0`.
@@ -16,16 +16,19 @@ common helpers used by all Google API clients. For more information, see the
16
16
 
17
17
  Supported Python Versions
18
18
  -------------------------
19
- Python >= 3.7
19
+ Python >= 3.9
20
20
 
21
21
 
22
22
  Unsupported Python Versions
23
23
  ---------------------------
24
24
 
25
- Python == 2.7, Python == 3.5, Python == 3.6.
25
+ Python == 2.7, Python == 3.5, Python == 3.6, Python == 3.7, Python == 3.8.
26
26
 
27
27
  The last version of this library compatible with Python 2.7 and 3.5 is
28
28
  `google-api-core==1.31.1`.
29
29
 
30
30
  The last version of this library compatible with Python 3.6 is
31
31
  `google-api-core==2.8.2`.
32
+
33
+ The last version of this library compatible with Python 3.7 and 3.8 is
34
+ `google-api-core==2.29.0`.
@@ -30,6 +30,7 @@ __version__ = api_core_version.__version__
30
30
  # expose dependency checks for external callers
31
31
  check_python_version = _python_version_support.check_python_version
32
32
  check_dependency_versions = _python_package_support.check_dependency_versions
33
+ parse_version_to_tuple = _python_package_support.parse_version_to_tuple
33
34
  warn_deprecation_for_versions_less_than = (
34
35
  _python_package_support.warn_deprecation_for_versions_less_than
35
36
  )
@@ -15,7 +15,6 @@
15
15
  """Code to check versions of dependencies used by Google Cloud Client Libraries."""
16
16
 
17
17
  import warnings
18
- import sys
19
18
  from typing import Optional, Tuple
20
19
 
21
20
  from collections import namedtuple
@@ -25,12 +24,7 @@ from ._python_version_support import (
25
24
  _get_distribution_and_import_packages,
26
25
  )
27
26
 
28
- if sys.version_info >= (3, 8):
29
- from importlib import metadata
30
- else:
31
- # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
32
- # this code path once we drop support for Python 3.7
33
- import importlib_metadata as metadata
27
+ from importlib import metadata
34
28
 
35
29
  ParsedVersion = Tuple[int, ...]
36
30
 
@@ -85,8 +79,7 @@ def get_dependency_version(
85
79
  """Get the parsed version of an installed package dependency.
86
80
 
87
81
  This function checks for an installed package and returns its version
88
- as a comparable tuple of integers object for safe comparison. It handles
89
- both modern (Python 3.8+) and legacy (Python 3.7) environments.
82
+ as a comparable tuple of integers object for safe comparison.
90
83
 
91
84
  Args:
92
85
  dependency_name: The distribution name of the package (e.g., 'requests').
@@ -16,12 +16,16 @@
16
16
 
17
17
  import datetime
18
18
  import enum
19
+ import logging
19
20
  import warnings
20
21
  import sys
21
22
  import textwrap
22
23
  from typing import Any, List, NamedTuple, Optional, Dict, Tuple
23
24
 
24
25
 
26
+ _LOGGER = logging.getLogger(__name__)
27
+
28
+
25
29
  class PythonVersionStatus(enum.Enum):
26
30
  """Support status of a Python version in this client library artifact release.
27
31
 
@@ -147,9 +151,11 @@ def _flatten_message(text: str) -> str:
147
151
  return " ".join(textwrap.dedent(text).strip().split())
148
152
 
149
153
 
150
- # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove once we
151
- # no longer support Python 3.7
152
- if sys.version_info < (3, 8):
154
+ # TODO(https://github.com/googleapis/python-api-core/issues/835):
155
+ # Remove once we no longer support Python 3.9.
156
+ # `importlib.metadata.packages_distributions()` is only supported in Python 3.10 and newer
157
+ # https://docs.python.org/3/library/importlib.metadata.html#importlib.metadata.packages_distributions
158
+ if sys.version_info < (3, 10):
153
159
 
154
160
  def _get_pypi_package_name(module_name): # pragma: NO COVER
155
161
  """Determine the PyPI package name for a given module name."""
@@ -168,11 +174,14 @@ else:
168
174
  if module_name in module_to_distributions: # pragma: NO COVER
169
175
  # The value is a list of distribution names, take the first one
170
176
  return module_to_distributions[module_name][0]
171
- else:
172
- return None # Module not found in the mapping
173
- except Exception as e:
174
- print(f"An error occurred: {e}")
175
- return None
177
+ except Exception as e: # pragma: NO COVER
178
+ _LOGGER.info(
179
+ "An error occurred while determining PyPI package name for %s: %s",
180
+ module_name,
181
+ e,
182
+ )
183
+
184
+ return None
176
185
 
177
186
 
178
187
  def _get_distribution_and_import_packages(import_package: str) -> Tuple[str, Any]:
@@ -281,11 +281,11 @@ class BidiRpc(BidiRpcBase):
281
281
 
282
282
  def close(self):
283
283
  """Closes the stream."""
284
- if self.call is None:
285
- return
284
+ if self.call is not None:
285
+ self.call.cancel()
286
286
 
287
+ # Put None in request queue to signal termination.
287
288
  self._request_queue.put(None)
288
- self.call.cancel()
289
289
  self._request_generator = None
290
290
  self._initial_request = None
291
291
  self._callbacks = []
@@ -197,11 +197,11 @@ class AsyncBidiRpc(BidiRpcBase):
197
197
 
198
198
  async def close(self) -> None:
199
199
  """Closes the stream."""
200
- if self.call is None:
201
- return
200
+ if self.call is not None:
201
+ self.call.cancel()
202
202
 
203
+ # Put None in request queue to signal termination.
203
204
  await self._request_queue.put(None)
204
- self.call.cancel()
205
205
  self._request_generator = None
206
206
  self._initial_request = None
207
207
  self._callbacks = []
@@ -31,9 +31,6 @@ USE_DEFAULT_METADATA = object()
31
31
  class _MethodDefault(enum.Enum):
32
32
  # Uses enum so that pytype/mypy knows that this is the only possible value.
33
33
  # https://stackoverflow.com/a/60605919/101923
34
- #
35
- # Literal[_DEFAULT_VALUE] is an alternative, but only added in Python 3.8.
36
- # https://docs.python.org/3/library/typing.html#typing.Literal
37
34
  _DEFAULT_VALUE = object()
38
35
 
39
36
 
@@ -27,26 +27,6 @@ import grpc
27
27
 
28
28
  from google.api_core import exceptions, general_helpers
29
29
 
30
- PROTOBUF_VERSION = google.protobuf.__version__
31
-
32
- # The grpcio-gcp package only has support for protobuf < 4
33
- if PROTOBUF_VERSION[0:2] == "3.": # pragma: NO COVER
34
- try:
35
- import grpc_gcp
36
-
37
- warnings.warn(
38
- """Support for grpcio-gcp is deprecated. This feature will be
39
- removed from `google-api-core` after January 1, 2024. If you need to
40
- continue to use this feature, please pin to a specific version of
41
- `google-api-core`.""",
42
- DeprecationWarning,
43
- )
44
- HAS_GRPC_GCP = True
45
- except ImportError:
46
- HAS_GRPC_GCP = False
47
- else:
48
- HAS_GRPC_GCP = False
49
-
50
30
 
51
31
  # The list of gRPC Callable interfaces that return iterators.
52
32
  _STREAM_WRAP_CLASSES = (grpc.UnaryStreamMultiCallable, grpc.StreamStreamMultiCallable)
@@ -366,8 +346,7 @@ def create_channel(
366
346
  result in `ValueError` as this combination is not yet supported.
367
347
 
368
348
  kwargs: Additional key-word args passed to
369
- :func:`grpc_gcp.secure_channel` or :func:`grpc.secure_channel`.
370
- Note: `grpc_gcp` is only supported in environments with protobuf < 4.0.0.
349
+ :func:`grpc.secure_channel`.
371
350
 
372
351
  Returns:
373
352
  grpc.Channel: The created channel.
@@ -393,20 +372,6 @@ def create_channel(
393
372
  default_host=default_host,
394
373
  )
395
374
 
396
- # Note that grpcio-gcp is deprecated
397
- if HAS_GRPC_GCP: # pragma: NO COVER
398
- if compression is not None and compression != grpc.Compression.NoCompression:
399
- warnings.warn(
400
- "The `compression` argument is ignored for grpc_gcp.secure_channel creation.",
401
- DeprecationWarning,
402
- )
403
- if attempt_direct_path:
404
- warnings.warn(
405
- """The `attempt_direct_path` argument is ignored for grpc_gcp.secure_channel creation.""",
406
- DeprecationWarning,
407
- )
408
- return grpc_gcp.secure_channel(target, composite_credentials, **kwargs)
409
-
410
375
  if attempt_direct_path:
411
376
  target = _modify_target_for_direct_path(target)
412
377
 
@@ -220,7 +220,7 @@ def create_channel(
220
220
  default_host=None,
221
221
  compression=None,
222
222
  attempt_direct_path: Optional[bool] = False,
223
- **kwargs
223
+ **kwargs,
224
224
  ):
225
225
  """Create an AsyncIO secure channel with credentials.
226
226
 
@@ -78,7 +78,7 @@ class Operation(polling.PollingFuture):
78
78
  result_type,
79
79
  metadata_type=None,
80
80
  polling=polling.DEFAULT_POLLING,
81
- **kwargs
81
+ **kwargs,
82
82
  ):
83
83
  super(Operation, self).__init__(polling=polling, **kwargs)
84
84
  self._operation = operation
@@ -300,16 +300,22 @@ class AbstractOperationsBaseClient(metaclass=AbstractOperationsBaseClientMeta):
300
300
  client_options = client_options_lib.ClientOptions()
301
301
 
302
302
  # Create SSL credentials for mutual TLS if needed.
303
- use_client_cert = os.getenv(
304
- "GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"
305
- ).lower()
306
- if use_client_cert not in ("true", "false"):
307
- raise ValueError(
308
- "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`"
309
- )
303
+ if hasattr(mtls, "should_use_client_cert"):
304
+ use_client_cert = mtls.should_use_client_cert()
305
+ else:
306
+ # if unsupported, fallback to reading from env var
307
+ use_client_cert_str = os.getenv(
308
+ "GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"
309
+ ).lower()
310
+ if use_client_cert_str not in ("true", "false"):
311
+ raise ValueError(
312
+ "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be"
313
+ " either `true` or `false`"
314
+ )
315
+ use_client_cert = use_client_cert_str == "true"
310
316
  client_cert_source_func = None
311
317
  is_mtls = False
312
- if use_client_cert == "true":
318
+ if use_client_cert:
313
319
  if client_options.client_cert_source:
314
320
  is_mtls = True
315
321
  client_cert_source_func = client_options.client_cert_source
@@ -48,7 +48,7 @@ class ListOperationsPager(ListOperationsPagerBase):
48
48
  request: operations_pb2.ListOperationsRequest,
49
49
  response: operations_pb2.ListOperationsResponse,
50
50
  *,
51
- metadata: Sequence[Tuple[str, str]] = ()
51
+ metadata: Sequence[Tuple[str, str]] = (),
52
52
  ):
53
53
  super().__init__(
54
54
  method=method, request=request, response=response, metadata=metadata
@@ -48,7 +48,7 @@ class ListOperationsAsyncPager(ListOperationsPagerBase):
48
48
  request: operations_pb2.ListOperationsRequest,
49
49
  response: operations_pb2.ListOperationsResponse,
50
50
  *,
51
- metadata: Sequence[Tuple[str, str]] = ()
51
+ metadata: Sequence[Tuple[str, str]] = (),
52
52
  ):
53
53
  super().__init__(
54
54
  method=method, request=request, response=response, metadata=metadata
@@ -47,7 +47,7 @@ class ListOperationsPagerBase:
47
47
  request: operations_pb2.ListOperationsRequest,
48
48
  response: operations_pb2.ListOperationsResponse,
49
49
  *,
50
- metadata: Sequence[Tuple[str, str]] = ()
50
+ metadata: Sequence[Tuple[str, str]] = (),
51
51
  ):
52
52
  """Instantiate the pager.
53
53
 
@@ -119,8 +119,6 @@ class OperationsTransport(abc.ABC):
119
119
  host += ":443" # pragma: NO COVER
120
120
  self._host = host
121
121
 
122
- scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
123
-
124
122
  # Save the scopes.
125
123
  self._scopes = scopes
126
124
 
@@ -133,12 +131,17 @@ class OperationsTransport(abc.ABC):
133
131
 
134
132
  if credentials_file is not None:
135
133
  credentials, _ = google.auth.load_credentials_from_file(
136
- credentials_file, **scopes_kwargs, quota_project_id=quota_project_id
134
+ credentials_file,
135
+ scopes=scopes,
136
+ quota_project_id=quota_project_id,
137
+ default_scopes=self.AUTH_SCOPES,
137
138
  )
138
139
 
139
140
  elif credentials is None:
140
141
  credentials, _ = google.auth.default(
141
- **scopes_kwargs, quota_project_id=quota_project_id
142
+ scopes=scopes,
143
+ quota_project_id=quota_project_id,
144
+ default_scopes=self.AUTH_SCOPES,
142
145
  )
143
146
 
144
147
  # If the credentials are service account credentials, then always try to use self signed JWT.
@@ -164,8 +164,10 @@ def build_retry_error(
164
164
  src_exc,
165
165
  )
166
166
  elif exc_list:
167
- # return most recent exception encountered
168
- return exc_list[-1], None
167
+ # return most recent exception encountered and its cause
168
+ final_exc = exc_list[-1]
169
+ cause = getattr(final_exc, "__cause__", None)
170
+ return final_exc, cause
169
171
  else:
170
172
  # no exceptions were given in exc_list. Raise generic RetryError
171
173
  return exceptions.RetryError("Unknown error", None), None
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = "2.28.1"
15
+ __version__ = "2.30.0"
@@ -1,18 +1,17 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-api-core
3
- Version: 2.28.1
3
+ Version: 2.30.0
4
4
  Summary: Google API client core library
5
5
  Author-email: Google LLC <googleapis-packages@google.com>
6
6
  License: Apache 2.0
7
+ Project-URL: Homepage, https://github.com/googleapis/google-cloud-python/tree/main/packages/google-api-core
7
8
  Project-URL: Documentation, https://googleapis.dev/python/google-api-core/latest/
8
- Project-URL: Repository, https://github.com/googleapis/python-api-core
9
+ Project-URL: Repository, https://github.com/googleapis/google-cloud-python
9
10
  Classifier: Development Status :: 5 - Production/Stable
10
11
  Classifier: Intended Audience :: Developers
11
12
  Classifier: License :: OSI Approved :: Apache Software License
12
13
  Classifier: Programming Language :: Python
13
14
  Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.7
15
- Classifier: Programming Language :: Python :: 3.8
16
15
  Classifier: Programming Language :: Python :: 3.9
17
16
  Classifier: Programming Language :: Python :: 3.10
18
17
  Classifier: Programming Language :: Python :: 3.11
@@ -21,16 +20,15 @@ Classifier: Programming Language :: Python :: 3.13
21
20
  Classifier: Programming Language :: Python :: 3.14
22
21
  Classifier: Operating System :: OS Independent
23
22
  Classifier: Topic :: Internet
24
- Requires-Python: >=3.7
23
+ Requires-Python: >=3.9
25
24
  Description-Content-Type: text/x-rst
26
25
  License-File: LICENSE
27
- Requires-Dist: googleapis-common-protos<2.0.0,>=1.56.2
28
- Requires-Dist: protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<7.0.0,>=3.19.5
26
+ Requires-Dist: googleapis-common-protos<2.0.0,>=1.56.3
27
+ Requires-Dist: protobuf<7.0.0,>=4.25.8
29
28
  Requires-Dist: proto-plus<2.0.0,>=1.22.3
30
29
  Requires-Dist: proto-plus<2.0.0,>=1.25.0; python_version >= "3.13"
31
30
  Requires-Dist: google-auth<3.0.0,>=2.14.1
32
- Requires-Dist: requests<3.0.0,>=2.18.0
33
- Requires-Dist: importlib_metadata>=1.4; python_version < "3.8"
31
+ Requires-Dist: requests<3.0.0,>=2.20.0
34
32
  Provides-Extra: async-rest
35
33
  Requires-Dist: google-auth[aiohttp]<3.0.0,>=2.35.0; extra == "async-rest"
36
34
  Provides-Extra: grpc
@@ -40,10 +38,6 @@ Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14" and extra == "grp
40
38
  Requires-Dist: grpcio-status<2.0.0,>=1.33.2; extra == "grpc"
41
39
  Requires-Dist: grpcio-status<2.0.0,>=1.49.1; python_version >= "3.11" and extra == "grpc"
42
40
  Requires-Dist: grpcio-status<2.0.0,>=1.75.1; python_version >= "3.14" and extra == "grpc"
43
- Provides-Extra: grpcgcp
44
- Requires-Dist: grpcio-gcp<1.0.0,>=0.2.2; extra == "grpcgcp"
45
- Provides-Extra: grpcio-gcp
46
- Requires-Dist: grpcio-gcp<1.0.0,>=0.2.2; extra == "grpcio-gcp"
47
41
  Dynamic: license-file
48
42
 
49
43
  Core Library for Google Client Libraries
@@ -64,16 +58,19 @@ common helpers used by all Google API clients. For more information, see the
64
58
 
65
59
  Supported Python Versions
66
60
  -------------------------
67
- Python >= 3.7
61
+ Python >= 3.9
68
62
 
69
63
 
70
64
  Unsupported Python Versions
71
65
  ---------------------------
72
66
 
73
- Python == 2.7, Python == 3.5, Python == 3.6.
67
+ Python == 2.7, Python == 3.5, Python == 3.6, Python == 3.7, Python == 3.8.
74
68
 
75
69
  The last version of this library compatible with Python 2.7 and 3.5 is
76
70
  `google-api-core==1.31.1`.
77
71
 
78
72
  The last version of this library compatible with Python 3.6 is
79
73
  `google-api-core==2.8.2`.
74
+
75
+ The last version of this library compatible with Python 3.7 and 3.8 is
76
+ `google-api-core==2.29.0`.
@@ -1,11 +1,8 @@
1
- googleapis-common-protos<2.0.0,>=1.56.2
2
- protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<7.0.0,>=3.19.5
1
+ googleapis-common-protos<2.0.0,>=1.56.3
2
+ protobuf<7.0.0,>=4.25.8
3
3
  proto-plus<2.0.0,>=1.22.3
4
4
  google-auth<3.0.0,>=2.14.1
5
- requests<3.0.0,>=2.18.0
6
-
7
- [:python_version < "3.8"]
8
- importlib_metadata>=1.4
5
+ requests<3.0.0,>=2.20.0
9
6
 
10
7
  [:python_version >= "3.13"]
11
8
  proto-plus<2.0.0,>=1.25.0
@@ -24,9 +21,3 @@ grpcio-status<2.0.0,>=1.49.1
24
21
  [grpc:python_version >= "3.14"]
25
22
  grpcio<2.0.0,>=1.75.1
26
23
  grpcio-status<2.0.0,>=1.75.1
27
-
28
- [grpcgcp]
29
- grpcio-gcp<1.0.0,>=0.2.2
30
-
31
- [grpcio-gcp]
32
- grpcio-gcp<1.0.0,>=0.2.2
@@ -20,7 +20,7 @@ build-backend = "setuptools.build_meta"
20
20
  name = "google-api-core"
21
21
  authors = [{ name = "Google LLC", email = "googleapis-packages@google.com" }]
22
22
  license = { text = "Apache 2.0" }
23
- requires-python = ">=3.7"
23
+ requires-python = ">=3.9"
24
24
  readme = "README.rst"
25
25
  description = "Google API client core library"
26
26
  classifiers = [
@@ -33,8 +33,7 @@ classifiers = [
33
33
  "License :: OSI Approved :: Apache Software License",
34
34
  "Programming Language :: Python",
35
35
  "Programming Language :: Python :: 3",
36
- "Programming Language :: Python :: 3.7",
37
- "Programming Language :: Python :: 3.8",
36
+
38
37
  "Programming Language :: Python :: 3.9",
39
38
  "Programming Language :: Python :: 3.10",
40
39
  "Programming Language :: Python :: 3.11",
@@ -45,21 +44,19 @@ classifiers = [
45
44
  "Topic :: Internet",
46
45
  ]
47
46
  dependencies = [
48
- "googleapis-common-protos >= 1.56.2, < 2.0.0",
49
- "protobuf >= 3.19.5, < 7.0.0, != 3.20.0, != 3.20.1, != 4.21.0, != 4.21.1, != 4.21.2, != 4.21.3, != 4.21.4, != 4.21.5",
47
+ "googleapis-common-protos >= 1.56.3, < 2.0.0",
48
+ "protobuf >= 4.25.8, < 7.0.0",
50
49
  "proto-plus >= 1.22.3, < 2.0.0",
51
50
  "proto-plus >= 1.25.0, < 2.0.0; python_version >= '3.13'",
52
51
  "google-auth >= 2.14.1, < 3.0.0",
53
- "requests >= 2.18.0, < 3.0.0",
54
- # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
55
- # `importlib_metadata` once we drop support for Python 3.7
56
- "importlib_metadata>=1.4; python_version<'3.8'",
52
+ "requests >= 2.20.0, < 3.0.0",
57
53
  ]
58
54
  dynamic = ["version"]
59
55
 
60
56
  [project.urls]
57
+ Homepage = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-api-core"
61
58
  Documentation = "https://googleapis.dev/python/google-api-core/latest/"
62
- Repository = "https://github.com/googleapis/python-api-core"
59
+ Repository = "https://github.com/googleapis/google-cloud-python"
63
60
 
64
61
  [project.optional-dependencies]
65
62
  async_rest = ["google-auth[aiohttp] >= 2.35.0, < 3.0.0"]
@@ -71,8 +68,7 @@ grpc = [
71
68
  "grpcio-status >= 1.49.1, < 2.0.0; python_version >= '3.11'",
72
69
  "grpcio-status >= 1.75.1, < 2.0.0; python_version >= '3.14'",
73
70
  ]
74
- grpcgcp = ["grpcio-gcp >= 0.2.2, < 1.0.0"]
75
- grpcio-gcp = ["grpcio-gcp >= 0.2.2, < 1.0.0"]
71
+
76
72
 
77
73
  [tool.setuptools.dynamic]
78
74
  version = { attr = "google.api_core.version.__version__" }
@@ -83,7 +79,7 @@ version = { attr = "google.api_core.version.__version__" }
83
79
  include = ["google*"]
84
80
 
85
81
  [tool.mypy]
86
- python_version = "3.7"
82
+ python_version = "3.14"
87
83
  namespace_packages = true
88
84
  ignore_missing_imports = true
89
85
 
@@ -91,23 +87,18 @@ ignore_missing_imports = true
91
87
  filterwarnings = [
92
88
  # treat all warnings as errors
93
89
  "error",
90
+ # Prevent Python version warnings from interfering with tests
91
+ "ignore:.* Python version .*:FutureWarning",
94
92
  # Remove once https://github.com/pytest-dev/pytest-cov/issues/621 is fixed
95
93
  "ignore:.*The --rsyncdir command line argument and rsyncdirs config variable are deprecated:DeprecationWarning",
96
94
  # Remove once https://github.com/protocolbuffers/protobuf/issues/12186 is fixed
97
95
  "ignore:.*custom tp_new.*in Python 3.14:DeprecationWarning",
98
- # Remove once support for python 3.7 is dropped
99
- # This warning only appears when using python 3.7
100
- "ignore:.*Using or importing the ABCs from.*collections:DeprecationWarning",
101
- # Remove once support for grpcio-gcp is deprecated
102
- # See https://github.com/googleapis/python-api-core/blob/42e8b6e6f426cab749b34906529e8aaf3f133d75/google/api_core/grpc_helpers.py#L39-L45
103
- "ignore:.*Support for grpcio-gcp is deprecated:DeprecationWarning",
104
- "ignore: The `compression` argument is ignored for grpc_gcp.secure_channel creation:DeprecationWarning",
105
- "ignore:The `attempt_direct_path` argument is ignored for grpc_gcp.secure_channel creation:DeprecationWarning",
96
+
97
+
106
98
  # Remove once the minimum supported version of googleapis-common-protos is 1.62.0
107
99
  "ignore:.*pkg_resources.declare_namespace:DeprecationWarning",
108
100
  "ignore:.*pkg_resources is deprecated as an API:DeprecationWarning",
109
101
  # Remove once https://github.com/grpc/grpc/issues/35086 is fixed (and version newer than 1.60.0 is published)
110
102
  "ignore:There is no current event loop:DeprecationWarning",
111
- # Remove after support for Python 3.7 is dropped
112
- "ignore:After January 1, 2024, new releases of this library will drop support for Python 3.7:DeprecationWarning",
103
+
113
104
  ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -260,7 +260,7 @@ async def test_wrap_method_with_overriding_timeout_as_a_number():
260
260
  actual_timeout = method.call_args[1]["timeout"]
261
261
  metadata = method.call_args[1]["metadata"]
262
262
  assert metadata == mock.ANY
263
- assert actual_timeout == pytest.approx(22, abs=0.01)
263
+ assert actual_timeout == pytest.approx(22, abs=0.05)
264
264
 
265
265
 
266
266
  @pytest.mark.asyncio