8000 fix: Allow Protobuf 5.x by gcf-owl-bot[bot] · Pull Request #12869 · googleapis/google-cloud-python · GitHub
[go: up one dir, main page]

Skip to content 8000
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.21.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.21.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def __init__(

# Save the scopes.
self._scopes = scopes
if not hasattr(self, "_ignore_credentials"):
self._ignore_credentials: bool = False

# If no credentials are provided, then determine the appropriate
# defaults.
Expand All @@ -94,7 +96,7 @@ def __init__(
credentials, _ = google.auth.load_credentials_from_file(
credentials_file, **scopes_kwargs, quota_project_id=quota_project_id
)
elif credentials is None:
elif credentials is None and not self._ignore_credentials:
credentials, _ = google.auth.default(
**scopes_kwargs, quota_project_id=quota_project_id
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ def __init__(

if isinstance(channel, grpc.Channel):
# Ignore credentials if a channel was passed.
credentials = False
credentials = None
self._ignore_credentials = True
# If a channel was explicitly provided, set it.
self._grpc_channel = channel
self._ssl_channel_credentials = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ def __init__(

if isinstance(channel, aio.Channel):
# Ignore credentials if a channel was passed.
credentials = False
credentials = None
self._ignore_credentials = True
# If a channel was explicitly provided, set it.
self._grpc_channel = channel
self._ssl_channel_credentials = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-recaptcha-enterprise",
"version": "1.21.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-recaptcha-enterprise/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
# See https://github.com/googleapis/google-cloud-python/issues/12364
"google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0",
"proto-plus >= 1.22.3, <2.0.0dev",
"protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
"protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
]
url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-recaptcha-enterprise"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
google-api-core==1.34.1
google-auth==2.14.1
proto-plus==1.22.3
protobuf==3.19.5
protobuf==3.20.2
< 5044 /tr>
Original file line number Diff line number Diff line change
Expand Up @@ -1328,12 +1328,7 @@ async def test_create_assessment_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.create_assessment
] = mock_object
Expand Down Expand Up @@ -1727,12 +1722,7 @@ async def test_annotate_assessment_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.annotate_assessment
] = mock_object
Expand Down Expand Up @@ -2115,12 +2105,7 @@ async def test_create_key_async_use_cached_wrapped_rpc(transport: str = "grpc_as
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.create_key
] = mock_object
Expand Down Expand Up @@ -2496,12 +2481,7 @@ async def test_list_keys_async_use_cached_wrapped_rpc(transport: str = "grpc_asy
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.list_keys
] = mock_object
Expand Down Expand Up @@ -3068,12 +3048,7 @@ async def test_retrieve_legacy_secret_key_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.retrieve_legacy_secret_key
] = mock_object
Expand Down Expand Up @@ -3449,12 +3424,7 @@ async def test_get_key_async_use_cached_wrapped_rpc(transport: str = "grpc_async
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.get_key
] = mock_object
Expand Down Expand Up @@ -3817,12 +3787,7 @@ async def test_update_key_async_use_cached_wrapped_rpc(transport: str = "grpc_as
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.update_key
] = mock_object
Expand Down Expand Up @@ -4189,12 +4154,7 @@ async def test_delete_key_async_use_cached_wrapped_rpc(transport: str = "grpc_as
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.delete_key
] = mock_object
Expand Down Expand Up @@ -4552,12 +4512,7 @@ async def test_migrate_key_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.migrate_key
] = mock_object
Expand Down Expand Up @@ -4841,12 +4796,7 @@ async def test_get_metrics_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.get_metrics
] = mock_object
Expand Down Expand Up @@ -5232,12 +5182,7 @@ async def test_create_firewall_policy_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.create_firewall_policy
] = mock_object
Expand Down Expand Up @@ -5643,12 +5588,7 @@ async def test_list_firewall_policies_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.list_firewall_policies
] = mock_object
Expand Down Expand Up @@ -6242,12 +6182,7 @@ async def test_get_firewall_policy_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.get_firewall_policy
] = mock_object
Expand Down Expand Up @@ -6646,12 +6581,7 @@ async def test_update_firewall_policy_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.update_firewall_policy
] = mock_object
Expand Down Expand Up @@ -7048,12 +6978,7 @@ async def test_delete_firewall_policy_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.delete_firewall_policy
] = mock_object
Expand Down Expand Up @@ -7427,12 +7352,7 @@ async def test_reorder_firewall_policies_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.reorder_firewall_policies
] = mock_object
Expand Down Expand Up @@ -7829,12 +7749,7 @@ async def test_list_related_account_groups_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.list_related_account_groups
] = mock_object
Expand Down Expand Up @@ -8432,12 +8347,7 @@ async def test_list_related_account_group_memberships_async_use_cached_wrapped_r
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.list_related_account_group_memberships
] = mock_object
Expand Down Expand Up @@ -9049,12 +8959,7 @@ async def test_search_related_account_group_memberships_async_use_cached_wrapped
)

# Replace cached wrapped function with mock
class AwaitableMock(mock.AsyncMock):
def __await__(self):
self.await_count += 1
return iter([])

mock_object = AwaitableMock()
mock_object = mock.AsyncMock()
client._client._transport._wrapped_methods[
client._client._transport.search_related_account_group_memberships
] = mock_object
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-recommendations-ai/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Python Client for Recommendations AI
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-recommendations-ai.svg
:target: https://pypi.org/project/google-cloud-recommendations-ai/
.. _Recommendations AI: https://cloud.google.com/recommendations-ai/
.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/recommendationengine/latest
.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/recommendationengine/latest/summary_overview
.. _Product Documentation: https://cloud.google.com/recommendations-ai/

Quick Start
Expand Down
5 changes: 5 additions & 0 deletions packages/google-cloud-recommendations-ai/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ For a list of all ``google-cloud-recommendations-ai`` releases:
:maxdepth: 2

CHANGELOG

.. toctree::
:hidden:

summary_overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
This is a templated file. Adding content to this file may result in it being
reverted. Instead, if you want to place additional content, create an
"overview_content.md" file in `docs/` directory. The Sphinx tool will
pick up on the content and merge the content.
]: #

# Recommendations AI API

Overview of the APIs available for Recommendations AI API.

## All entries

Classes, methods and properties & attributes for
Recommendations AI API.

[classes](https://cloud.google.com/python/docs/reference/recommendationengine/latest/summary_class.html)

[methods](https://cloud.google.com/python/docs/reference/recommendationengine/latest/summary_method.html)

[properties and
attributes](https://cloud.google.com/python/docs/reference/recommendationengine/latest/summary_property.html)
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def __init__(

# Save the scopes.
self._scopes = scopes
if not hasattr(self, "_ignore_credentials"):
self._ignore_credentials: bool = False

# If no credentials are provided, then determine the appropriate
# defaults.
Expand All @@ -99,7 +101,7 @@ def __init__(
credentials, _ = google.auth.load_credentials_from_file(
credentials_file, **scopes_kwargs, quota_project_id=quota_project_id
)
elif credentials is None:
elif credentials is None and not self._ignore_credentials:
credentials, _ = google.auth.default(
**scopes_kwargs, quota_project_id=quota_project_id
)
Expand Down
Loading
0