Skip to content

Commit 9aa301a

Browse files
fix: Add async context manager return types (#11444)
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 98bddda commit 9aa301a

File tree

532 files changed

+51479
-484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

532 files changed

+51479
-484
lines changed

packages/google-ai-generativelanguage/google/ai/generativelanguage/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.3.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta2/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.3.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta2/services/discuss_service/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ async def sample_count_message_tokens():
528528
# Done; return the response.
529529
return response
530530

531-
async def __aenter__(self):
531+
async def __aenter__(self) -> "DiscussServiceAsyncClient":
532532
return self
533533

534534
async def __aexit__(self, exc_type, exc, tb):

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta2/services/model_service/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ async def sample_list_models():
446446
# Done; return the response.
447447
return response
448448

449-
async def __aenter__(self):
449+
async def __aenter__(self) -> "ModelServiceAsyncClient":
450450
return self
451451

452452
async def __aexit__(self, exc_type, exc, tb):

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta2/services/text_service/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ async def sample_embed_text():
537537
# Done; return the response.
538538
return response
539539

540-
async def __aenter__(self):
540+
async def __aenter__(self) -> "TextServiceAsyncClient":
541541
return self
542542

543543
async def __aexit__(self, exc_type, exc, tb):

packages/google-ai-generativelanguage/samples/generated_samples/snippet_metadata_google.ai.generativelanguage.v1beta2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-ai-generativelanguage",
11-
"version": "0.3.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-ai-generativelanguage/tests/unit/gapic/generativelanguage_v1beta2/test_model_service.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,9 +1319,11 @@ async def test_list_models_async_pages():
13191319
RuntimeError,
13201320
)
13211321
pages = []
1322-
async for page_ in (
1322+
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
1323+
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
1324+
async for page_ in ( # pragma: no branch
13231325
await client.list_models(request={})
1324-
).pages: # pragma: no branch
1326+
).pages:
13251327
pages.append(page_)
13261328
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
13271329
assert page_.raw_page.next_page_token == token

packages/google-apps-script-type/CONTRIBUTING.rst

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -239,18 +239,6 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
239239
.. _config: https://github.com/googleapis/google-cloud-python/blob/main/noxfile.py
240240

241241

242-
We also explicitly decided to support Python 3 beginning with version 3.7.
243-
Reasons for this include:
244-
245-
- Encouraging use of newest versions of Python 3
246-
- Taking the lead of `prominent`_ open-source `projects`_
247-
- `Unicode literal support`_ which allows for a cleaner codebase that
248-
works in both Python 2 and Python 3
249-
250-
.. _prominent: https://docs.djangoproject.com/en/1.9/faq/install/#what-python-version-can-i-use-with-django
251-
.. _projects: http://flask.pocoo.org/docs/0.10/python3/
252-
.. _Unicode literal support: https://www.python.org/dev/peps/pep-0414/
253-
254242
**********
255243
Versioning
256244
**********

packages/google-apps-script-type/google/apps/script/type/calendar/gapic_version.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
17-
__version__ = "0.3.2" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-apps-script-type/google/apps/script/type/docs/gapic_version.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
17-
__version__ = "0.3.2" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

0 commit comments

Comments
 (0)