From f920d22f59fbd31822252b9677416a6cd436eba2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 1 Dec 2023 17:45:48 +0000 Subject: [PATCH] feat: [Many APIs] added Generator API (#12076) - [ ] Regenerate this pull request now. docs: updated doc for speech mode PiperOrigin-RevId: 586469693 Source-Link: https://github.com/googleapis/googleapis/commit/e8148d6d4bb02c907e06a784848ef731acb9e258 Source-Link: https://github.com/googleapis/googleapis-gen/commit/85136bd04383ed7172bb18b7b8d220dd7ff6b3a0 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRyYWNlLy5Pd2xCb3QueWFtbCIsImgiOiI4NTEzNmJkMDQzODNlZDcxNzJiYjE4YjdiOGQyMjBkZDdmZjZiM2EwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRyYW5zbGF0ZS8uT3dsQm90LnlhbWwiLCJoIjoiODUxMzZiZDA0MzgzZWQ3MTcyYmIxOGI3YjhkMjIwZGQ3ZmY2YjNhMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZpZGVvaW50ZWxsaWdlbmNlLy5Pd2xCb3QueWFtbCIsImgiOiI4NTEzNmJkMDQzODNlZDcxNzJiYjE4YjdiOGQyMjBkZDdmZjZiM2EwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZpc2lvbi8uT3dsQm90LnlhbWwiLCJoIjoiODUxMzZiZDA0MzgzZWQ3MTcyYmIxOGI3YjhkMjIwZGQ3ZmY2YjNhMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZwYy1hY2Nlc3MvLk93bEJvdC55YW1sIiwiaCI6Ijg1MTM2YmQwNDM4M2VkNzE3MmJiMThiN2I4ZDIyMGRkN2ZmNmIzYTAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXdlYnJpc2svLk93bEJvdC55YW1sIiwiaCI6Ijg1MTM2YmQwNDM4M2VkNzE3MmJiMThiN2I4ZDIyMGRkN2ZmNmIzYTAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXdlYnNlY3VyaXR5c2Nhbm5lci8uT3dsQm90LnlhbWwiLCJoIjoiODUxMzZiZDA0MzgzZWQ3MTcyYmIxOGI3YjhkMjIwZGQ3ZmY2YjNhMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXdvcmtmbG93cy8uT3dsQm90LnlhbWwiLCJoIjoiODUxMzZiZDA0MzgzZWQ3MTcyYmIxOGI3YjhkMjIwZGQ3ZmY2YjNhMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXdvcmtzdGF0aW9ucy8uT3dsQm90LnlhbWwiLCJoIjoiODUxMzZiZDA0MzgzZWQ3MTcyYmIxOGI3YjhkMjIwZGQ3ZmY2YjNhMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtZmxlZXRlbmdpbmUtZGVsaXZlcnkvLk93bEJvdC55YW1sIiwiaCI6Ijg1MTM2YmQwNDM4M2VkNzE3MmJiMThiN2I4ZDIyMGRkN2ZmNmIzYTAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtZmxlZXRlbmdpbmUvLk93bEJvdC55YW1sIiwiaCI6Ijg1MTM2YmQwNDM4M2VkNzE3MmJiMThiN2I4ZDIyMGRkN2ZmNmIzYTAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXNob3BwaW5nLXR5cGUvLk93bEJvdC55YW1sIiwiaCI6Ijg1MTM2YmQwNDM4M2VkNzE3MmJiMThiN2I4ZDIyMGRkN2ZmNmIzYTAifQ== BEGIN_COMMIT_OVERRIDE feat: Add support for python 3.12 feat: Introduce compatibility with native namespace packages fix: Use `retry_async` instead of `retry` in async client fix: Require proto-plus >= 1.22.3 END_COMMIT_OVERRIDE --------- Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- .github/workflows/unittest.yml | 4 +- .kokoro/continuous/system.cfg | 2 +- .kokoro/presubmit/system.cfg | 2 +- ci/run_conditional_tests.sh | 8 +- ci/run_single_test.sh | 8 +- packages/google-cloud-trace/CONTRIBUTING.rst | 34 +++---- packages/google-cloud-trace/docs/conf.py | 2 +- .../services/trace_service/async_client.py | 18 ++-- .../services/trace_service/async_client.py | 14 +-- packages/google-cloud-trace/noxfile.py | 9 +- packages/google-cloud-trace/setup.py | 20 ++-- .../testing/constraints-3.7.txt | 2 +- .../google-cloud-translate/CONTRIBUTING.rst | 34 +++---- packages/google-cloud-translate/docs/conf.py | 2 +- .../google-cloud-translate/google/__init__.py | 24 ----- .../google/cloud/__init__.py | 24 ----- .../google/cloud/translate_v2/__init__.py | 4 +- .../translation_service/async_client.py | 34 +++---- .../translation_service/async_client.py | 34 +++---- packages/google-cloud-translate/noxfile.py | 9 +- packages/google-cloud-translate/setup.py | 20 ++-- .../testing/constraints-3.7.txt | 2 +- .../CONTRIBUTING.rst | 10 +- .../async_client.py | 10 +- .../async_client.py | 10 +- .../async_client.py | 10 +- .../async_client.py | 10 +- .../async_client.py | 10 +- .../async_client.py | 10 +- .../google-cloud-videointelligence/noxfile.py | 9 +- .../google-cloud-videointelligence/setup.py | 20 ++-- .../testing/constraints-3.7.txt | 2 +- packages/google-cloud-vision/CONTRIBUTING.rst | 34 +++---- packages/google-cloud-vision/docs/conf.py | 2 +- .../services/image_annotator/async_client.py | 22 ++--- .../services/product_search/async_client.py | 82 ++++++++--------- .../services/image_annotator/async_client.py | 10 +- .../services/image_annotator/async_client.py | 14 +-- .../services/image_annotator/async_client.py | 14 +-- .../services/product_search/async_client.py | 78 ++++++++-------- .../services/image_annotator/async_client.py | 22 ++--- .../services/product_search/async_client.py | 80 ++++++++-------- packages/google-cloud-vision/noxfile.py | 9 +- packages/google-cloud-vision/setup.py | 20 ++-- .../testing/constraints-3.7.txt | 2 +- .../google-cloud-vpc-access/CONTRIBUTING.rst | 10 +- .../vpc_access_service/async_client.py | 26 +++--- packages/google-cloud-vpc-access/noxfile.py | 9 +- packages/google-cloud-vpc-access/setup.py | 20 ++-- .../testing/constraints-3.7.txt | 2 +- .../vpcaccess_v1/test_vpc_access_service.py | 6 +- .../google-cloud-webrisk/CONTRIBUTING.rst | 10 +- .../services/web_risk_service/async_client.py | 38 ++++---- .../web_risk_service_v1_beta1/async_client.py | 18 ++-- packages/google-cloud-webrisk/noxfile.py | 9 +- packages/google-cloud-webrisk/setup.py | 20 ++-- .../testing/constraints-3.7.txt | 2 +- .../gapic/webrisk_v1/test_web_risk_service.py | 8 +- .../CONTRIBUTING.rst | 10 +- .../web_security_scanner/async_client.py | 50 +++++----- .../web_security_scanner/async_client.py | 50 +++++----- .../web_security_scanner/async_client.py | 50 +++++----- .../noxfile.py | 9 +- .../google-cloud-websecurityscanner/setup.py | 20 ++-- .../testing/constraints-3.7.txt | 2 +- .../google-cloud-workflows/CONTRIBUTING.rst | 10 +- .../google-cloud-workflows/docs/index.rst | 19 +++- .../services/executions/async_client.py | 14 +-- .../services/executions/async_client.py | 14 +-- .../services/workflows/async_client.py | 36 ++++---- .../services/workflows/async_client.py | 16 ++-- packages/google-cloud-workflows/noxfile.py | 9 +- packages/google-cloud-workflows/setup.py | 20 ++-- .../testing/constraints-3.7.txt | 2 +- .../unit/gapic/workflows_v1/test_workflows.py | 8 +- .../CONTRIBUTING.rst | 10 +- .../services/workstations/async_client.py | 92 +++++++++---------- .../services/workstations/async_client.py | 92 +++++++++---------- packages/google-cloud-workstations/noxfile.py | 9 +- packages/google-cloud-workstations/setup.py | 20 ++-- .../testing/constraints-3.7.txt | 2 +- .../workstations_v1/test_workstations.py | 8 +- .../workstations_v1beta/test_workstations.py | 8 +- .../CONTRIBUTING.rst | 10 +- .../fleetengine_delivery/gapic_version.py | 2 +- .../fleetengine_delivery_v1/gapic_version.py | 2 +- .../services/delivery_service/async_client.py | 50 +++++----- .../noxfile.py | 6 +- ...metadata_maps.fleetengine.delivery.v1.json | 2 +- .../google-maps-fleetengine-delivery/setup.py | 20 ++-- .../testing/constraints-3.7.txt | 2 +- .../google-maps-fleetengine/CONTRIBUTING.rst | 10 +- .../google/maps/fleetengine/gapic_version.py | 2 +- .../maps/fleetengine_v1/gapic_version.py | 2 +- .../services/trip_service/async_client.py | 24 ++--- .../services/vehicle_service/async_client.py | 32 +++---- packages/google-maps-fleetengine/noxfile.py | 6 +- .../snippet_metadata_maps.fleetengine.v1.json | 2 +- packages/google-maps-fleetengine/setup.py | 20 ++-- .../testing/constraints-3.7.txt | 2 +- .../google-shopping-type/CONTRIBUTING.rst | 10 +- .../google/shopping/type/gapic_version.py | 2 +- packages/google-shopping-type/noxfile.py | 6 +- packages/google-shopping-type/setup.py | 20 ++-- .../testing/constraints-3.7.txt | 2 +- .../add-dependency-google-cloud-common.yaml | 8 +- ...-dependencies-to-setup-py-constraints.yaml | 24 ++--- ...containeranalysis-grafeas-integration.yaml | 8 +- .../integrate-isolated-handwritten-code.yaml | 16 ++-- ...y-error-with-org-policy-as-dependency.yaml | 8 +- 110 files changed, 936 insertions(+), 920 deletions(-) delete mode 100644 packages/google-cloud-translate/google/__init__.py delete mode 100644 packages/google-cloud-translate/google/cloud/__init__.py diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 2ced1f8803f4..36e878edb62c 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: ['3.7', '3.8', '3.9', '3.10', "3.11"] + python: ['3.7', '3.8', '3.9', '3.10', "3.11", "3.12"] steps: - name: Checkout uses: actions/checkout@v4 @@ -46,7 +46,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: ['3.11'] + python: ['3.12'] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.kokoro/continuous/system.cfg b/.kokoro/continuous/system.cfg index 5ff31a60322b..789455bd6973 100644 --- a/.kokoro/continuous/system.cfg +++ b/.kokoro/continuous/system.cfg @@ -3,5 +3,5 @@ # Only run this nox session. env_vars: { key: "NOX_SESSION" - value: "system-3.11" + value: "system-3.12" } diff --git a/.kokoro/presubmit/system.cfg b/.kokoro/presubmit/system.cfg index 5ff31a60322b..789455bd6973 100644 --- a/.kokoro/presubmit/system.cfg +++ b/.kokoro/presubmit/system.cfg @@ -3,5 +3,5 @@ # Only run this nox session. env_vars: { key: "NOX_SESSION" - value: "system-3.11" + value: "system-3.12" } diff --git a/ci/run_conditional_tests.sh b/ci/run_conditional_tests.sh index b1247466e47d..77692ce6007a 100755 --- a/ci/run_conditional_tests.sh +++ b/ci/run_conditional_tests.sh @@ -16,7 +16,7 @@ # This script requires the following environment variables to be set: # `BUILD_TYPE` should be one of ["presubmit", "continuous"] # `TEST_TYPE` should be one of ["lint", "lint_setup_py", "docs", "docfx", "prerelease"] -# `PY_VERSION` should be one of ["3.7", "3.8", "3.9", "3.10", "3.11"] +# `PY_VERSION` should be one of ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] # `TEST_TYPE` and `PY_VERSION` are required by the script `ci/run_single_test.sh` @@ -64,12 +64,6 @@ set +e git diff --quiet ${GIT_DIFF_ARG} ci changed=$? set -e -if [[ "${changed}" -eq 0 ]]; then - echo "no change detected in ci" -else - echo "change detected in ci, we should test everything" - GIT_DIFF_ARG="" -fi # Now we have a fixed list, but we can change it to autodetect if # necessary. diff --git a/ci/run_single_test.sh b/ci/run_single_test.sh index dbae6ee5ee6a..d74054434cef 100755 --- a/ci/run_single_test.sh +++ b/ci/run_single_test.sh @@ -16,7 +16,7 @@ # This script requires the following environment variables to be set: # `TEST_TYPE` should be one of ["lint", "lint_setup_py", "docs", "docfx", "prerelease"] -# `PY_VERSION` should be one of ["3.7", "3.8", "3.9", "3.10", "3.11"] +# `PY_VERSION` should be one of ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] # This script is called by the `ci/run_conditional_tests.sh` script. # A specific `nox` session will be run, depending on the value of @@ -57,7 +57,7 @@ case ${TEST_TYPE} in retval=$? ;; prerelease) - nox -s prerelease_deps-3.11 + nox -s prerelease_deps-3.12 retval=$? ;; unit) @@ -82,6 +82,10 @@ case ${TEST_TYPE} in nox -s unit-3.11 retval=$? ;; + "3.12") + nox -s unit-3.12 + retval=$? + ;; *) ;; esac diff --git a/packages/google-cloud-trace/CONTRIBUTING.rst b/packages/google-cloud-trace/CONTRIBUTING.rst index 790a1b1c869f..d68d8e0169ce 100644 --- a/packages/google-cloud-trace/CONTRIBUTING.rst +++ b/packages/google-cloud-trace/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.7, 3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows. + 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -35,21 +35,21 @@ Using a Development Checkout You'll have to create a development environment using a Git checkout: - While logged into your GitHub account, navigate to the - ``python-trace`` `repo`_ on GitHub. + ``google-cloud-python`` `repo`_ on GitHub. -- Fork and clone the ``python-trace`` repository to your GitHub account by +- Fork and clone the ``google-cloud-python`` repository to your GitHub account by clicking the "Fork" button. -- Clone your fork of ``python-trace`` from your GitHub account to your local +- Clone your fork of ``google-cloud-python`` from your GitHub account to your local computer, substituting your account username and specifying the destination - as ``hack-on-python-trace``. E.g.:: + as ``hack-on-google-cloud-python``. E.g.:: $ cd ${HOME} - $ git clone git@github.com:USERNAME/python-trace.git hack-on-python-trace - $ cd hack-on-python-trace - # Configure remotes such that you can pull changes from the googleapis/python-trace + $ git clone git@github.com:USERNAME/google-cloud-python.git hack-on-google-cloud-python + $ cd hack-on-google-cloud-python + # Configure remotes such that you can pull changes from the googleapis/google-cloud-python # repository into your local repository. - $ git remote add upstream git@github.com:googleapis/python-trace.git + $ git remote add upstream git@github.com:googleapis/google-cloud-python.git # fetch and merge changes from upstream into main $ git fetch upstream $ git merge upstream/main @@ -60,7 +60,7 @@ repo, from which you can submit a pull request. To work on the codebase and run the tests, we recommend using ``nox``, but you can also use a ``virtualenv`` of your own creation. -.. _repo: https://github.com/googleapis/python-trace +.. _repo: https://github.com/googleapis/google-cloud-python Using ``nox`` ============= @@ -72,7 +72,7 @@ We use `nox `__ to instrument our tests. - To run a single unit test:: - $ nox -s unit-3.11 -- -k + $ nox -s unit-3.12 -- -k .. note:: @@ -113,7 +113,7 @@ Coding Style export GOOGLE_CLOUD_TESTING_BRANCH="main" By doing this, you are specifying the location of the most up-to-date - version of ``python-trace``. The + version of ``google-cloud-python``. The remote name ``upstream`` should point to the official ``googleapis`` checkout and the branch should be the default branch on that remote (``main``). @@ -143,12 +143,12 @@ Running System Tests $ nox -s system # Run a single system test - $ nox -s system-3.11 -- -k + $ nox -s system-3.12 -- -k .. note:: - System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11. + System tests are only configured to run under Python 3.8, 3.9, 3.10, 3.11 and 3.12. For expediency, we do not run them in older versions of Python 3. This alone will not run the tests. You'll need to change some local @@ -209,7 +209,7 @@ The `description on PyPI`_ for the project comes directly from the ``README``. Due to the reStructuredText (``rst``) parser used by PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst`` instead of -``https://github.com/googleapis/python-trace/blob/main/CONTRIBUTING.rst``) +``https://github.com/googleapis/google-cloud-python/blob/main/CONTRIBUTING.rst``) may cause problems creating links or rendering the description. .. _description on PyPI: https://pypi.org/project/google-cloud-trace @@ -226,17 +226,19 @@ We support: - `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ +- `Python 3.12`_ .. _Python 3.7: https://docs.python.org/3.7/ .. _Python 3.8: https://docs.python.org/3.8/ .. _Python 3.9: https://docs.python.org/3.9/ .. _Python 3.10: https://docs.python.org/3.10/ .. _Python 3.11: https://docs.python.org/3.11/ +.. _Python 3.12: https://docs.python.org/3.12/ Supported versions can be found in our ``noxfile.py`` `config`_. -.. _config: https://github.com/googleapis/python-trace/blob/main/packages/google-cloud-trace/noxfile.py +.. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/google-cloud-trace/noxfile.py ********** diff --git a/packages/google-cloud-trace/docs/conf.py b/packages/google-cloud-trace/docs/conf.py index f1f0d185f5de..f5e9379b02eb 100644 --- a/packages/google-cloud-trace/docs/conf.py +++ b/packages/google-cloud-trace/docs/conf.py @@ -156,7 +156,7 @@ html_theme_options = { "description": "Google Cloud Client Libraries for google-cloud-trace", "github_user": "googleapis", - "github_repo": "python-trace", + "github_repo": "google-cloud-python", "github_banner": True, "font_family": "'Roboto', Georgia, sans", "head_font_family": "'Roboto', Georgia, serif", diff --git a/packages/google-cloud-trace/google/cloud/trace_v1/services/trace_service/async_client.py b/packages/google-cloud-trace/google/cloud/trace_v1/services/trace_service/async_client.py index 1d2929b147d4..5543af50e7b8 100644 --- a/packages/google-cloud-trace/google/cloud/trace_v1/services/trace_service/async_client.py +++ b/packages/google-cloud-trace/google/cloud/trace_v1/services/trace_service/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.trace_v1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.cloud.trace_v1.services.trace_service import pagers from google.cloud.trace_v1.types import trace @@ -264,7 +264,7 @@ async def sample_list_traces(): This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -299,7 +299,7 @@ async def sample_list_traces(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_traces, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=1.0, multiplier=1.2, @@ -395,7 +395,7 @@ async def sample_get_trace(): This corresponds to the ``trace_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -433,7 +433,7 @@ async def sample_get_trace(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_trace, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=1.0, multiplier=1.2, @@ -525,7 +525,7 @@ async def sample_patch_traces(): This corresponds to the ``traces`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -554,7 +554,7 @@ async def sample_patch_traces(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.patch_traces, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=1.0, multiplier=1.2, diff --git a/packages/google-cloud-trace/google/cloud/trace_v2/services/trace_service/async_client.py b/packages/google-cloud-trace/google/cloud/trace_v2/services/trace_service/async_client.py index 23d7fbd55fc3..d03cf3158c54 100644 --- a/packages/google-cloud-trace/google/cloud/trace_v2/services/trace_service/async_client.py +++ b/packages/google-cloud-trace/google/cloud/trace_v2/services/trace_service/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.trace_v2 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.protobuf import timestamp_pb2 # type: ignore from google.protobuf import wrappers_pb2 # type: ignore @@ -281,7 +281,7 @@ async def sample_batch_write_spans(): This corresponds to the ``spans`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -310,7 +310,7 @@ async def sample_batch_write_spans(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.batch_write_spans, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=30.0, multiplier=2, @@ -388,7 +388,7 @@ async def sample_create_span(): spans, or none at all. Spans do not need to be contiguous. There might be gaps or overlaps between spans in a trace. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -416,7 +416,7 @@ async def sample_create_span(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.create_span, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=1.0, multiplier=1.2, diff --git a/packages/google-cloud-trace/noxfile.py b/packages/google-cloud-trace/noxfile.py index 716326a3d430..7d3551347c78 100644 --- a/packages/google-cloud-trace/noxfile.py +++ b/packages/google-cloud-trace/noxfile.py @@ -29,11 +29,13 @@ BLACK_VERSION = "black[jupyter]==23.7.0" ISORT_VERSION = "isort==5.11.0" + LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] + DEFAULT_PYTHON_VERSION = "3.10" -UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"] +UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", @@ -47,7 +49,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"] SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -89,6 +91,7 @@ def lint(session): "--check", *LINT_PATHS, ) + session.run("flake8", "google", "tests") @@ -336,7 +339,7 @@ def docfx(session): ) -@nox.session(python="3.11") +@nox.session(python="3.12") def prerelease_deps(session): """Run all tests with prerelease versions of dependencies installed.""" diff --git a/packages/google-cloud-trace/setup.py b/packages/google-cloud-trace/setup.py index 82a8e547144b..5a84e7948870 100644 --- a/packages/google-cloud-trace/setup.py +++ b/packages/google-cloud-trace/setup.py @@ -15,6 +15,7 @@ # import io import os +import re import setuptools # type: ignore @@ -25,10 +26,12 @@ description = "Google Cloud Trace API client library" -version = {} +version = None + with open(os.path.join(package_root, "google/cloud/trace/gapic_version.py")) as fp: - exec(fp.read(), version) -version = version["__version__"] + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert len(version_candidates) == 1 + version = version_candidates[0] if version[0] == "0": release_status = "Development Status :: 4 - Beta" @@ -37,11 +40,10 @@ dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", - "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "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", ] -url = "https://github.com/googleapis/google-cloud-python" +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-trace" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -51,12 +53,10 @@ packages = [ package - for package in setuptools.PEP420PackageFinder.find() + for package in setuptools.find_namespace_packages() if package.startswith("google") ] -namespaces = ["google", "google.cloud"] - setuptools.setup( name=name, version=version, @@ -77,13 +77,13 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Operating System :: OS Independent", "Topic :: Internet", ], platforms="Posix; MacOS X; Windows", packages=packages, python_requires=">=3.7", - namespace_packages=namespaces, install_requires=dependencies, include_package_data=True, zip_safe=False, diff --git a/packages/google-cloud-trace/testing/constraints-3.7.txt b/packages/google-cloud-trace/testing/constraints-3.7.txt index 6c44adfea7ee..185f7d366c2f 100644 --- a/packages/google-cloud-trace/testing/constraints-3.7.txt +++ b/packages/google-cloud-trace/testing/constraints-3.7.txt @@ -5,5 +5,5 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 -proto-plus==1.22.0 +proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-translate/CONTRIBUTING.rst b/packages/google-cloud-translate/CONTRIBUTING.rst index d61d84047720..8518eccd71f4 100644 --- a/packages/google-cloud-translate/CONTRIBUTING.rst +++ b/packages/google-cloud-translate/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.7, 3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows. + 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -35,21 +35,21 @@ Using a Development Checkout You'll have to create a development environment using a Git checkout: - While logged into your GitHub account, navigate to the - ``python-translate`` `repo`_ on GitHub. + ``google-cloud-python`` `repo`_ on GitHub. -- Fork and clone the ``python-translate`` repository to your GitHub account by +- Fork and clone the ``google-cloud-python`` repository to your GitHub account by clicking the "Fork" button. -- Clone your fork of ``python-translate`` from your GitHub account to your local +- Clone your fork of ``google-cloud-python`` from your GitHub account to your local computer, substituting your account username and specifying the destination - as ``hack-on-python-translate``. E.g.:: + as ``hack-on-google-cloud-python``. E.g.:: $ cd ${HOME} - $ git clone git@github.com:USERNAME/python-translate.git hack-on-python-translate - $ cd hack-on-python-translate - # Configure remotes such that you can pull changes from the googleapis/python-translate + $ git clone git@github.com:USERNAME/google-cloud-python.git hack-on-google-cloud-python + $ cd hack-on-google-cloud-python + # Configure remotes such that you can pull changes from the googleapis/google-cloud-python # repository into your local repository. - $ git remote add upstream git@github.com:googleapis/python-translate.git + $ git remote add upstream git@github.com:googleapis/google-cloud-python.git # fetch and merge changes from upstream into main $ git fetch upstream $ git merge upstream/main @@ -60,7 +60,7 @@ repo, from which you can submit a pull request. To work on the codebase and run the tests, we recommend using ``nox``, but you can also use a ``virtualenv`` of your own creation. -.. _repo: https://github.com/googleapis/python-translate +.. _repo: https://github.com/googleapis/google-cloud-python Using ``nox`` ============= @@ -72,7 +72,7 @@ We use `nox `__ to instrument our tests. - To run a single unit test:: - $ nox -s unit-3.11 -- -k + $ nox -s unit-3.12 -- -k .. note:: @@ -113,7 +113,7 @@ Coding Style export GOOGLE_CLOUD_TESTING_BRANCH="main" By doing this, you are specifying the location of the most up-to-date - version of ``python-translate``. The + version of ``google-cloud-python``. The remote name ``upstream`` should point to the official ``googleapis`` checkout and the branch should be the default branch on that remote (``main``). @@ -143,12 +143,12 @@ Running System Tests $ nox -s system # Run a single system test - $ nox -s system-3.11 -- -k + $ nox -s system-3.12 -- -k .. note:: - System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11. + System tests are only configured to run under Python 3.8, 3.9, 3.10, 3.11 and 3.12. For expediency, we do not run them in older versions of Python 3. This alone will not run the tests. You'll need to change some local @@ -209,7 +209,7 @@ The `description on PyPI`_ for the project comes directly from the ``README``. Due to the reStructuredText (``rst``) parser used by PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst`` instead of -``https://github.com/googleapis/python-translate/blob/main/CONTRIBUTING.rst``) +``https://github.com/googleapis/google-cloud-python/blob/main/CONTRIBUTING.rst``) may cause problems creating links or rendering the description. .. _description on PyPI: https://pypi.org/project/google-cloud-translate @@ -226,17 +226,19 @@ We support: - `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ +- `Python 3.12`_ .. _Python 3.7: https://docs.python.org/3.7/ .. _Python 3.8: https://docs.python.org/3.8/ .. _Python 3.9: https://docs.python.org/3.9/ .. _Python 3.10: https://docs.python.org/3.10/ .. _Python 3.11: https://docs.python.org/3.11/ +.. _Python 3.12: https://docs.python.org/3.12/ Supported versions can be found in our ``noxfile.py`` `config`_. -.. _config: https://github.com/googleapis/python-translate/blob/main/packages/google-cloud-translate/noxfile.py +.. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/google-cloud-translate/noxfile.py ********** diff --git a/packages/google-cloud-translate/docs/conf.py b/packages/google-cloud-translate/docs/conf.py index 40b2e77b35fa..e796e24bcdb8 100644 --- a/packages/google-cloud-translate/docs/conf.py +++ b/packages/google-cloud-translate/docs/conf.py @@ -156,7 +156,7 @@ html_theme_options = { "description": "Google Cloud Client Libraries for google-cloud-translate", "github_user": "googleapis", - "github_repo": "python-translate", + "github_repo": "google-cloud-python", "github_banner": True, "font_family": "'Roboto', Georgia, sans", "head_font_family": "'Roboto', Georgia, serif", diff --git a/packages/google-cloud-translate/google/__init__.py b/packages/google-cloud-translate/google/__init__.py deleted file mode 100644 index 8fcc60e2b9c6..000000000000 --- a/packages/google-cloud-translate/google/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/packages/google-cloud-translate/google/cloud/__init__.py b/packages/google-cloud-translate/google/cloud/__init__.py deleted file mode 100644 index 8fcc60e2b9c6..000000000000 --- a/packages/google-cloud-translate/google/cloud/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/packages/google-cloud-translate/google/cloud/translate_v2/__init__.py b/packages/google-cloud-translate/google/cloud/translate_v2/__init__.py index 7af5aeafabfd..654d187a1330 100644 --- a/packages/google-cloud-translate/google/cloud/translate_v2/__init__.py +++ b/packages/google-cloud-translate/google/cloud/translate_v2/__init__.py @@ -15,9 +15,7 @@ """Google Cloud Translation API wrapper.""" -from pkg_resources import get_distribution - -__version__ = get_distribution("google-cloud-translate").version +from google.cloud.translate import __version__ from google.cloud.translate_v2.client import Client diff --git a/packages/google-cloud-translate/google/cloud/translate_v3/services/translation_service/async_client.py b/packages/google-cloud-translate/google/cloud/translate_v3/services/translation_service/async_client.py index 50853447b1ba..be7401517ecb 100644 --- a/packages/google-cloud-translate/google/cloud/translate_v3/services/translation_service/async_client.py +++ b/packages/google-cloud-translate/google/cloud/translate_v3/services/translation_service/async_client.py @@ -30,16 +30,16 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.cloud.translate_v3 import gapic_version as package_version from google.oauth2 import service_account # type: ignore try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -349,7 +349,7 @@ async def sample_translate_text(): This corresponds to the ``source_language_code`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -517,7 +517,7 @@ async def sample_detect_language(): This corresponds to the ``content`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -671,7 +671,7 @@ async def sample_get_supported_languages(): This corresponds to the ``display_language_code`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -708,7 +708,7 @@ async def sample_get_supported_languages(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_supported_languages, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -785,7 +785,7 @@ async def sample_translate_document(): Args: request (Optional[Union[google.cloud.translate_v3.types.TranslateDocumentRequest, dict]]): The request object. A document translation request. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -889,7 +889,7 @@ async def sample_batch_translate_text(): Args: request (Optional[Union[google.cloud.translate_v3.types.BatchTranslateTextRequest, dict]]): The request object. The batch translation request. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1067,7 +1067,7 @@ async def sample_batch_translate_document(): This corresponds to the ``output_config`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1211,7 +1211,7 @@ async def sample_create_glossary(): This corresponds to the ``glossary`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1330,7 +1330,7 @@ async def sample_list_glossaries(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1366,7 +1366,7 @@ async def sample_list_glossaries(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_glossaries, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1454,7 +1454,7 @@ async def sample_get_glossary(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1487,7 +1487,7 @@ async def sample_get_glossary(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_glossary, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1573,7 +1573,7 @@ async def sample_delete_glossary(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1609,7 +1609,7 @@ async def sample_delete_glossary(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_glossary, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, diff --git a/packages/google-cloud-translate/google/cloud/translate_v3beta1/services/translation_service/async_client.py b/packages/google-cloud-translate/google/cloud/translate_v3beta1/services/translation_service/async_client.py index f8abec34c24d..5c4d17ec43f6 100644 --- a/packages/google-cloud-translate/google/cloud/translate_v3beta1/services/translation_service/async_client.py +++ b/packages/google-cloud-translate/google/cloud/translate_v3beta1/services/translation_service/async_client.py @@ -30,16 +30,16 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.cloud.translate_v3beta1 import gapic_version as package_version from google.oauth2 import service_account # type: ignore try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -259,7 +259,7 @@ async def sample_translate_text(): request (Optional[Union[google.cloud.translate_v3beta1.types.TranslateTextRequest, dict]]): The request object. The request message for synchronous translation. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -386,7 +386,7 @@ async def sample_detect_language(): This corresponds to the ``mime_type`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -538,7 +538,7 @@ async def sample_get_supported_languages(): This corresponds to the ``model`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -575,7 +575,7 @@ async def sample_get_supported_languages(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_supported_languages, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -652,7 +652,7 @@ async def sample_translate_document(): Args: request (Optional[Union[google.cloud.translate_v3beta1.types.TranslateDocumentRequest, dict]]): The request object. A document translation request. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -756,7 +756,7 @@ async def sample_batch_translate_text(): Args: request (Optional[Union[google.cloud.translate_v3beta1.types.BatchTranslateTextRequest, dict]]): The request object. The batch translation request. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -934,7 +934,7 @@ async def sample_batch_translate_document(): This corresponds to the ``output_config`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1078,7 +1078,7 @@ async def sample_create_glossary(): This corresponds to the ``glossary`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1232,7 +1232,7 @@ async def sample_list_glossaries(): This corresponds to the ``filter`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1270,7 +1270,7 @@ async def sample_list_glossaries(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_glossaries, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1358,7 +1358,7 @@ async def sample_get_glossary(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1391,7 +1391,7 @@ async def sample_get_glossary(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_glossary, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1477,7 +1477,7 @@ async def sample_delete_glossary(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1513,7 +1513,7 @@ async def sample_delete_glossary(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_glossary, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, diff --git a/packages/google-cloud-translate/noxfile.py b/packages/google-cloud-translate/noxfile.py index 716326a3d430..7d3551347c78 100644 --- a/packages/google-cloud-translate/noxfile.py +++ b/packages/google-cloud-translate/noxfile.py @@ -29,11 +29,13 @@ BLACK_VERSION = "black[jupyter]==23.7.0" ISORT_VERSION = "isort==5.11.0" + LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] + DEFAULT_PYTHON_VERSION = "3.10" -UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"] +UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", @@ -47,7 +49,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"] SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -89,6 +91,7 @@ def lint(session): "--check", *LINT_PATHS, ) + session.run("flake8", "google", "tests") @@ -336,7 +339,7 @@ def docfx(session): ) -@nox.session(python="3.11") +@nox.session(python="3.12") def prerelease_deps(session): """Run all tests with prerelease versions of dependencies installed.""" diff --git a/packages/google-cloud-translate/setup.py b/packages/google-cloud-translate/setup.py index 44126337bef3..b12509f0f1a5 100644 --- a/packages/google-cloud-translate/setup.py +++ b/packages/google-cloud-translate/setup.py @@ -15,6 +15,7 @@ # import io import os +import re import setuptools # type: ignore @@ -25,10 +26,12 @@ description = "Google Cloud Translate API client library" -version = {} +version = None + with open(os.path.join(package_root, "google/cloud/translate/gapic_version.py")) as fp: - exec(fp.read(), version) -version = version["__version__"] + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert len(version_candidates) == 1 + version = version_candidates[0] if version[0] == "0": release_status = "Development Status :: 4 - Beta" @@ -38,11 +41,10 @@ dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "google-cloud-core >= 1.4.4, <3.0.0dev", - "proto-plus >= 1.22.0, <2.0.0dev", - "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "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", ] -url = "https://github.com/googleapis/google-cloud-python" +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-translate" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -52,12 +54,10 @@ packages = [ package - for package in setuptools.PEP420PackageFinder.find() + for package in setuptools.find_namespace_packages() if package.startswith("google") ] -namespaces = ["google", "google.cloud"] - setuptools.setup( name=name, version=version, @@ -78,13 +78,13 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Operating System :: OS Independent", "Topic :: Internet", ], platforms="Posix; MacOS X; Windows", packages=packages, python_requires=">=3.7", - namespace_packages=namespaces, install_requires=dependencies, include_package_data=True, zip_safe=False, diff --git a/packages/google-cloud-translate/testing/constraints-3.7.txt b/packages/google-cloud-translate/testing/constraints-3.7.txt index 7e9124a167dc..b039d0fd2147 100644 --- a/packages/google-cloud-translate/testing/constraints-3.7.txt +++ b/packages/google-cloud-translate/testing/constraints-3.7.txt @@ -5,6 +5,6 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 -proto-plus==1.22.0 +proto-plus==1.22.3 google-cloud-core==1.4.4 protobuf==3.19.5 diff --git a/packages/google-cloud-videointelligence/CONTRIBUTING.rst b/packages/google-cloud-videointelligence/CONTRIBUTING.rst index d5145c017d08..1b6f22e13186 100644 --- a/packages/google-cloud-videointelligence/CONTRIBUTING.rst +++ b/packages/google-cloud-videointelligence/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.7, 3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows. + 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -72,7 +72,7 @@ We use `nox `__ to instrument our tests. - To run a single unit test:: - $ nox -s unit-3.11 -- -k + $ nox -s unit-3.12 -- -k .. note:: @@ -143,12 +143,12 @@ Running System Tests $ nox -s system # Run a single system test - $ nox -s system-3.11 -- -k + $ nox -s system-3.12 -- -k .. note:: - System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11. + System tests are only configured to run under Python 3.8, 3.9, 3.10, 3.11 and 3.12. For expediency, we do not run them in older versions of Python 3. This alone will not run the tests. You'll need to change some local @@ -226,12 +226,14 @@ We support: - `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ +- `Python 3.12`_ .. _Python 3.7: https://docs.python.org/3.7/ .. _Python 3.8: https://docs.python.org/3.8/ .. _Python 3.9: https://docs.python.org/3.9/ .. _Python 3.10: https://docs.python.org/3.10/ .. _Python 3.11: https://docs.python.org/3.11/ +.. _Python 3.12: https://docs.python.org/3.12/ Supported versions can be found in our ``noxfile.py`` `config`_. diff --git a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1/services/video_intelligence_service/async_client.py b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1/services/video_intelligence_service/async_client.py index 95ee9677f2bf..01a5de22d7db 100644 --- a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1/services/video_intelligence_service/async_client.py +++ b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1/services/video_intelligence_service/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.videointelligence_v1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -294,7 +294,7 @@ async def sample_annotate_video(): This corresponds to the ``features`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -332,7 +332,7 @@ async def sample_annotate_video(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.annotate_video, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=120.0, multiplier=2.5, diff --git a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/async_client.py b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/async_client.py index fd075ac1c8ee..4d07aa593572 100644 --- a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/async_client.py +++ b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.videointelligence_v1beta2 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -294,7 +294,7 @@ async def sample_annotate_video(): This corresponds to the ``features`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -332,7 +332,7 @@ async def sample_annotate_video(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.annotate_video, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=120.0, multiplier=2.5, diff --git a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/async_client.py b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/async_client.py index 00ca18af9f80..21955228c2fe 100644 --- a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/async_client.py +++ b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.videointelligence_v1p1beta1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -294,7 +294,7 @@ async def sample_annotate_video(): This corresponds to the ``features`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -332,7 +332,7 @@ async def sample_annotate_video(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.annotate_video, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=120.0, multiplier=2.5, diff --git a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/async_client.py b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/async_client.py index 3920d904c5f7..924923afbde6 100644 --- a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/async_client.py +++ b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.videointelligence_v1p2beta1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -294,7 +294,7 @@ async def sample_annotate_video(): This corresponds to the ``features`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -332,7 +332,7 @@ async def sample_annotate_video(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.annotate_video, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=120.0, multiplier=2.5, diff --git a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/async_client.py b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/async_client.py index 3a2f0ccf607b..b774da80f6e9 100644 --- a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/async_client.py +++ b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/async_client.py @@ -33,7 +33,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -41,9 +41,9 @@ from google.cloud.videointelligence_v1p3beta1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.rpc import status_pb2 # type: ignore @@ -291,7 +291,7 @@ def request_generator(): first message must only contain a ``StreamingVideoConfig`` message. All subsequent messages must only contain ``input_content`` data. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -310,7 +310,7 @@ def request_generator(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.streaming_annotate_video, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, diff --git a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/async_client.py b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/async_client.py index 0fc19dd465af..71c709a33d35 100644 --- a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/async_client.py +++ b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.videointelligence_v1p3beta1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -294,7 +294,7 @@ async def sample_annotate_video(): This corresponds to the ``features`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -332,7 +332,7 @@ async def sample_annotate_video(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.annotate_video, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=120.0, multiplier=2.5, diff --git a/packages/google-cloud-videointelligence/noxfile.py b/packages/google-cloud-videointelligence/noxfile.py index 716326a3d430..7d3551347c78 100644 --- a/packages/google-cloud-videointelligence/noxfile.py +++ b/packages/google-cloud-videointelligence/noxfile.py @@ -29,11 +29,13 @@ BLACK_VERSION = "black[jupyter]==23.7.0" ISORT_VERSION = "isort==5.11.0" + LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] + DEFAULT_PYTHON_VERSION = "3.10" -UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"] +UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", @@ -47,7 +49,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"] SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -89,6 +91,7 @@ def lint(session): "--check", *LINT_PATHS, ) + session.run("flake8", "google", "tests") @@ -336,7 +339,7 @@ def docfx(session): ) -@nox.session(python="3.11") +@nox.session(python="3.12") def prerelease_deps(session): """Run all tests with prerelease versions of dependencies installed.""" diff --git a/packages/google-cloud-videointelligence/setup.py b/packages/google-cloud-videointelligence/setup.py index 6348516b4b34..13e531fbd569 100644 --- a/packages/google-cloud-videointelligence/setup.py +++ b/packages/google-cloud-videointelligence/setup.py @@ -15,6 +15,7 @@ # import io import os +import re import setuptools # type: ignore @@ -25,12 +26,14 @@ description = "Google Cloud Videointelligence API client library" -version = {} +version = None + with open( os.path.join(package_root, "google/cloud/videointelligence/gapic_version.py") ) as fp: - exec(fp.read(), version) -version = version["__version__"] + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert len(version_candidates) == 1 + version = version_candidates[0] if version[0] == "0": release_status = "Development Status :: 4 - Beta" @@ -39,11 +42,10 @@ dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", - "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "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", ] -url = "https://github.com/googleapis/google-cloud-python" +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-videointelligence" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -53,12 +55,10 @@ packages = [ package - for package in setuptools.PEP420PackageFinder.find() + for package in setuptools.find_namespace_packages() if package.startswith("google") ] -namespaces = ["google", "google.cloud"] - setuptools.setup( name=name, version=version, @@ -79,13 +79,13 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Operating System :: OS Independent", "Topic :: Internet", ], platforms="Posix; MacOS X; Windows", packages=packages, python_requires=">=3.7", - namespace_packages=namespaces, install_requires=dependencies, include_package_data=True, zip_safe=False, diff --git a/packages/google-cloud-videointelligence/testing/constraints-3.7.txt b/packages/google-cloud-videointelligence/testing/constraints-3.7.txt index 6c44adfea7ee..185f7d366c2f 100644 --- a/packages/google-cloud-videointelligence/testing/constraints-3.7.txt +++ b/packages/google-cloud-videointelligence/testing/constraints-3.7.txt @@ -5,5 +5,5 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 -proto-plus==1.22.0 +proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-vision/CONTRIBUTING.rst b/packages/google-cloud-vision/CONTRIBUTING.rst index 6f9675053c27..785b689b8c5d 100644 --- a/packages/google-cloud-vision/CONTRIBUTING.rst +++ b/packages/google-cloud-vision/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.7, 3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows. + 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -35,21 +35,21 @@ Using a Development Checkout You'll have to create a development environment using a Git checkout: - While logged into your GitHub account, navigate to the - ``python-vision`` `repo`_ on GitHub. + ``google-cloud-python`` `repo`_ on GitHub. -- Fork and clone the ``python-vision`` repository to your GitHub account by +- Fork and clone the ``google-cloud-python`` repository to your GitHub account by clicking the "Fork" button. -- Clone your fork of ``python-vision`` from your GitHub account to your local +- Clone your fork of ``google-cloud-python`` from your GitHub account to your local computer, substituting your account username and specifying the destination - as ``hack-on-python-vision``. E.g.:: + as ``hack-on-google-cloud-python``. E.g.:: $ cd ${HOME} - $ git clone git@github.com:USERNAME/python-vision.git hack-on-python-vision - $ cd hack-on-python-vision - # Configure remotes such that you can pull changes from the googleapis/python-vision + $ git clone git@github.com:USERNAME/google-cloud-python.git hack-on-google-cloud-python + $ cd hack-on-google-cloud-python + # Configure remotes such that you can pull changes from the googleapis/google-cloud-python # repository into your local repository. - $ git remote add upstream git@github.com:googleapis/python-vision.git + $ git remote add upstream git@github.com:googleapis/google-cloud-python.git # fetch and merge changes from upstream into main $ git fetch upstream $ git merge upstream/main @@ -60,7 +60,7 @@ repo, from which you can submit a pull request. To work on the codebase and run the tests, we recommend using ``nox``, but you can also use a ``virtualenv`` of your own creation. -.. _repo: https://github.com/googleapis/python-vision +.. _repo: https://github.com/googleapis/google-cloud-python Using ``nox`` ============= @@ -72,7 +72,7 @@ We use `nox `__ to instrument our tests. - To run a single unit test:: - $ nox -s unit-3.11 -- -k + $ nox -s unit-3.12 -- -k .. note:: @@ -113,7 +113,7 @@ Coding Style export GOOGLE_CLOUD_TESTING_BRANCH="main" By doing this, you are specifying the location of the most up-to-date - version of ``python-vision``. The + version of ``google-cloud-python``. The remote name ``upstream`` should point to the official ``googleapis`` checkout and the branch should be the default branch on that remote (``main``). @@ -143,12 +143,12 @@ Running System Tests $ nox -s system # Run a single system test - $ nox -s system-3.11 -- -k + $ nox -s system-3.12 -- -k .. note:: - System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11. + System tests are only configured to run under Python 3.8, 3.9, 3.10, 3.11 and 3.12. For expediency, we do not run them in older versions of Python 3. This alone will not run the tests. You'll need to change some local @@ -209,7 +209,7 @@ The `description on PyPI`_ for the project comes directly from the ``README``. Due to the reStructuredText (``rst``) parser used by PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst`` instead of -``https://github.com/googleapis/python-vision/blob/main/CONTRIBUTING.rst``) +``https://github.com/googleapis/google-cloud-python/blob/main/CONTRIBUTING.rst``) may cause problems creating links or rendering the description. .. _description on PyPI: https://pypi.org/project/google-cloud-vision @@ -226,17 +226,19 @@ We support: - `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ +- `Python 3.12`_ .. _Python 3.7: https://docs.python.org/3.7/ .. _Python 3.8: https://docs.python.org/3.8/ .. _Python 3.9: https://docs.python.org/3.9/ .. _Python 3.10: https://docs.python.org/3.10/ .. _Python 3.11: https://docs.python.org/3.11/ +.. _Python 3.12: https://docs.python.org/3.12/ Supported versions can be found in our ``noxfile.py`` `config`_. -.. _config: https://github.com/googleapis/python-vision/blob/main/packages/google-cloud-vision/noxfile.py +.. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/google-cloud-vision/noxfile.py ********** diff --git a/packages/google-cloud-vision/docs/conf.py b/packages/google-cloud-vision/docs/conf.py index 8fb0c0ba5351..ab640be85677 100644 --- a/packages/google-cloud-vision/docs/conf.py +++ b/packages/google-cloud-vision/docs/conf.py @@ -156,7 +156,7 @@ html_theme_options = { "description": "Google Cloud Client Libraries for google-cloud-vision", "github_user": "googleapis", - "github_repo": "python-vision", + "github_repo": "google-cloud-python", "github_banner": True, "font_family": "'Roboto', Georgia, sans", "head_font_family": "'Roboto', Georgia, serif", diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py index eb14d6a3224f..9815ac78b141 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.vision_v1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -274,7 +274,7 @@ async def sample_batch_annotate_images(): This corresponds to the ``requests`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -307,7 +307,7 @@ async def sample_batch_annotate_images(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.batch_annotate_images, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -391,7 +391,7 @@ async def sample_batch_annotate_files(): This corresponds to the ``requests`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -422,7 +422,7 @@ async def sample_batch_annotate_files(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.batch_annotate_files, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -521,7 +521,7 @@ async def sample_async_batch_annotate_images(): This corresponds to the ``output_config`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -559,7 +559,7 @@ async def sample_async_batch_annotate_images(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.async_batch_annotate_images, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -654,7 +654,7 @@ async def sample_async_batch_annotate_files(): This corresponds to the ``requests`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -690,7 +690,7 @@ async def sample_async_batch_annotate_files(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.async_batch_annotate_files, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py index 0095642eda8a..ac86f98f0460 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.vision_v1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -318,7 +318,7 @@ async def sample_create_product_set(): This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -358,7 +358,7 @@ async def sample_create_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.create_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -443,7 +443,7 @@ async def sample_list_product_sets(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -478,7 +478,7 @@ async def sample_list_product_sets(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_product_sets, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -573,7 +573,7 @@ async def sample_get_product_set(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -609,7 +609,7 @@ async def sample_get_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -706,7 +706,7 @@ async def sample_update_product_set(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -744,7 +744,7 @@ async def sample_update_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.update_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -829,7 +829,7 @@ async def sample_delete_product_set(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -856,7 +856,7 @@ async def sample_delete_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -961,7 +961,7 @@ async def sample_create_product(): This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -996,7 +996,7 @@ async def sample_create_product(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.create_product, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1081,7 +1081,7 @@ async def sample_list_products(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1116,7 +1116,7 @@ async def sample_list_products(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_products, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1209,7 +1209,7 @@ async def sample_get_product(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1240,7 +1240,7 @@ async def sample_get_product(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_product, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1346,7 +1346,7 @@ async def sample_update_product(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1379,7 +1379,7 @@ async def sample_update_product(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.update_product, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1465,7 +1465,7 @@ async def sample_delete_product(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1492,7 +1492,7 @@ async def sample_delete_product(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_product, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1617,7 +1617,7 @@ async def sample_create_reference_image(): This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1654,7 +1654,7 @@ async def sample_create_reference_image(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.create_reference_image, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1738,7 +1738,7 @@ async def sample_delete_reference_image(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1765,7 +1765,7 @@ async def sample_delete_reference_image(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_reference_image, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1852,7 +1852,7 @@ async def sample_list_reference_images(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1887,7 +1887,7 @@ async def sample_list_reference_images(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_reference_images, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1983,7 +1983,7 @@ async def sample_get_reference_image(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2016,7 +2016,7 @@ async def sample_get_reference_image(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_reference_image, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -2117,7 +2117,7 @@ async def sample_add_product_to_product_set(): This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2146,7 +2146,7 @@ async def sample_add_product_to_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.add_product_to_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -2236,7 +2236,7 @@ async def sample_remove_product_from_product_set(): This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2265,7 +2265,7 @@ async def sample_remove_product_from_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.remove_product_from_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -2354,7 +2354,7 @@ async def sample_list_products_in_product_set(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2390,7 +2390,7 @@ async def sample_list_products_in_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_products_in_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -2506,7 +2506,7 @@ async def sample_import_product_sets(): This corresponds to the ``input_config`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2550,7 +2550,7 @@ async def sample_import_product_sets(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.import_product_sets, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -2667,7 +2667,7 @@ async def sample_purge_products(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2710,7 +2710,7 @@ async def sample_purge_products(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.purge_products, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/services/image_annotator/async_client.py index cf633d422a3a..360a165d9879 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/services/image_annotator/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.vision_v1p1beta1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.cloud.vision_v1p1beta1.types import image_annotator @@ -267,7 +267,7 @@ async def sample_batch_annotate_images(): This corresponds to the ``requests`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -300,7 +300,7 @@ async def sample_batch_annotate_images(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.batch_annotate_images, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py index b75a30199a23..1009ca403640 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.vision_v1p2beta1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -270,7 +270,7 @@ async def sample_batch_annotate_images(): This corresponds to the ``requests`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -303,7 +303,7 @@ async def sample_batch_annotate_images(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.batch_annotate_images, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -390,7 +390,7 @@ async def sample_async_batch_annotate_files(): This corresponds to the ``requests`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -426,7 +426,7 @@ async def sample_async_batch_annotate_files(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.async_batch_annotate_files, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py index 2bdfeb459b76..9f8a0f6699db 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.vision_v1p3beta1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -274,7 +274,7 @@ async def sample_batch_annotate_images(): This corresponds to the ``requests`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -307,7 +307,7 @@ async def sample_batch_annotate_images(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.batch_annotate_images, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -394,7 +394,7 @@ async def sample_async_batch_annotate_files(): This corresponds to the ``requests`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -430,7 +430,7 @@ async def sample_async_batch_annotate_files(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.async_batch_annotate_files, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py index 609685cc0e75..ad3e75ad83f6 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.vision_v1p3beta1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -319,7 +319,7 @@ async def sample_create_product_set(): This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -359,7 +359,7 @@ async def sample_create_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.create_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -444,7 +444,7 @@ async def sample_list_product_sets(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -479,7 +479,7 @@ async def sample_list_product_sets(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_product_sets, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -574,7 +574,7 @@ async def sample_get_product_set(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -610,7 +610,7 @@ async def sample_get_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -707,7 +707,7 @@ async def sample_update_product_set(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -745,7 +745,7 @@ async def sample_update_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.update_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -831,7 +831,7 @@ async def sample_delete_product_set(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -858,7 +858,7 @@ async def sample_delete_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -963,7 +963,7 @@ async def sample_create_product(): This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -998,7 +998,7 @@ async def sample_create_product(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.create_product, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1083,7 +1083,7 @@ async def sample_list_products(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1118,7 +1118,7 @@ async def sample_list_products(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_products, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1211,7 +1211,7 @@ async def sample_get_product(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1242,7 +1242,7 @@ async def sample_get_product(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_product, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1348,7 +1348,7 @@ async def sample_update_product(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1381,7 +1381,7 @@ async def sample_update_product(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.update_product, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1467,7 +1467,7 @@ async def sample_delete_product(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1494,7 +1494,7 @@ async def sample_delete_product(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_product, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1619,7 +1619,7 @@ async def sample_create_reference_image(): This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1656,7 +1656,7 @@ async def sample_create_reference_image(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.create_reference_image, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1745,7 +1745,7 @@ async def sample_delete_reference_image(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1772,7 +1772,7 @@ async def sample_delete_reference_image(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_reference_image, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1859,7 +1859,7 @@ async def sample_list_reference_images(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1894,7 +1894,7 @@ async def sample_list_reference_images(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_reference_images, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1991,7 +1991,7 @@ async def sample_get_reference_image(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2024,7 +2024,7 @@ async def sample_get_reference_image(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_reference_image, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -2125,7 +2125,7 @@ async def sample_add_product_to_product_set(): This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2154,7 +2154,7 @@ async def sample_add_product_to_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.add_product_to_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -2246,7 +2246,7 @@ async def sample_remove_product_from_product_set(): This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2275,7 +2275,7 @@ async def sample_remove_product_from_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.remove_product_from_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -2361,7 +2361,7 @@ async def sample_list_products_in_product_set(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2397,7 +2397,7 @@ async def sample_list_products_in_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_products_in_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -2513,7 +2513,7 @@ async def sample_import_product_sets(): This corresponds to the ``input_config`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2557,7 +2557,7 @@ async def sample_import_product_sets(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.import_product_sets, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py index f63cd6659b4a..858efe8cc1fa 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.vision_v1p4beta1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -274,7 +274,7 @@ async def sample_batch_annotate_images(): This corresponds to the ``requests`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -307,7 +307,7 @@ async def sample_batch_annotate_images(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.batch_annotate_images, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -388,7 +388,7 @@ async def sample_batch_annotate_files(): This corresponds to the ``requests`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -419,7 +419,7 @@ async def sample_batch_annotate_files(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.batch_annotate_files, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -515,7 +515,7 @@ async def sample_async_batch_annotate_images(): This corresponds to the ``output_config`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -553,7 +553,7 @@ async def sample_async_batch_annotate_images(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.async_batch_annotate_images, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -645,7 +645,7 @@ async def sample_async_batch_annotate_files(): This corresponds to the ``requests`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -681,7 +681,7 @@ async def sample_async_batch_annotate_files(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.async_batch_annotate_files, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py index 1f86bbea85cb..dc9912cf7c0e 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.vision_v1p4beta1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -320,7 +320,7 @@ async def sample_create_product_set(): This corresponds to the ``product_set_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -360,7 +360,7 @@ async def sample_create_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.create_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -445,7 +445,7 @@ async def sample_list_product_sets(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -480,7 +480,7 @@ async def sample_list_product_sets(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_product_sets, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -575,7 +575,7 @@ async def sample_get_product_set(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -611,7 +611,7 @@ async def sample_get_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -708,7 +708,7 @@ async def sample_update_product_set(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -746,7 +746,7 @@ async def sample_update_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.update_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -828,7 +828,7 @@ async def sample_delete_product_set(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -855,7 +855,7 @@ async def sample_delete_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -960,7 +960,7 @@ async def sample_create_product(): This corresponds to the ``product_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -995,7 +995,7 @@ async def sample_create_product(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.create_product, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1080,7 +1080,7 @@ async def sample_list_products(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1115,7 +1115,7 @@ async def sample_list_products(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_products, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1208,7 +1208,7 @@ async def sample_get_product(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1239,7 +1239,7 @@ async def sample_get_product(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_product, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1345,7 +1345,7 @@ async def sample_update_product(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1378,7 +1378,7 @@ async def sample_update_product(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.update_product, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1461,7 +1461,7 @@ async def sample_delete_product(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1488,7 +1488,7 @@ async def sample_delete_product(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_product, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1613,7 +1613,7 @@ async def sample_create_reference_image(): This corresponds to the ``reference_image_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1650,7 +1650,7 @@ async def sample_create_reference_image(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.create_reference_image, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1735,7 +1735,7 @@ async def sample_delete_reference_image(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1762,7 +1762,7 @@ async def sample_delete_reference_image(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_reference_image, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1849,7 +1849,7 @@ async def sample_list_reference_images(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1884,7 +1884,7 @@ async def sample_list_reference_images(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_reference_images, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1981,7 +1981,7 @@ async def sample_get_reference_image(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2014,7 +2014,7 @@ async def sample_get_reference_image(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_reference_image, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -2115,7 +2115,7 @@ async def sample_add_product_to_product_set(): This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2144,7 +2144,7 @@ async def sample_add_product_to_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.add_product_to_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -2231,7 +2231,7 @@ async def sample_remove_product_from_product_set(): This corresponds to the ``product`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2260,7 +2260,7 @@ async def sample_remove_product_from_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.remove_product_from_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -2346,7 +2346,7 @@ async def sample_list_products_in_product_set(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2382,7 +2382,7 @@ async def sample_list_products_in_product_set(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_products_in_product_set, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -2498,7 +2498,7 @@ async def sample_import_product_sets(): This corresponds to the ``input_config`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2542,7 +2542,7 @@ async def sample_import_product_sets(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.import_product_sets, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -2659,7 +2659,7 @@ async def sample_purge_products(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be diff --git a/packages/google-cloud-vision/noxfile.py b/packages/google-cloud-vision/noxfile.py index 716326a3d430..7d3551347c78 100644 --- a/packages/google-cloud-vision/noxfile.py +++ b/packages/google-cloud-vision/noxfile.py @@ -29,11 +29,13 @@ BLACK_VERSION = "black[jupyter]==23.7.0" ISORT_VERSION = "isort==5.11.0" + LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] + DEFAULT_PYTHON_VERSION = "3.10" -UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"] +UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", @@ -47,7 +49,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"] SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -89,6 +91,7 @@ def lint(session): "--check", *LINT_PATHS, ) + session.run("flake8", "google", "tests") @@ -336,7 +339,7 @@ def docfx(session): ) -@nox.session(python="3.11") +@nox.session(python="3.12") def prerelease_deps(session): """Run all tests with prerelease versions of dependencies installed.""" diff --git a/packages/google-cloud-vision/setup.py b/packages/google-cloud-vision/setup.py index d3cf5dc533f3..3f161f307b79 100644 --- a/packages/google-cloud-vision/setup.py +++ b/packages/google-cloud-vision/setup.py @@ -15,6 +15,7 @@ # import io import os +import re import setuptools # type: ignore @@ -25,10 +26,12 @@ description = "Google Cloud Vision API client library" -version = {} +version = None + with open(os.path.join(package_root, "google/cloud/vision/gapic_version.py")) as fp: - exec(fp.read(), version) -version = version["__version__"] + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert len(version_candidates) == 1 + version = version_candidates[0] if version[0] == "0": release_status = "Development Status :: 4 - Beta" @@ -37,11 +40,10 @@ dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", - "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "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", ] -url = "https://github.com/googleapis/google-cloud-python" +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-vision" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -51,12 +53,10 @@ packages = [ package - for package in setuptools.PEP420PackageFinder.find() + for package in setuptools.find_namespace_packages() if package.startswith("google") ] -namespaces = ["google", "google.cloud"] - setuptools.setup( name=name, version=version, @@ -77,13 +77,13 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Operating System :: OS Independent", "Topic :: Internet", ], platforms="Posix; MacOS X; Windows", packages=packages, python_requires=">=3.7", - namespace_packages=namespaces, install_requires=dependencies, include_package_data=True, zip_safe=False, diff --git a/packages/google-cloud-vision/testing/constraints-3.7.txt b/packages/google-cloud-vision/testing/constraints-3.7.txt index 6c44adfea7ee..185f7d366c2f 100644 --- a/packages/google-cloud-vision/testing/constraints-3.7.txt +++ b/packages/google-cloud-vision/testing/constraints-3.7.txt @@ -5,5 +5,5 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 -proto-plus==1.22.0 +proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-vpc-access/CONTRIBUTING.rst b/packages/google-cloud-vpc-access/CONTRIBUTING.rst index d421afd6c2eb..26582a748e1a 100644 --- a/packages/google-cloud-vpc-access/CONTRIBUTING.rst +++ b/packages/google-cloud-vpc-access/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.7, 3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows. + 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -72,7 +72,7 @@ We use `nox `__ to instrument our tests. - To run a single unit test:: - $ nox -s unit-3.11 -- -k + $ nox -s unit-3.12 -- -k .. note:: @@ -143,12 +143,12 @@ Running System Tests $ nox -s system # Run a single system test - $ nox -s system-3.11 -- -k + $ nox -s system-3.12 -- -k .. note:: - System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11. + System tests are only configured to run under Python 3.8, 3.9, 3.10, 3.11 and 3.12. For expediency, we do not run them in older versions of Python 3. This alone will not run the tests. You'll need to change some local @@ -226,12 +226,14 @@ We support: - `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ +- `Python 3.12`_ .. _Python 3.7: https://docs.python.org/3.7/ .. _Python 3.8: https://docs.python.org/3.8/ .. _Python 3.9: https://docs.python.org/3.9/ .. _Python 3.10: https://docs.python.org/3.10/ .. _Python 3.11: https://docs.python.org/3.11/ +.. _Python 3.12: https://docs.python.org/3.12/ Supported versions can be found in our ``noxfile.py`` `config`_. diff --git a/packages/google-cloud-vpc-access/google/cloud/vpcaccess_v1/services/vpc_access_service/async_client.py b/packages/google-cloud-vpc-access/google/cloud/vpcaccess_v1/services/vpc_access_service/async_client.py index ba3d60fd3409..98184ff2da9a 100644 --- a/packages/google-cloud-vpc-access/google/cloud/vpcaccess_v1/services/vpc_access_service/async_client.py +++ b/packages/google-cloud-vpc-access/google/cloud/vpcaccess_v1/services/vpc_access_service/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.vpcaccess_v1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -292,7 +292,7 @@ async def sample_create_connector(): This corresponds to the ``connector`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -410,7 +410,7 @@ async def sample_get_connector(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -513,7 +513,7 @@ async def sample_list_connectors(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -632,7 +632,7 @@ async def sample_delete_connector(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -718,7 +718,7 @@ async def list_operations( request (:class:`~.operations_pb2.ListOperationsRequest`): The request object. Request message for `ListOperations` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -735,7 +735,7 @@ async def list_operations( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_operations, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -772,7 +772,7 @@ async def get_operation( request (:class:`~.operations_pb2.GetOperationRequest`): The request object. Request message for `GetOperation` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -789,7 +789,7 @@ async def get_operation( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_operation, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -826,7 +826,7 @@ async def list_locations( request (:class:`~.location_pb2.ListLocationsRequest`): The request object. Request message for `ListLocations` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -843,7 +843,7 @@ async def list_locations( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_locations, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, diff --git a/packages/google-cloud-vpc-access/noxfile.py b/packages/google-cloud-vpc-access/noxfile.py index 716326a3d430..7d3551347c78 100644 --- a/packages/google-cloud-vpc-access/noxfile.py +++ b/packages/google-cloud-vpc-access/noxfile.py @@ -29,11 +29,13 @@ BLACK_VERSION = "black[jupyter]==23.7.0" ISORT_VERSION = "isort==5.11.0" + LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] + DEFAULT_PYTHON_VERSION = "3.10" -UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"] +UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", @@ -47,7 +49,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"] SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -89,6 +91,7 @@ def lint(session): "--check", *LINT_PATHS, ) + session.run("flake8", "google", "tests") @@ -336,7 +339,7 @@ def docfx(session): ) -@nox.session(python="3.11") +@nox.session(python="3.12") def prerelease_deps(session): """Run all tests with prerelease versions of dependencies installed.""" diff --git a/packages/google-cloud-vpc-access/setup.py b/packages/google-cloud-vpc-access/setup.py index df869d09e9f7..618f1f223447 100644 --- a/packages/google-cloud-vpc-access/setup.py +++ b/packages/google-cloud-vpc-access/setup.py @@ -15,6 +15,7 @@ # import io import os +import re import setuptools # type: ignore @@ -25,10 +26,12 @@ description = "Google Cloud Vpc Access API client library" -version = {} +version = None + with open(os.path.join(package_root, "google/cloud/vpcaccess/gapic_version.py")) as fp: - exec(fp.read(), version) -version = version["__version__"] + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert len(version_candidates) == 1 + version = version_candidates[0] if version[0] == "0": release_status = "Development Status :: 4 - Beta" @@ -37,11 +40,10 @@ dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", - "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "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", ] -url = "https://github.com/googleapis/google-cloud-python" +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-vpc-access" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -51,12 +53,10 @@ packages = [ package - for package in setuptools.PEP420PackageFinder.find() + for package in setuptools.find_namespace_packages() if package.startswith("google") ] -namespaces = ["google", "google.cloud"] - setuptools.setup( name=name, version=version, @@ -77,13 +77,13 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Operating System :: OS Independent", "Topic :: Internet", ], platforms="Posix; MacOS X; Windows", packages=packages, python_requires=">=3.7", - namespace_packages=namespaces, install_requires=dependencies, include_package_data=True, zip_safe=False, diff --git a/packages/google-cloud-vpc-access/testing/constraints-3.7.txt b/packages/google-cloud-vpc-access/testing/constraints-3.7.txt index 6c44adfea7ee..185f7d366c2f 100644 --- a/packages/google-cloud-vpc-access/testing/constraints-3.7.txt +++ b/packages/google-cloud-vpc-access/testing/constraints-3.7.txt @@ -5,5 +5,5 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 -proto-plus==1.22.0 +proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-vpc-access/tests/unit/gapic/vpcaccess_v1/test_vpc_access_service.py b/packages/google-cloud-vpc-access/tests/unit/gapic/vpcaccess_v1/test_vpc_access_service.py index 8d34fe1fa89c..908fcc261cdc 100644 --- a/packages/google-cloud-vpc-access/tests/unit/gapic/vpcaccess_v1/test_vpc_access_service.py +++ b/packages/google-cloud-vpc-access/tests/unit/gapic/vpcaccess_v1/test_vpc_access_service.py @@ -4133,7 +4133,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation_async(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc_asyncio"): client = VpcAccessServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4278,7 +4278,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations_async(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc_asyncio"): client = VpcAccessServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4423,7 +4423,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations_async(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc_asyncio"): client = VpcAccessServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/packages/google-cloud-webrisk/CONTRIBUTING.rst b/packages/google-cloud-webrisk/CONTRIBUTING.rst index 104619995530..80bfd736437d 100644 --- a/packages/google-cloud-webrisk/CONTRIBUTING.rst +++ b/packages/google-cloud-webrisk/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.7, 3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows. + 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -72,7 +72,7 @@ We use `nox `__ to instrument our tests. - To run a single unit test:: - $ nox -s unit-3.11 -- -k + $ nox -s unit-3.12 -- -k .. note:: @@ -143,12 +143,12 @@ Running System Tests $ nox -s system # Run a single system test - $ nox -s system-3.11 -- -k + $ nox -s system-3.12 -- -k .. note:: - System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11. + System tests are only configured to run under Python 3.8, 3.9, 3.10, 3.11 and 3.12. For expediency, we do not run them in older versions of Python 3. This alone will not run the tests. You'll need to change some local @@ -226,12 +226,14 @@ We support: - `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ +- `Python 3.12`_ .. _Python 3.7: https://docs.python.org/3.7/ .. _Python 3.8: https://docs.python.org/3.8/ .. _Python 3.9: https://docs.python.org/3.9/ .. _Python 3.10: https://docs.python.org/3.10/ .. _Python 3.11: https://docs.python.org/3.11/ +.. _Python 3.12: https://docs.python.org/3.12/ Supported versions can be found in our ``noxfile.py`` `config`_. diff --git a/packages/google-cloud-webrisk/google/cloud/webrisk_v1/services/web_risk_service/async_client.py b/packages/google-cloud-webrisk/google/cloud/webrisk_v1/services/web_risk_service/async_client.py index d2c4d15c79ab..4b5561dfb784 100644 --- a/packages/google-cloud-webrisk/google/cloud/webrisk_v1/services/web_risk_service/async_client.py +++ b/packages/google-cloud-webrisk/google/cloud/webrisk_v1/services/web_risk_service/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.webrisk_v1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -298,7 +298,7 @@ async def sample_compute_threat_list_diff(): This corresponds to the ``constraints`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -333,7 +333,7 @@ async def sample_compute_threat_list_diff(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.compute_threat_list_diff, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -421,7 +421,7 @@ async def sample_search_uris(): This corresponds to the ``threat_types`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -454,7 +454,7 @@ async def sample_search_uris(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.search_uris, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -546,7 +546,7 @@ async def sample_search_hashes(): This corresponds to the ``threat_types`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -579,7 +579,7 @@ async def sample_search_hashes(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.search_hashes, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -674,7 +674,7 @@ async def sample_create_submission(): This corresponds to the ``submission`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -789,7 +789,7 @@ async def sample_submit_uri(): request (Optional[Union[google.cloud.webrisk_v1.types.SubmitUriRequest, dict]]): The request object. Request to send a potentially malicious URI to WebRisk. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -854,7 +854,7 @@ async def list_operations( request (:class:`~.operations_pb2.ListOperationsRequest`): The request object. Request message for `ListOperations` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -871,7 +871,7 @@ async def list_operations( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_operations, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -908,7 +908,7 @@ async def get_operation( request (:class:`~.operations_pb2.GetOperationRequest`): The request object. Request message for `GetOperation` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -925,7 +925,7 @@ async def get_operation( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_operation, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -967,7 +967,7 @@ async def delete_operation( request (:class:`~.operations_pb2.DeleteOperationRequest`): The request object. Request message for `DeleteOperation` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -983,7 +983,7 @@ async def delete_operation( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_operation, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -1021,7 +1021,7 @@ async def cancel_operation( request (:class:`~.operations_pb2.CancelOperationRequest`): The request object. Request message for `CancelOperation` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1037,7 +1037,7 @@ async def cancel_operation( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.cancel_operation, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, diff --git a/packages/google-cloud-webrisk/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/async_client.py b/packages/google-cloud-webrisk/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/async_client.py index 59da20d74e65..ec849823915b 100644 --- a/packages/google-cloud-webrisk/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/async_client.py +++ b/packages/google-cloud-webrisk/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.webrisk_v1beta1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -281,7 +281,7 @@ async def sample_compute_threat_list_diff(): This corresponds to the ``constraints`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -316,7 +316,7 @@ async def sample_compute_threat_list_diff(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.compute_threat_list_diff, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -399,7 +399,7 @@ async def sample_search_uris(): This corresponds to the ``threat_types`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -432,7 +432,7 @@ async def sample_search_uris(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.search_uris, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -520,7 +520,7 @@ async def sample_search_hashes(): This corresponds to the ``threat_types`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -553,7 +553,7 @@ async def sample_search_hashes(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.search_hashes, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, diff --git a/packages/google-cloud-webrisk/noxfile.py b/packages/google-cloud-webrisk/noxfile.py index 716326a3d430..7d3551347c78 100644 --- a/packages/google-cloud-webrisk/noxfile.py +++ b/packages/google-cloud-webrisk/noxfile.py @@ -29,11 +29,13 @@ BLACK_VERSION = "black[jupyter]==23.7.0" ISORT_VERSION = "isort==5.11.0" + LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] + DEFAULT_PYTHON_VERSION = "3.10" -UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"] +UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", @@ -47,7 +49,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"] SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -89,6 +91,7 @@ def lint(session): "--check", *LINT_PATHS, ) + session.run("flake8", "google", "tests") @@ -336,7 +339,7 @@ def docfx(session): ) -@nox.session(python="3.11") +@nox.session(python="3.12") def prerelease_deps(session): """Run all tests with prerelease versions of dependencies installed.""" diff --git a/packages/google-cloud-webrisk/setup.py b/packages/google-cloud-webrisk/setup.py index 33e7cf2dc4db..03e56ed429d3 100644 --- a/packages/google-cloud-webrisk/setup.py +++ b/packages/google-cloud-webrisk/setup.py @@ -15,6 +15,7 @@ # import io import os +import re import setuptools # type: ignore @@ -25,10 +26,12 @@ description = "Google Cloud Webrisk API client library" -version = {} +version = None + with open(os.path.join(package_root, "google/cloud/webrisk/gapic_version.py")) as fp: - exec(fp.read(), version) -version = version["__version__"] + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert len(version_candidates) == 1 + version = version_candidates[0] if version[0] == "0": release_status = "Development Status :: 4 - Beta" @@ -37,11 +40,10 @@ dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", - "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "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", ] -url = "https://github.com/googleapis/google-cloud-python" +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-webrisk" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -51,12 +53,10 @@ packages = [ package - for package in setuptools.PEP420PackageFinder.find() + for package in setuptools.find_namespace_packages() if package.startswith("google") ] -namespaces = ["google", "google.cloud"] - setuptools.setup( name=name, version=version, @@ -77,13 +77,13 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Operating System :: OS Independent", "Topic :: Internet", ], platforms="Posix; MacOS X; Windows", packages=packages, python_requires=">=3.7", - namespace_packages=namespaces, install_requires=dependencies, include_package_data=True, zip_safe=False, diff --git a/packages/google-cloud-webrisk/testing/constraints-3.7.txt b/packages/google-cloud-webrisk/testing/constraints-3.7.txt index 6c44adfea7ee..185f7d366c2f 100644 --- a/packages/google-cloud-webrisk/testing/constraints-3.7.txt +++ b/packages/google-cloud-webrisk/testing/constraints-3.7.txt @@ -5,5 +5,5 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 -proto-plus==1.22.0 +proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-webrisk/tests/unit/gapic/webrisk_v1/test_web_risk_service.py b/packages/google-cloud-webrisk/tests/unit/gapic/webrisk_v1/test_web_risk_service.py index 8ffd5cf5a40b..703d33373f2d 100644 --- a/packages/google-cloud-webrisk/tests/unit/gapic/webrisk_v1/test_web_risk_service.py +++ b/packages/google-cloud-webrisk/tests/unit/gapic/webrisk_v1/test_web_risk_service.py @@ -4116,7 +4116,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation_async(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc_asyncio"): client = WebRiskServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4255,7 +4255,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation_async(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc_asyncio"): client = WebRiskServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4394,7 +4394,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation_async(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc_asyncio"): client = WebRiskServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4539,7 +4539,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations_async(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc_asyncio"): client = WebRiskServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/packages/google-cloud-websecurityscanner/CONTRIBUTING.rst b/packages/google-cloud-websecurityscanner/CONTRIBUTING.rst index c4b771848f79..1ad415409657 100644 --- a/packages/google-cloud-websecurityscanner/CONTRIBUTING.rst +++ b/packages/google-cloud-websecurityscanner/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.7, 3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows. + 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -72,7 +72,7 @@ We use `nox `__ to instrument our tests. - To run a single unit test:: - $ nox -s unit-3.11 -- -k + $ nox -s unit-3.12 -- -k .. note:: @@ -143,12 +143,12 @@ Running System Tests $ nox -s system # Run a single system test - $ nox -s system-3.11 -- -k + $ nox -s system-3.12 -- -k .. note:: - System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11. + System tests are only configured to run under Python 3.8, 3.9, 3.10, 3.11 and 3.12. For expediency, we do not run them in older versions of Python 3. This alone will not run the tests. You'll need to change some local @@ -226,12 +226,14 @@ We support: - `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ +- `Python 3.12`_ .. _Python 3.7: https://docs.python.org/3.7/ .. _Python 3.8: https://docs.python.org/3.8/ .. _Python 3.9: https://docs.python.org/3.9/ .. _Python 3.10: https://docs.python.org/3.10/ .. _Python 3.11: https://docs.python.org/3.11/ +.. _Python 3.12: https://docs.python.org/3.12/ Supported versions can be found in our ``noxfile.py`` `config`_. diff --git a/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1/services/web_security_scanner/async_client.py b/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1/services/web_security_scanner/async_client.py index 2625cde5f364..157113340a27 100644 --- a/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1/services/web_security_scanner/async_client.py +++ b/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1/services/web_security_scanner/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.websecurityscanner_v1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -271,7 +271,7 @@ async def sample_create_scan_config(): Args: request (Optional[Union[google.cloud.websecurityscanner_v1.types.CreateScanConfigRequest, dict]]): The request object. Request for the ``CreateScanConfig`` method. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -349,7 +349,7 @@ async def sample_delete_scan_config(): Args: request (Optional[Union[google.cloud.websecurityscanner_v1.types.DeleteScanConfigRequest, dict]]): The request object. Request for the ``DeleteScanConfig`` method. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -362,7 +362,7 @@ async def sample_delete_scan_config(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_scan_config, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -430,7 +430,7 @@ async def sample_get_scan_config(): Args: request (Optional[Union[google.cloud.websecurityscanner_v1.types.GetScanConfigRequest, dict]]): The request object. Request for the ``GetScanConfig`` method. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -449,7 +449,7 @@ async def sample_get_scan_config(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_scan_config, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -521,7 +521,7 @@ async def sample_list_scan_configs(): Args: request (Optional[Union[google.cloud.websecurityscanner_v1.types.ListScanConfigsRequest, dict]]): The request object. Request for the ``ListScanConfigs`` method. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -542,7 +542,7 @@ async def sample_list_scan_configs(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_scan_configs, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -623,7 +623,7 @@ async def sample_update_scan_config(): Args: request (Optional[Union[google.cloud.websecurityscanner_v1.types.UpdateScanConfigRequest, dict]]): The request object. Request for the ``UpdateScanConfigRequest`` method. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -703,7 +703,7 @@ async def sample_start_scan_run(): Args: request (Optional[Union[google.cloud.websecurityscanner_v1.types.StartScanRunRequest, dict]]): The request object. Request for the ``StartScanRun`` method. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -782,7 +782,7 @@ async def sample_get_scan_run(): Args: request (Optional[Union[google.cloud.websecurityscanner_v1.types.GetScanRunRequest, dict]]): The request object. Request for the ``GetScanRun`` method. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -802,7 +802,7 @@ async def sample_get_scan_run(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_scan_run, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -873,7 +873,7 @@ async def sample_list_scan_runs(): Args: request (Optional[Union[google.cloud.websecurityscanner_v1.types.ListScanRunsRequest, dict]]): The request object. Request for the ``ListScanRuns`` method. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -894,7 +894,7 @@ async def sample_list_scan_runs(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_scan_runs, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -972,7 +972,7 @@ async def sample_stop_scan_run(): Args: request (Optional[Union[google.cloud.websecurityscanner_v1.types.StopScanRunRequest, dict]]): The request object. Request for the ``StopScanRun`` method. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1054,7 +1054,7 @@ async def sample_list_crawled_urls(): Args: request (Optional[Union[google.cloud.websecurityscanner_v1.types.ListCrawledUrlsRequest, dict]]): The request object. Request for the ``ListCrawledUrls`` method. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1075,7 +1075,7 @@ async def sample_list_crawled_urls(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_crawled_urls, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1153,7 +1153,7 @@ async def sample_get_finding(): Args: request (Optional[Union[google.cloud.websecurityscanner_v1.types.GetFindingRequest, dict]]): The request object. Request for the ``GetFinding`` method. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1173,7 +1173,7 @@ async def sample_get_finding(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_finding, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1243,7 +1243,7 @@ async def sample_list_findings(): Args: request (Optional[Union[google.cloud.websecurityscanner_v1.types.ListFindingsRequest, dict]]): The request object. Request for the ``ListFindings`` method. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1264,7 +1264,7 @@ async def sample_list_findings(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_findings, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1344,7 +1344,7 @@ async def sample_list_finding_type_stats(): Args: request (Optional[Union[google.cloud.websecurityscanner_v1.types.ListFindingTypeStatsRequest, dict]]): The request object. Request for the ``ListFindingTypeStats`` method. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1361,7 +1361,7 @@ async def sample_list_finding_type_stats(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_finding_type_stats, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, diff --git a/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1alpha/services/web_security_scanner/async_client.py b/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1alpha/services/web_security_scanner/async_client.py index 6548c1f278c4..e3eceba286be 100644 --- a/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1alpha/services/web_security_scanner/async_client.py +++ b/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1alpha/services/web_security_scanner/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.websecurityscanner_v1alpha import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -300,7 +300,7 @@ async def sample_create_scan_config(): This corresponds to the ``scan_config`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -406,7 +406,7 @@ async def sample_delete_scan_config(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -433,7 +433,7 @@ async def sample_delete_scan_config(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_scan_config, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -512,7 +512,7 @@ async def sample_get_scan_config(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -546,7 +546,7 @@ async def sample_get_scan_config(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_scan_config, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -628,7 +628,7 @@ async def sample_list_scan_configs(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -663,7 +663,7 @@ async def sample_list_scan_configs(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_scan_configs, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -769,7 +769,7 @@ async def sample_update_scan_config(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -877,7 +877,7 @@ async def sample_start_scan_run(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -980,7 +980,7 @@ async def sample_get_scan_run(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1013,7 +1013,7 @@ async def sample_get_scan_run(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_scan_run, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1095,7 +1095,7 @@ async def sample_list_scan_runs(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1130,7 +1130,7 @@ async def sample_list_scan_runs(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_scan_runs, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1219,7 +1219,7 @@ async def sample_stop_scan_run(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1325,7 +1325,7 @@ async def sample_list_crawled_urls(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1360,7 +1360,7 @@ async def sample_list_crawled_urls(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_crawled_urls, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1449,7 +1449,7 @@ async def sample_get_finding(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1483,7 +1483,7 @@ async def sample_get_finding(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_finding, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1574,7 +1574,7 @@ async def sample_list_findings(): This corresponds to the ``filter`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1611,7 +1611,7 @@ async def sample_list_findings(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_findings, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1702,7 +1702,7 @@ async def sample_list_finding_type_stats(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1733,7 +1733,7 @@ async def sample_list_finding_type_stats(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_finding_type_stats, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, diff --git a/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1beta/services/web_security_scanner/async_client.py b/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1beta/services/web_security_scanner/async_client.py index c5ad1bb0f89d..faad686180cb 100644 --- a/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1beta/services/web_security_scanner/async_client.py +++ b/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1beta/services/web_security_scanner/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.websecurityscanner_v1beta import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -305,7 +305,7 @@ async def sample_create_scan_config(): This corresponds to the ``scan_config`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -410,7 +410,7 @@ async def sample_delete_scan_config(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -437,7 +437,7 @@ async def sample_delete_scan_config(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_scan_config, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -516,7 +516,7 @@ async def sample_get_scan_config(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -549,7 +549,7 @@ async def sample_get_scan_config(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_scan_config, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -631,7 +631,7 @@ async def sample_list_scan_configs(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -666,7 +666,7 @@ async def sample_list_scan_configs(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_scan_configs, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -772,7 +772,7 @@ async def sample_update_scan_config(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -879,7 +879,7 @@ async def sample_start_scan_run(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -983,7 +983,7 @@ async def sample_get_scan_run(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1017,7 +1017,7 @@ async def sample_get_scan_run(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_scan_run, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1099,7 +1099,7 @@ async def sample_list_scan_runs(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1134,7 +1134,7 @@ async def sample_list_scan_runs(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_scan_runs, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1223,7 +1223,7 @@ async def sample_stop_scan_run(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1330,7 +1330,7 @@ async def sample_list_crawled_urls(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1365,7 +1365,7 @@ async def sample_list_crawled_urls(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_crawled_urls, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1454,7 +1454,7 @@ async def sample_get_finding(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1488,7 +1488,7 @@ async def sample_get_finding(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_finding, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1579,7 +1579,7 @@ async def sample_list_findings(): This corresponds to the ``filter`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1616,7 +1616,7 @@ async def sample_list_findings(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_findings, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, @@ -1707,7 +1707,7 @@ async def sample_list_finding_type_stats(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1738,7 +1738,7 @@ async def sample_list_finding_type_stats(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_finding_type_stats, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.1, maximum=60.0, multiplier=1.3, diff --git a/packages/google-cloud-websecurityscanner/noxfile.py b/packages/google-cloud-websecurityscanner/noxfile.py index 716326a3d430..7d3551347c78 100644 --- a/packages/google-cloud-websecurityscanner/noxfile.py +++ b/packages/google-cloud-websecurityscanner/noxfile.py @@ -29,11 +29,13 @@ BLACK_VERSION = "black[jupyter]==23.7.0" ISORT_VERSION = "isort==5.11.0" + LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] + DEFAULT_PYTHON_VERSION = "3.10" -UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"] +UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", @@ -47,7 +49,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"] SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -89,6 +91,7 @@ def lint(session): "--check", *LINT_PATHS, ) + session.run("flake8", "google", "tests") @@ -336,7 +339,7 @@ def docfx(session): ) -@nox.session(python="3.11") +@nox.session(python="3.12") def prerelease_deps(session): """Run all tests with prerelease versions of dependencies installed.""" diff --git a/packages/google-cloud-websecurityscanner/setup.py b/packages/google-cloud-websecurityscanner/setup.py index ac7cc7adabd1..30f6fc6d7e25 100644 --- a/packages/google-cloud-websecurityscanner/setup.py +++ b/packages/google-cloud-websecurityscanner/setup.py @@ -15,6 +15,7 @@ # import io import os +import re import setuptools # type: ignore @@ -25,12 +26,14 @@ description = "Google Cloud Websecurityscanner API client library" -version = {} +version = None + with open( os.path.join(package_root, "google/cloud/websecurityscanner/gapic_version.py") ) as fp: - exec(fp.read(), version) -version = version["__version__"] + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert len(version_candidates) == 1 + version = version_candidates[0] if version[0] == "0": release_status = "Development Status :: 4 - Beta" @@ -39,11 +42,10 @@ dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", - "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "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", ] -url = "https://github.com/googleapis/google-cloud-python" +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-websecurityscanner" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -53,12 +55,10 @@ packages = [ package - for package in setuptools.PEP420PackageFinder.find() + for package in setuptools.find_namespace_packages() if package.startswith("google") ] -namespaces = ["google", "google.cloud"] - setuptools.setup( name=name, version=version, @@ -79,13 +79,13 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Operating System :: OS Independent", "Topic :: Internet", ], platforms="Posix; MacOS X; Windows", packages=packages, python_requires=">=3.7", - namespace_packages=namespaces, install_requires=dependencies, include_package_data=True, zip_safe=False, diff --git a/packages/google-cloud-websecurityscanner/testing/constraints-3.7.txt b/packages/google-cloud-websecurityscanner/testing/constraints-3.7.txt index 6c44adfea7ee..185f7d366c2f 100644 --- a/packages/google-cloud-websecurityscanner/testing/constraints-3.7.txt +++ b/packages/google-cloud-websecurityscanner/testing/constraints-3.7.txt @@ -5,5 +5,5 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 -proto-plus==1.22.0 +proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-workflows/CONTRIBUTING.rst b/packages/google-cloud-workflows/CONTRIBUTING.rst index d560762c75fa..046ef04f44f4 100644 --- a/packages/google-cloud-workflows/CONTRIBUTING.rst +++ b/packages/google-cloud-workflows/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.7, 3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows. + 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -72,7 +72,7 @@ We use `nox `__ to instrument our tests. - To run a single unit test:: - $ nox -s unit-3.11 -- -k + $ nox -s unit-3.12 -- -k .. note:: @@ -143,12 +143,12 @@ Running System Tests $ nox -s system # Run a single system test - $ nox -s system-3.11 -- -k + $ nox -s system-3.12 -- -k .. note:: - System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11. + System tests are only configured to run under Python 3.8, 3.9, 3.10, 3.11 and 3.12. For expediency, we do not run them in older versions of Python 3. This alone will not run the tests. You'll need to change some local @@ -226,12 +226,14 @@ We support: - `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ +- `Python 3.12`_ .. _Python 3.7: https://docs.python.org/3.7/ .. _Python 3.8: https://docs.python.org/3.8/ .. _Python 3.9: https://docs.python.org/3.9/ .. _Python 3.10: https://docs.python.org/3.10/ .. _Python 3.11: https://docs.python.org/3.11/ +.. _Python 3.12: https://docs.python.org/3.12/ Supported versions can be found in our ``noxfile.py`` `config`_. diff --git a/packages/google-cloud-workflows/docs/index.rst b/packages/google-cloud-workflows/docs/index.rst index 00abd072c2d9..d3bd314fa93c 100644 --- a/packages/google-cloud-workflows/docs/index.rst +++ b/packages/google-cloud-workflows/docs/index.rst @@ -23,6 +23,23 @@ API Reference workflows_v1beta/types_ +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + executions_v1/services_ + executions_v1/types_ + +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + executions_v1beta/services_ + executions_v1beta/types_ + + Changelog --------- @@ -31,4 +48,4 @@ For a list of all ``google-cloud-workflows`` releases: .. toctree:: :maxdepth: 2 - CHANGELOG + CHANGELOG \ No newline at end of file diff --git a/packages/google-cloud-workflows/google/cloud/workflows/executions_v1/services/executions/async_client.py b/packages/google-cloud-workflows/google/cloud/workflows/executions_v1/services/executions/async_client.py index 81cd889bec09..f0e0558123b4 100644 --- a/packages/google-cloud-workflows/google/cloud/workflows/executions_v1/services/executions/async_client.py +++ b/packages/google-cloud-workflows/google/cloud/workflows/executions_v1/services/executions/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.workflows.executions_v1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.protobuf import duration_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -269,7 +269,7 @@ async def sample_list_executions(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -396,7 +396,7 @@ async def sample_create_execution(): This corresponds to the ``execution`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -503,7 +503,7 @@ async def sample_get_execution(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -608,7 +608,7 @@ async def sample_cancel_execution(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be diff --git a/packages/google-cloud-workflows/google/cloud/workflows/executions_v1beta/services/executions/async_client.py b/packages/google-cloud-workflows/google/cloud/workflows/executions_v1beta/services/executions/async_client.py index 99df3dcddbaf..11aba4e3523b 100644 --- a/packages/google-cloud-workflows/google/cloud/workflows/executions_v1beta/services/executions/async_client.py +++ b/packages/google-cloud-workflows/google/cloud/workflows/executions_v1beta/services/executions/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.workflows.executions_v1beta import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -271,7 +271,7 @@ async def sample_list_executions(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -398,7 +398,7 @@ async def sample_create_execution(): This corresponds to the ``execution`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -505,7 +505,7 @@ async def sample_get_execution(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -610,7 +610,7 @@ async def sample_cancel_execution(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be diff --git a/packages/google-cloud-workflows/google/cloud/workflows_v1/services/workflows/async_client.py b/packages/google-cloud-workflows/google/cloud/workflows_v1/services/workflows/async_client.py index 699d5a8932df..cac2af965faa 100644 --- a/packages/google-cloud-workflows/google/cloud/workflows_v1/services/workflows/async_client.py +++ b/packages/google-cloud-workflows/google/cloud/workflows_v1/services/workflows/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.workflows_v1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -274,7 +274,7 @@ async def sample_list_workflows(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -392,7 +392,7 @@ async def sample_get_workflow(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -531,7 +531,7 @@ async def sample_create_workflow(): This corresponds to the ``workflow_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -656,7 +656,7 @@ async def sample_delete_workflow(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -796,7 +796,7 @@ async def sample_update_workflow(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -879,7 +879,7 @@ async def list_operations( request (:class:`~.operations_pb2.ListOperationsRequest`): The request object. Request message for `ListOperations` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -896,7 +896,7 @@ async def list_operations( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_operations, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -933,7 +933,7 @@ async def get_operation( request (:class:`~.operations_pb2.GetOperationRequest`): The request object. Request message for `GetOperation` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -950,7 +950,7 @@ async def get_operation( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_operation, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -992,7 +992,7 @@ async def delete_operation( request (:class:`~.operations_pb2.DeleteOperationRequest`): The request object. Request message for `DeleteOperation` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1008,7 +1008,7 @@ async def delete_operation( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_operation, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -1042,7 +1042,7 @@ async def get_location( request (:class:`~.location_pb2.GetLocationRequest`): The request object. Request message for `GetLocation` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1059,7 +1059,7 @@ async def get_location( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_location, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -1096,7 +1096,7 @@ async def list_locations( request (:class:`~.location_pb2.ListLocationsRequest`): The request object. Request message for `ListLocations` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1113,7 +1113,7 @@ async def list_locations( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_locations, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, diff --git a/packages/google-cloud-workflows/google/cloud/workflows_v1beta/services/workflows/async_client.py b/packages/google-cloud-workflows/google/cloud/workflows_v1beta/services/workflows/async_client.py index 6727a3450e61..15decfd37c37 100644 --- a/packages/google-cloud-workflows/google/cloud/workflows_v1beta/services/workflows/async_client.py +++ b/packages/google-cloud-workflows/google/cloud/workflows_v1beta/services/workflows/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.workflows_v1beta import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -270,7 +270,7 @@ async def sample_list_workflows(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -387,7 +387,7 @@ async def sample_get_workflow(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -526,7 +526,7 @@ async def sample_create_workflow(): This corresponds to the ``workflow_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -651,7 +651,7 @@ async def sample_delete_workflow(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -791,7 +791,7 @@ async def sample_update_workflow(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be diff --git a/packages/google-cloud-workflows/noxfile.py b/packages/google-cloud-workflows/noxfile.py index 716326a3d430..7d3551347c78 100644 --- a/packages/google-cloud-workflows/noxfile.py +++ b/packages/google-cloud-workflows/noxfile.py @@ -29,11 +29,13 @@ BLACK_VERSION = "black[jupyter]==23.7.0" ISORT_VERSION = "isort==5.11.0" + LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] + DEFAULT_PYTHON_VERSION = "3.10" -UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"] +UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", @@ -47,7 +49,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"] SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -89,6 +91,7 @@ def lint(session): "--check", *LINT_PATHS, ) + session.run("flake8", "google", "tests") @@ -336,7 +339,7 @@ def docfx(session): ) -@nox.session(python="3.11") +@nox.session(python="3.12") def prerelease_deps(session): """Run all tests with prerelease versions of dependencies installed.""" diff --git a/packages/google-cloud-workflows/setup.py b/packages/google-cloud-workflows/setup.py index a094fea85b0c..59e1109d12cc 100644 --- a/packages/google-cloud-workflows/setup.py +++ b/packages/google-cloud-workflows/setup.py @@ -15,6 +15,7 @@ # import io import os +import re import setuptools # type: ignore @@ -25,10 +26,12 @@ description = "Google Cloud Workflows API client library" -version = {} +version = None + with open(os.path.join(package_root, "google/cloud/workflows/gapic_version.py")) as fp: - exec(fp.read(), version) -version = version["__version__"] + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert len(version_candidates) == 1 + version = version_candidates[0] if version[0] == "0": release_status = "Development Status :: 4 - Beta" @@ -37,11 +40,10 @@ dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", - "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "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", ] -url = "https://github.com/googleapis/google-cloud-python" +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-workflows" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -51,12 +53,10 @@ packages = [ package - for package in setuptools.PEP420PackageFinder.find() + for package in setuptools.find_namespace_packages() if package.startswith("google") ] -namespaces = ["google", "google.cloud"] - setuptools.setup( name=name, version=version, @@ -77,13 +77,13 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Operating System :: OS Independent", "Topic :: Internet", ], platforms="Posix; MacOS X; Windows", packages=packages, python_requires=">=3.7", - namespace_packages=namespaces, install_requires=dependencies, include_package_data=True, zip_safe=False, diff --git a/packages/google-cloud-workflows/testing/constraints-3.7.txt b/packages/google-cloud-workflows/testing/constraints-3.7.txt index 6c44adfea7ee..185f7d366c2f 100644 --- a/packages/google-cloud-workflows/testing/constraints-3.7.txt +++ b/packages/google-cloud-workflows/testing/constraints-3.7.txt @@ -5,5 +5,5 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 -proto-plus==1.22.0 +proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-workflows/tests/unit/gapic/workflows_v1/test_workflows.py b/packages/google-cloud-workflows/tests/unit/gapic/workflows_v1/test_workflows.py index 512ee672ae64..2036190a7f15 100644 --- a/packages/google-cloud-workflows/tests/unit/gapic/workflows_v1/test_workflows.py +++ b/packages/google-cloud-workflows/tests/unit/gapic/workflows_v1/test_workflows.py @@ -4784,7 +4784,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation_async(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc_asyncio"): client = WorkflowsAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4923,7 +4923,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation_async(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc_asyncio"): client = WorkflowsAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5068,7 +5068,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations_async(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc_asyncio"): client = WorkflowsAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5213,7 +5213,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations_async(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc_asyncio"): client = WorkflowsAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/packages/google-cloud-workstations/CONTRIBUTING.rst b/packages/google-cloud-workstations/CONTRIBUTING.rst index 5feb95f22aa6..274276f0349b 100644 --- a/packages/google-cloud-workstations/CONTRIBUTING.rst +++ b/packages/google-cloud-workstations/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.7, 3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows. + 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -72,7 +72,7 @@ We use `nox `__ to instrument our tests. - To run a single unit test:: - $ nox -s unit-3.11 -- -k + $ nox -s unit-3.12 -- -k .. note:: @@ -143,12 +143,12 @@ Running System Tests $ nox -s system # Run a single system test - $ nox -s system-3.11 -- -k + $ nox -s system-3.12 -- -k .. note:: - System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11. + System tests are only configured to run under Python 3.8, 3.9, 3.10, 3.11 and 3.12. For expediency, we do not run them in older versions of Python 3. This alone will not run the tests. You'll need to change some local @@ -226,12 +226,14 @@ We support: - `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ +- `Python 3.12`_ .. _Python 3.7: https://docs.python.org/3.7/ .. _Python 3.8: https://docs.python.org/3.8/ .. _Python 3.9: https://docs.python.org/3.9/ .. _Python 3.10: https://docs.python.org/3.10/ .. _Python 3.11: https://docs.python.org/3.11/ +.. _Python 3.12: https://docs.python.org/3.12/ Supported versions can be found in our ``noxfile.py`` `config`_. diff --git a/packages/google-cloud-workstations/google/cloud/workstations_v1/services/workstations/async_client.py b/packages/google-cloud-workstations/google/cloud/workstations_v1/services/workstations/async_client.py index 371f611bbd3c..4cd32c20b3e1 100644 --- a/packages/google-cloud-workstations/google/cloud/workstations_v1/services/workstations/async_client.py +++ b/packages/google-cloud-workstations/google/cloud/workstations_v1/services/workstations/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.workstations_v1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -279,7 +279,7 @@ async def sample_get_workstation_cluster(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -315,7 +315,7 @@ async def sample_get_workstation_cluster(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_workstation_cluster, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -395,7 +395,7 @@ async def sample_list_workstation_clusters(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -431,7 +431,7 @@ async def sample_list_workstation_clusters(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_workstation_clusters, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -539,7 +539,7 @@ async def sample_create_workstation_cluster(): This corresponds to the ``workstation_cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -676,7 +676,7 @@ async def sample_update_workstation_cluster(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -803,7 +803,7 @@ async def sample_delete_workstation_cluster(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -920,7 +920,7 @@ async def sample_get_workstation_config(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -964,7 +964,7 @@ async def sample_get_workstation_config(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_workstation_config, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -1044,7 +1044,7 @@ async def sample_list_workstation_configs(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1080,7 +1080,7 @@ async def sample_list_workstation_configs(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_workstation_configs, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -1170,7 +1170,7 @@ async def sample_list_usable_workstation_configs(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1206,7 +1206,7 @@ async def sample_list_usable_workstation_configs(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_usable_workstation_configs, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -1312,7 +1312,7 @@ async def sample_create_workstation_config(): This corresponds to the ``workstation_config_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1453,7 +1453,7 @@ async def sample_update_workstation_config(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1588,7 +1588,7 @@ async def sample_delete_workstation_config(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1712,7 +1712,7 @@ async def sample_get_workstation(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1746,7 +1746,7 @@ async def sample_get_workstation(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_workstation, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -1823,7 +1823,7 @@ async def sample_list_workstations(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1859,7 +1859,7 @@ async def sample_list_workstations(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_workstations, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -1949,7 +1949,7 @@ async def sample_list_usable_workstations(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1985,7 +1985,7 @@ async def sample_list_usable_workstations(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_usable_workstations, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -2089,7 +2089,7 @@ async def sample_create_workstation(): This corresponds to the ``workstation_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2217,7 +2217,7 @@ async def sample_update_workstation(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2339,7 +2339,7 @@ async def sample_delete_workstation(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2457,7 +2457,7 @@ async def sample_start_workstation(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2574,7 +2574,7 @@ async def sample_stop_workstation(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2691,7 +2691,7 @@ async def sample_generate_access_token(): This corresponds to the ``workstation`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2724,7 +2724,7 @@ async def sample_generate_access_token(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.generate_access_token, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -2770,7 +2770,7 @@ async def list_operations( request (:class:`~.operations_pb2.ListOperationsRequest`): The request object. Request message for `ListOperations` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2787,7 +2787,7 @@ async def list_operations( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_operations, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -2824,7 +2824,7 @@ async def get_operation( request (:class:`~.operations_pb2.GetOperationRequest`): The request object. Request message for `GetOperation` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2841,7 +2841,7 @@ async def get_operation( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_operation, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -2883,7 +2883,7 @@ async def delete_operation( request (:class:`~.operations_pb2.DeleteOperationRequest`): The request object. Request message for `DeleteOperation` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2899,7 +2899,7 @@ async def delete_operation( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_operation, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -2937,7 +2937,7 @@ async def cancel_operation( request (:class:`~.operations_pb2.CancelOperationRequest`): The request object. Request message for `CancelOperation` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2953,7 +2953,7 @@ async def cancel_operation( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.cancel_operation, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -2989,7 +2989,7 @@ async def set_iam_policy( request (:class:`~.iam_policy_pb2.SetIamPolicyRequest`): The request object. Request message for `SetIamPolicy` method. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -3070,7 +3070,7 @@ async def set_iam_policy( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.set_iam_policy, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -3110,7 +3110,7 @@ async def get_iam_policy( request (:class:`~.iam_policy_pb2.GetIamPolicyRequest`): The request object. Request message for `GetIamPolicy` method. - retry (google.api_core.retry.Retry): Designation of what errors, if + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -3191,7 +3191,7 @@ async def get_iam_policy( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_iam_policy, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -3232,7 +3232,7 @@ async def test_iam_permissions( request (:class:`~.iam_policy_pb2.TestIamPermissionsRequest`): The request object. Request message for `TestIamPermissions` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -3250,7 +3250,7 @@ async def test_iam_permissions( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.test_iam_permissions, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, diff --git a/packages/google-cloud-workstations/google/cloud/workstations_v1beta/services/workstations/async_client.py b/packages/google-cloud-workstations/google/cloud/workstations_v1beta/services/workstations/async_client.py index 571e40d77929..35ca0d283a7b 100644 --- a/packages/google-cloud-workstations/google/cloud/workstations_v1beta/services/workstations/async_client.py +++ b/packages/google-cloud-workstations/google/cloud/workstations_v1beta/services/workstations/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.cloud.workstations_v1beta import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -279,7 +279,7 @@ async def sample_get_workstation_cluster(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -315,7 +315,7 @@ async def sample_get_workstation_cluster(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_workstation_cluster, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -395,7 +395,7 @@ async def sample_list_workstation_clusters(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -431,7 +431,7 @@ async def sample_list_workstation_clusters(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_workstation_clusters, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -539,7 +539,7 @@ async def sample_create_workstation_cluster(): This corresponds to the ``workstation_cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -676,7 +676,7 @@ async def sample_update_workstation_cluster(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -803,7 +803,7 @@ async def sample_delete_workstation_cluster(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -920,7 +920,7 @@ async def sample_get_workstation_config(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -964,7 +964,7 @@ async def sample_get_workstation_config(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_workstation_config, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -1044,7 +1044,7 @@ async def sample_list_workstation_configs(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1080,7 +1080,7 @@ async def sample_list_workstation_configs(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_workstation_configs, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -1170,7 +1170,7 @@ async def sample_list_usable_workstation_configs(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1206,7 +1206,7 @@ async def sample_list_usable_workstation_configs(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_usable_workstation_configs, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -1312,7 +1312,7 @@ async def sample_create_workstation_config(): This corresponds to the ``workstation_config_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1453,7 +1453,7 @@ async def sample_update_workstation_config(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1588,7 +1588,7 @@ async def sample_delete_workstation_config(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1712,7 +1712,7 @@ async def sample_get_workstation(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1746,7 +1746,7 @@ async def sample_get_workstation(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_workstation, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -1823,7 +1823,7 @@ async def sample_list_workstations(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1859,7 +1859,7 @@ async def sample_list_workstations(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_workstations, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -1949,7 +1949,7 @@ async def sample_list_usable_workstations(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1985,7 +1985,7 @@ async def sample_list_usable_workstations(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_usable_workstations, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -2089,7 +2089,7 @@ async def sample_create_workstation(): This corresponds to the ``workstation_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2217,7 +2217,7 @@ async def sample_update_workstation(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2339,7 +2339,7 @@ async def sample_delete_workstation(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2457,7 +2457,7 @@ async def sample_start_workstation(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2574,7 +2574,7 @@ async def sample_stop_workstation(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2691,7 +2691,7 @@ async def sample_generate_access_token(): This corresponds to the ``workstation`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2724,7 +2724,7 @@ async def sample_generate_access_token(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.generate_access_token, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -2770,7 +2770,7 @@ async def list_operations( request (:class:`~.operations_pb2.ListOperationsRequest`): The request object. Request message for `ListOperations` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2787,7 +2787,7 @@ async def list_operations( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_operations, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -2824,7 +2824,7 @@ async def get_operation( request (:class:`~.operations_pb2.GetOperationRequest`): The request object. Request message for `GetOperation` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2841,7 +2841,7 @@ async def get_operation( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_operation, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -2883,7 +2883,7 @@ async def delete_operation( request (:class:`~.operations_pb2.DeleteOperationRequest`): The request object. Request message for `DeleteOperation` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2899,7 +2899,7 @@ async def delete_operation( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_operation, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -2937,7 +2937,7 @@ async def cancel_operation( request (:class:`~.operations_pb2.CancelOperationRequest`): The request object. Request message for `CancelOperation` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -2953,7 +2953,7 @@ async def cancel_operation( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.cancel_operation, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -2989,7 +2989,7 @@ async def set_iam_policy( request (:class:`~.iam_policy_pb2.SetIamPolicyRequest`): The request object. Request message for `SetIamPolicy` method. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -3070,7 +3070,7 @@ async def set_iam_policy( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.set_iam_policy, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -3110,7 +3110,7 @@ async def get_iam_policy( request (:class:`~.iam_policy_pb2.GetIamPolicyRequest`): The request object. Request message for `GetIamPolicy` method. - retry (google.api_core.retry.Retry): Designation of what errors, if + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -3191,7 +3191,7 @@ async def get_iam_policy( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_iam_policy, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -3232,7 +3232,7 @@ async def test_iam_permissions( request (:class:`~.iam_policy_pb2.TestIamPermissionsRequest`): The request object. Request message for `TestIamPermissions` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -3250,7 +3250,7 @@ async def test_iam_permissions( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.test_iam_permissions, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, diff --git a/packages/google-cloud-workstations/noxfile.py b/packages/google-cloud-workstations/noxfile.py index 716326a3d430..7d3551347c78 100644 --- a/packages/google-cloud-workstations/noxfile.py +++ b/packages/google-cloud-workstations/noxfile.py @@ -29,11 +29,13 @@ BLACK_VERSION = "black[jupyter]==23.7.0" ISORT_VERSION = "isort==5.11.0" + LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] + DEFAULT_PYTHON_VERSION = "3.10" -UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"] +UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", @@ -47,7 +49,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"] SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -89,6 +91,7 @@ def lint(session): "--check", *LINT_PATHS, ) + session.run("flake8", "google", "tests") @@ -336,7 +339,7 @@ def docfx(session): ) -@nox.session(python="3.11") +@nox.session(python="3.12") def prerelease_deps(session): """Run all tests with prerelease versions of dependencies installed.""" diff --git a/packages/google-cloud-workstations/setup.py b/packages/google-cloud-workstations/setup.py index 4cd02bb60489..4ff2b78ec5e1 100644 --- a/packages/google-cloud-workstations/setup.py +++ b/packages/google-cloud-workstations/setup.py @@ -15,6 +15,7 @@ # import io import os +import re import setuptools # type: ignore @@ -25,12 +26,14 @@ description = "Google Cloud Workstations API client library" -version = {} +version = None + with open( os.path.join(package_root, "google/cloud/workstations/gapic_version.py") ) as fp: - exec(fp.read(), version) -version = version["__version__"] + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert len(version_candidates) == 1 + version = version_candidates[0] if version[0] == "0": release_status = "Development Status :: 4 - Beta" @@ -39,12 +42,11 @@ dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", - "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "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", "grpc-google-iam-v1 >= 0.12.4, <1.0.0dev", ] -url = "https://github.com/googleapis/google-cloud-python" +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-workstations" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -54,12 +56,10 @@ packages = [ package - for package in setuptools.PEP420PackageFinder.find() + for package in setuptools.find_namespace_packages() if package.startswith("google") ] -namespaces = ["google", "google.cloud"] - setuptools.setup( name=name, version=version, @@ -80,13 +80,13 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Operating System :: OS Independent", "Topic :: Internet", ], platforms="Posix; MacOS X; Windows", packages=packages, python_requires=">=3.7", - namespace_packages=namespaces, install_requires=dependencies, include_package_data=True, zip_safe=False, diff --git a/packages/google-cloud-workstations/testing/constraints-3.7.txt b/packages/google-cloud-workstations/testing/constraints-3.7.txt index 2beecf99e0be..44ffd04543a8 100644 --- a/packages/google-cloud-workstations/testing/constraints-3.7.txt +++ b/packages/google-cloud-workstations/testing/constraints-3.7.txt @@ -5,6 +5,6 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 -proto-plus==1.22.0 +proto-plus==1.22.3 protobuf==3.19.5 grpc-google-iam-v1==0.12.4 diff --git a/packages/google-cloud-workstations/tests/unit/gapic/workstations_v1/test_workstations.py b/packages/google-cloud-workstations/tests/unit/gapic/workstations_v1/test_workstations.py index 930650c917d2..79c5b90c3fb6 100644 --- a/packages/google-cloud-workstations/tests/unit/gapic/workstations_v1/test_workstations.py +++ b/packages/google-cloud-workstations/tests/unit/gapic/workstations_v1/test_workstations.py @@ -14848,7 +14848,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation_async(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc_asyncio"): client = WorkstationsAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -14987,7 +14987,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation_async(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc_asyncio"): client = WorkstationsAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -15126,7 +15126,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation_async(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc_asyncio"): client = WorkstationsAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -15271,7 +15271,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations_async(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc_asyncio"): client = WorkstationsAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/packages/google-cloud-workstations/tests/unit/gapic/workstations_v1beta/test_workstations.py b/packages/google-cloud-workstations/tests/unit/gapic/workstations_v1beta/test_workstations.py index b5c5b70130db..1fbfaa3bdab7 100644 --- a/packages/google-cloud-workstations/tests/unit/gapic/workstations_v1beta/test_workstations.py +++ b/packages/google-cloud-workstations/tests/unit/gapic/workstations_v1beta/test_workstations.py @@ -14882,7 +14882,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation_async(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc_asyncio"): client = WorkstationsAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -15021,7 +15021,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation_async(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc_asyncio"): client = WorkstationsAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -15160,7 +15160,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation_async(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc_asyncio"): client = WorkstationsAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -15305,7 +15305,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations_async(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc_asyncio"): client = WorkstationsAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/packages/google-maps-fleetengine-delivery/CONTRIBUTING.rst b/packages/google-maps-fleetengine-delivery/CONTRIBUTING.rst index fb54714e2a3e..4a5b5bbba7ae 100644 --- a/packages/google-maps-fleetengine-delivery/CONTRIBUTING.rst +++ b/packages/google-maps-fleetengine-delivery/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.7, 3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows. + 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -72,7 +72,7 @@ We use `nox `__ to instrument our tests. - To run a single unit test:: - $ nox -s unit-3.11 -- -k + $ nox -s unit-3.12 -- -k .. note:: @@ -143,12 +143,12 @@ Running System Tests $ nox -s system # Run a single system test - $ nox -s system-3.11 -- -k + $ nox -s system-3.12 -- -k .. note:: - System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11. + System tests are only configured to run under Python 3.8, 3.9, 3.10, 3.11 and 3.12. For expediency, we do not run them in older versions of Python 3. This alone will not run the tests. You'll need to change some local @@ -226,12 +226,14 @@ We support: - `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ +- `Python 3.12`_ .. _Python 3.7: https://docs.python.org/3.7/ .. _Python 3.8: https://docs.python.org/3.8/ .. _Python 3.9: https://docs.python.org/3.9/ .. _Python 3.10: https://docs.python.org/3.10/ .. _Python 3.11: https://docs.python.org/3.11/ +.. _Python 3.12: https://docs.python.org/3.12/ Supported versions can be found in our ``noxfile.py`` `config`_. diff --git a/packages/google-maps-fleetengine-delivery/google/maps/fleetengine_delivery/gapic_version.py b/packages/google-maps-fleetengine-delivery/google/maps/fleetengine_delivery/gapic_version.py index 123d60293175..360a0d13ebdd 100644 --- a/packages/google-maps-fleetengine-delivery/google/maps/fleetengine_delivery/gapic_version.py +++ b/packages/google-maps-fleetengine-delivery/google/maps/fleetengine_delivery/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.1.1" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-maps-fleetengine-delivery/google/maps/fleetengine_delivery_v1/gapic_version.py b/packages/google-maps-fleetengine-delivery/google/maps/fleetengine_delivery_v1/gapic_version.py index 123d60293175..360a0d13ebdd 100644 --- a/packages/google-maps-fleetengine-delivery/google/maps/fleetengine_delivery_v1/gapic_version.py +++ b/packages/google-maps-fleetengine-delivery/google/maps/fleetengine_delivery_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.1.1" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-maps-fleetengine-delivery/google/maps/fleetengine_delivery_v1/services/delivery_service/async_client.py b/packages/google-maps-fleetengine-delivery/google/maps/fleetengine_delivery_v1/services/delivery_service/async_client.py index 5c8955ad9053..c46fe0386ea9 100644 --- a/packages/google-maps-fleetengine-delivery/google/maps/fleetengine_delivery_v1/services/delivery_service/async_client.py +++ b/packages/google-maps-fleetengine-delivery/google/maps/fleetengine_delivery_v1/services/delivery_service/async_client.py @@ -31,7 +31,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -39,9 +39,9 @@ from google.maps.fleetengine_delivery_v1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.protobuf import duration_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore @@ -320,7 +320,7 @@ async def sample_create_delivery_vehicle(): This corresponds to the ``delivery_vehicle_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -366,7 +366,7 @@ async def sample_create_delivery_vehicle(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.create_delivery_vehicle, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -445,7 +445,7 @@ async def sample_get_delivery_vehicle(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -487,7 +487,7 @@ async def sample_get_delivery_vehicle(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_delivery_vehicle, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -587,7 +587,7 @@ async def sample_update_delivery_vehicle(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -631,7 +631,7 @@ async def sample_update_delivery_vehicle(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.update_delivery_vehicle, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -709,7 +709,7 @@ async def sample_batch_create_tasks(): Args: request (Optional[Union[google.maps.fleetengine_delivery_v1.types.BatchCreateTasksRequest, dict]]): The request object. The ``BatchCreateTask`` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -726,7 +726,7 @@ async def sample_batch_create_tasks(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.batch_create_tasks, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -850,7 +850,7 @@ async def sample_create_task(): This corresponds to the ``task_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -901,7 +901,7 @@ async def sample_create_task(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.create_task, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -980,7 +980,7 @@ async def sample_get_task(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1027,7 +1027,7 @@ async def sample_get_task(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_task, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -1109,7 +1109,7 @@ async def sample_search_tasks(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1149,7 +1149,7 @@ async def sample_search_tasks(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.search_tasks, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -1268,7 +1268,7 @@ async def sample_update_task(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1317,7 +1317,7 @@ async def sample_update_task(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.update_task, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -1399,7 +1399,7 @@ async def sample_list_tasks(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1435,7 +1435,7 @@ async def sample_list_tasks(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_tasks, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -1525,7 +1525,7 @@ async def sample_get_task_tracking_info(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1561,7 +1561,7 @@ async def sample_get_task_tracking_info(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_task_tracking_info, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -1642,7 +1642,7 @@ async def sample_list_delivery_vehicles(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -1677,7 +1677,7 @@ async def sample_list_delivery_vehicles(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_delivery_vehicles, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, diff --git a/packages/google-maps-fleetengine-delivery/noxfile.py b/packages/google-maps-fleetengine-delivery/noxfile.py index 6b51f78aa204..7d3551347c78 100644 --- a/packages/google-maps-fleetengine-delivery/noxfile.py +++ b/packages/google-maps-fleetengine-delivery/noxfile.py @@ -35,7 +35,7 @@ DEFAULT_PYTHON_VERSION = "3.10" -UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"] +UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", @@ -49,7 +49,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"] SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -339,7 +339,7 @@ def docfx(session): ) -@nox.session(python="3.11") +@nox.session(python="3.12") def prerelease_deps(session): """Run all tests with prerelease versions of dependencies installed.""" diff --git a/packages/google-maps-fleetengine-delivery/samples/generated_samples/snippet_metadata_maps.fleetengine.delivery.v1.json b/packages/google-maps-fleetengine-delivery/samples/generated_samples/snippet_metadata_maps.fleetengine.delivery.v1.json index e3e32fb655f3..2529d19e89c9 100644 --- a/packages/google-maps-fleetengine-delivery/samples/generated_samples/snippet_metadata_maps.fleetengine.delivery.v1.json +++ b/packages/google-maps-fleetengine-delivery/samples/generated_samples/snippet_metadata_maps.fleetengine.delivery.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-maps-fleetengine-delivery", - "version": "0.1.1" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-maps-fleetengine-delivery/setup.py b/packages/google-maps-fleetengine-delivery/setup.py index d457112014c3..a8a687ceeda7 100644 --- a/packages/google-maps-fleetengine-delivery/setup.py +++ b/packages/google-maps-fleetengine-delivery/setup.py @@ -15,6 +15,7 @@ # import io import os +import re import setuptools # type: ignore @@ -25,12 +26,14 @@ description = "Google Maps Fleetengine Delivery API client library" -version = {} +version = None + with open( os.path.join(package_root, "google/maps/fleetengine_delivery/gapic_version.py") ) as fp: - exec(fp.read(), version) -version = version["__version__"] + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert len(version_candidates) == 1 + version = version_candidates[0] if version[0] == "0": release_status = "Development Status :: 4 - Beta" @@ -39,12 +42,11 @@ dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", - "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "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", "google-geo-type >= 0.1.0, <1.0.0dev", ] -url = "https://github.com/googleapis/google-cloud-python" +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-maps-fleetengine-delivery" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -54,12 +56,10 @@ packages = [ package - for package in setuptools.PEP420PackageFinder.find() + for package in setuptools.find_namespace_packages() if package.startswith("google") ] -namespaces = ["google", "google.maps"] - setuptools.setup( name=name, version=version, @@ -80,13 +80,13 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Operating System :: OS Independent", "Topic :: Internet", ], platforms="Posix; MacOS X; Windows", packages=packages, python_requires=">=3.7", - namespace_packages=namespaces, install_requires=dependencies, include_package_data=True, zip_safe=False, diff --git a/packages/google-maps-fleetengine-delivery/testing/constraints-3.7.txt b/packages/google-maps-fleetengine-delivery/testing/constraints-3.7.txt index 33ac865954a6..2729880f2da8 100644 --- a/packages/google-maps-fleetengine-delivery/testing/constraints-3.7.txt +++ b/packages/google-maps-fleetengine-delivery/testing/constraints-3.7.txt @@ -5,6 +5,6 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 -proto-plus==1.22.0 +proto-plus==1.22.3 protobuf==3.19.5 google-geo-type==0.1.0 diff --git a/packages/google-maps-fleetengine/CONTRIBUTING.rst b/packages/google-maps-fleetengine/CONTRIBUTING.rst index 0ca9d42434d6..302d5c0e6475 100644 --- a/packages/google-maps-fleetengine/CONTRIBUTING.rst +++ b/packages/google-maps-fleetengine/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.7, 3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows. + 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -72,7 +72,7 @@ We use `nox `__ to instrument our tests. - To run a single unit test:: - $ nox -s unit-3.11 -- -k + $ nox -s unit-3.12 -- -k .. note:: @@ -143,12 +143,12 @@ Running System Tests $ nox -s system # Run a single system test - $ nox -s system-3.11 -- -k + $ nox -s system-3.12 -- -k .. note:: - System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11. + System tests are only configured to run under Python 3.8, 3.9, 3.10, 3.11 and 3.12. For expediency, we do not run them in older versions of Python 3. This alone will not run the tests. You'll need to change some local @@ -226,12 +226,14 @@ We support: - `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ +- `Python 3.12`_ .. _Python 3.7: https://docs.python.org/3.7/ .. _Python 3.8: https://docs.python.org/3.8/ .. _Python 3.9: https://docs.python.org/3.9/ .. _Python 3.10: https://docs.python.org/3.10/ .. _Python 3.11: https://docs.python.org/3.11/ +.. _Python 3.12: https://docs.python.org/3.12/ Supported versions can be found in our ``noxfile.py`` `config`_. diff --git a/packages/google-maps-fleetengine/google/maps/fleetengine/gapic_version.py b/packages/google-maps-fleetengine/google/maps/fleetengine/gapic_version.py index 123d60293175..360a0d13ebdd 100644 --- a/packages/google-maps-fleetengine/google/maps/fleetengine/gapic_version.py +++ b/packages/google-maps-fleetengine/google/maps/fleetengine/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.1.1" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-maps-fleetengine/google/maps/fleetengine_v1/gapic_version.py b/packages/google-maps-fleetengine/google/maps/fleetengine_v1/gapic_version.py index 123d60293175..360a0d13ebdd 100644 --- a/packages/google-maps-fleetengine/google/maps/fleetengine_v1/gapic_version.py +++ b/packages/google-maps-fleetengine/google/maps/fleetengine_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.1.1" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-maps-fleetengine/google/maps/fleetengine_v1/services/trip_service/async_client.py b/packages/google-maps-fleetengine/google/maps/fleetengine_v1/services/trip_service/async_client.py index 0fb8bf580d03..02b29a2c98cf 100644 --- a/packages/google-maps-fleetengine/google/maps/fleetengine_v1/services/trip_service/async_client.py +++ b/packages/google-maps-fleetengine/google/maps/fleetengine_v1/services/trip_service/async_client.py @@ -30,7 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -38,9 +38,9 @@ from google.maps.fleetengine_v1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.protobuf import duration_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -256,7 +256,7 @@ async def sample_create_trip(): Args: request (Optional[Union[google.maps.fleetengine_v1.types.CreateTripRequest, dict]]): The request object. CreateTrip request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -273,7 +273,7 @@ async def sample_create_trip(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.create_trip, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -342,7 +342,7 @@ async def sample_get_trip(): Args: request (Optional[Union[google.maps.fleetengine_v1.types.GetTripRequest, dict]]): The request object. GetTrip request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -359,7 +359,7 @@ async def sample_get_trip(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_trip, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -426,7 +426,7 @@ async def sample_report_billable_trip(): Args: request (Optional[Union[google.maps.fleetengine_v1.types.ReportBillableTripRequest, dict]]): The request object. ReportBillableTrip request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -497,7 +497,7 @@ async def sample_search_trips(): Args: request (Optional[Union[google.maps.fleetengine_v1.types.SearchTripsRequest, dict]]): The request object. SearchTrips request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -519,7 +519,7 @@ async def sample_search_trips(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.search_trips, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -597,7 +597,7 @@ async def sample_update_trip(): Args: request (Optional[Union[google.maps.fleetengine_v1.types.UpdateTripRequest, dict]]): The request object. UpdateTrip request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -614,7 +614,7 @@ async def sample_update_trip(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.update_trip, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, diff --git a/packages/google-maps-fleetengine/google/maps/fleetengine_v1/services/vehicle_service/async_client.py b/packages/google-maps-fleetengine/google/maps/fleetengine_v1/services/vehicle_service/async_client.py index 1270c8c761d0..3244c52d6917 100644 --- a/packages/google-maps-fleetengine/google/maps/fleetengine_v1/services/vehicle_service/async_client.py +++ b/packages/google-maps-fleetengine/google/maps/fleetengine_v1/services/vehicle_service/async_client.py @@ -31,7 +31,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -39,9 +39,9 @@ from google.maps.fleetengine_v1 import gapic_version as package_version try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.protobuf import timestamp_pb2 # type: ignore from google.protobuf import wrappers_pb2 # type: ignore @@ -289,7 +289,7 @@ async def sample_create_vehicle(): Args: request (Optional[Union[google.maps.fleetengine_v1.types.CreateVehicleRequest, dict]]): The request object. ``CreateVehicle`` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -306,7 +306,7 @@ async def sample_create_vehicle(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.create_vehicle, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -375,7 +375,7 @@ async def sample_get_vehicle(): Args: request (Optional[Union[google.maps.fleetengine_v1.types.GetVehicleRequest, dict]]): The request object. ``GetVehicle`` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -392,7 +392,7 @@ async def sample_get_vehicle(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_vehicle, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -478,7 +478,7 @@ async def sample_update_vehicle(): Args: request (Optional[Union[google.maps.fleetengine_v1.types.UpdateVehicleRequest, dict]]): The request object. \`UpdateVehicle request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -495,7 +495,7 @@ async def sample_update_vehicle(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.update_vehicle, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -565,7 +565,7 @@ async def sample_update_vehicle_location(): Args: request (Optional[Union[google.maps.fleetengine_v1.types.UpdateVehicleLocationRequest, dict]]): The request object. ``UpdateVehicleLocation`` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -660,7 +660,7 @@ async def sample_update_vehicle_attributes(): Args: request (Optional[Union[google.maps.fleetengine_v1.types.UpdateVehicleAttributesRequest, dict]]): The request object. ``UpdateVehicleAttributes`` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -677,7 +677,7 @@ async def sample_update_vehicle_attributes(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.update_vehicle_attributes, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -749,7 +749,7 @@ async def sample_list_vehicles(): Args: request (Optional[Union[google.maps.fleetengine_v1.types.ListVehiclesRequest, dict]]): The request object. ``ListVehicles`` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -845,7 +845,7 @@ async def sample_search_vehicles(): Args: request (Optional[Union[google.maps.fleetengine_v1.types.SearchVehiclesRequest, dict]]): The request object. ``SearchVehicles`` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be @@ -862,7 +862,7 @@ async def sample_search_vehicles(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.search_vehicles, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=10.0, multiplier=1.3, @@ -936,7 +936,7 @@ async def sample_search_fuzzed_vehicles(): Args: request (Optional[Union[google.maps.fleetengine_v1.types.SearchVehiclesRequest, dict]]): The request object. ``SearchVehicles`` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be diff --git a/packages/google-maps-fleetengine/noxfile.py b/packages/google-maps-fleetengine/noxfile.py index 6b51f78aa204..7d3551347c78 100644 --- a/packages/google-maps-fleetengine/noxfile.py +++ b/packages/google-maps-fleetengine/noxfile.py @@ -35,7 +35,7 @@ DEFAULT_PYTHON_VERSION = "3.10" -UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"] +UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", @@ -49,7 +49,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"] SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -339,7 +339,7 @@ def docfx(session): ) -@nox.session(python="3.11") +@nox.session(python="3.12") def prerelease_deps(session): """Run all tests with prerelease versions of dependencies installed.""" diff --git a/packages/google-maps-fleetengine/samples/generated_samples/snippet_metadata_maps.fleetengine.v1.json b/packages/google-maps-fleetengine/samples/generated_samples/snippet_metadata_maps.fleetengine.v1.json index 3edf7c3f7fca..f55ad57ec57a 100644 --- a/packages/google-maps-fleetengine/samples/generated_samples/snippet_metadata_maps.fleetengine.v1.json +++ b/packages/google-maps-fleetengine/samples/generated_samples/snippet_metadata_maps.fleetengine.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-maps-fleetengine", - "version": "0.1.1" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-maps-fleetengine/setup.py b/packages/google-maps-fleetengine/setup.py index 81b3f164e0b2..47b309f57bf6 100644 --- a/packages/google-maps-fleetengine/setup.py +++ b/packages/google-maps-fleetengine/setup.py @@ -15,6 +15,7 @@ # import io import os +import re import setuptools # type: ignore @@ -25,10 +26,12 @@ description = "Google Maps Fleetengine API client library" -version = {} +version = None + with open(os.path.join(package_root, "google/maps/fleetengine/gapic_version.py")) as fp: - exec(fp.read(), version) -version = version["__version__"] + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert len(version_candidates) == 1 + version = version_candidates[0] if version[0] == "0": release_status = "Development Status :: 4 - Beta" @@ -37,12 +40,11 @@ dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", - "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "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", "google-geo-type >= 0.1.0, <1.0.0dev", ] -url = "https://github.com/googleapis/google-cloud-python" +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-maps-fleetengine" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -52,12 +54,10 @@ packages = [ package - for package in setuptools.PEP420PackageFinder.find() + for package in setuptools.find_namespace_packages() if package.startswith("google") ] -namespaces = ["google", "google.maps"] - setuptools.setup( name=name, version=version, @@ -78,13 +78,13 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Operating System :: OS Independent", "Topic :: Internet", ], platforms="Posix; MacOS X; Windows", packages=packages, python_requires=">=3.7", - namespace_packages=namespaces, install_requires=dependencies, include_package_data=True, zip_safe=False, diff --git a/packages/google-maps-fleetengine/testing/constraints-3.7.txt b/packages/google-maps-fleetengine/testing/constraints-3.7.txt index 33ac865954a6..2729880f2da8 100644 --- a/packages/google-maps-fleetengine/testing/constraints-3.7.txt +++ b/packages/google-maps-fleetengine/testing/constraints-3.7.txt @@ -5,6 +5,6 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 -proto-plus==1.22.0 +proto-plus==1.22.3 protobuf==3.19.5 google-geo-type==0.1.0 diff --git a/packages/google-shopping-type/CONTRIBUTING.rst b/packages/google-shopping-type/CONTRIBUTING.rst index 7078ea3d091f..cecda033bae6 100644 --- a/packages/google-shopping-type/CONTRIBUTING.rst +++ b/packages/google-shopping-type/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.7, 3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows. + 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -72,7 +72,7 @@ We use `nox `__ to instrument our tests. - To run a single unit test:: - $ nox -s unit-3.11 -- -k + $ nox -s unit-3.12 -- -k .. note:: @@ -143,12 +143,12 @@ Running System Tests $ nox -s system # Run a single system test - $ nox -s system-3.11 -- -k + $ nox -s system-3.12 -- -k .. note:: - System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11. + System tests are only configured to run under Python 3.8, 3.9, 3.10, 3.11 and 3.12. For expediency, we do not run them in older versions of Python 3. This alone will not run the tests. You'll need to change some local @@ -226,12 +226,14 @@ We support: - `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ +- `Python 3.12`_ .. _Python 3.7: https://docs.python.org/3.7/ .. _Python 3.8: https://docs.python.org/3.8/ .. _Python 3.9: https://docs.python.org/3.9/ .. _Python 3.10: https://docs.python.org/3.10/ .. _Python 3.11: https://docs.python.org/3.11/ +.. _Python 3.12: https://docs.python.org/3.12/ Supported versions can be found in our ``noxfile.py`` `config`_. diff --git a/packages/google-shopping-type/google/shopping/type/gapic_version.py b/packages/google-shopping-type/google/shopping/type/gapic_version.py index a7d39deb7a45..360a0d13ebdd 100644 --- a/packages/google-shopping-type/google/shopping/type/gapic_version.py +++ b/packages/google-shopping-type/google/shopping/type/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.1.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-shopping-type/noxfile.py b/packages/google-shopping-type/noxfile.py index 6b51f78aa204..7d3551347c78 100644 --- a/packages/google-shopping-type/noxfile.py +++ b/packages/google-shopping-type/noxfile.py @@ -35,7 +35,7 @@ DEFAULT_PYTHON_VERSION = "3.10" -UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"] +UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", @@ -49,7 +49,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"] SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -339,7 +339,7 @@ def docfx(session): ) -@nox.session(python="3.11") +@nox.session(python="3.12") def prerelease_deps(session): """Run all tests with prerelease versions of dependencies installed.""" diff --git a/packages/google-shopping-type/setup.py b/packages/google-shopping-type/setup.py index 54bc89e80cd3..1f9852783c3d 100644 --- a/packages/google-shopping-type/setup.py +++ b/packages/google-shopping-type/setup.py @@ -15,6 +15,7 @@ # import io import os +import re import setuptools # type: ignore @@ -25,10 +26,12 @@ description = "Google Shopping Type API client library" -version = {} +version = None + with open(os.path.join(package_root, "google/shopping/type/gapic_version.py")) as fp: - exec(fp.read(), version) -version = version["__version__"] + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert len(version_candidates) == 1 + version = version_candidates[0] if version[0] == "0": release_status = "Development Status :: 4 - Beta" @@ -37,11 +40,10 @@ dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", - "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "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", ] -url = "https://github.com/googleapis/google-cloud-python" +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-shopping-type" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -51,12 +53,10 @@ packages = [ package - for package in setuptools.PEP420PackageFinder.find() + for package in setuptools.find_namespace_packages() if package.startswith("google") ] -namespaces = ["google", "google.shopping"] - setuptools.setup( name=name, version=version, @@ -77,13 +77,13 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Operating System :: OS Independent", "Topic :: Internet", ], platforms="Posix; MacOS X; Windows", packages=packages, python_requires=">=3.7", - namespace_packages=namespaces, install_requires=dependencies, include_package_data=True, zip_safe=False, diff --git a/packages/google-shopping-type/testing/constraints-3.7.txt b/packages/google-shopping-type/testing/constraints-3.7.txt index 6c44adfea7ee..185f7d366c2f 100644 --- a/packages/google-shopping-type/testing/constraints-3.7.txt +++ b/packages/google-shopping-type/testing/constraints-3.7.txt @@ -5,5 +5,5 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 -proto-plus==1.22.0 +proto-plus==1.22.3 protobuf==3.19.5 diff --git a/scripts/client-post-processing/add-dependency-google-cloud-common.yaml b/scripts/client-post-processing/add-dependency-google-cloud-common.yaml index fc46e68fcdcf..c3cff0ad3b62 100644 --- a/scripts/client-post-processing/add-dependency-google-cloud-common.yaml +++ b/scripts/client-post-processing/add-dependency-google-cloud-common.yaml @@ -20,21 +20,21 @@ replacements: before: | dependencies = \[ "google-api-core\[grpc\] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.3, <2.0.0dev", after: | dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "google-cloud-common >= 1.0.0, <2.0.0dev", - "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.3, <2.0.0dev", count: 1 - paths: [ packages/google-cloud-filestore/testing/constraints-3.7.txt ] before: | google-api-core==1.34.0 - proto-plus==1.22.0 + proto-plus==1.22.3 after: | google-api-core==1.34.0 google-cloud-common==1.0.0 - proto-plus==1.22.0 + proto-plus==1.22.3 count: 1 diff --git a/scripts/client-post-processing/add-missing-dependencies-to-setup-py-constraints.yaml b/scripts/client-post-processing/add-missing-dependencies-to-setup-py-constraints.yaml index 510461af949d..dbffe847c7f2 100644 --- a/scripts/client-post-processing/add-missing-dependencies-to-setup-py-constraints.yaml +++ b/scripts/client-post-processing/add-missing-dependencies-to-setup-py-constraints.yaml @@ -20,23 +20,23 @@ replacements: before: | dependencies = \[ "google-api-core\[grpc\] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.3, <2.0.0dev", after: | dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "grpc-google-iam-v1 >=0.12.4, <1.0.0dev", - "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.3, <2.0.0dev", count: 1 - paths: [ packages/google-cloud-gke-hub/testing/constraints-3.7.txt ] before: | google-api-core==1.34.0 - proto-plus==1.22.0 + proto-plus==1.22.3 after: | google-api-core==1.34.0 grpc-google-iam-v1==0.12.4 - proto-plus==1.22.0 + proto-plus==1.22.3 count: 1 - paths: [ packages/google-cloud-build/setup.py @@ -44,23 +44,23 @@ replacements: before: | dependencies = \[ "google-api-core\[grpc\] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.3, <2.0.0dev", after: | dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "grpc-google-iam-v1 >=0.12.4, <1.0.0dev", - "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.3, <2.0.0dev", count: 1 - paths: [ packages/google-cloud-build/testing/constraints-3.7.txt ] before: | google-api-core==1.34.0 - proto-plus==1.22.0 + proto-plus==1.22.3 after: | google-api-core==1.34.0 grpc-google-iam-v1==0.12.4 - proto-plus==1.22.0 + proto-plus==1.22.3 count: 1 - paths: [ packages/google-cloud-binary-authorization/setup.py @@ -68,21 +68,21 @@ replacements: before: | dependencies = \[ "google-api-core\[grpc\] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.3, <2.0.0dev", after: | dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "grafeas >= 1.1.2, <2.0dev", - "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.3, <2.0.0dev", count: 1 - paths: [ packages/google-cloud-binary-authorization/testing/constraints-3.7.txt ] before: | google-api-core==1.34.0 - proto-plus==1.22.0 + proto-plus==1.22.3 after: | google-api-core==1.34.0 grafeas==1.1.2 - proto-plus==1.22.0 + proto-plus==1.22.3 count: 1 diff --git a/scripts/client-post-processing/containeranalysis-grafeas-integration.yaml b/scripts/client-post-processing/containeranalysis-grafeas-integration.yaml index 084c013cfb7e..004379c6b560 100644 --- a/scripts/client-post-processing/containeranalysis-grafeas-integration.yaml +++ b/scripts/client-post-processing/containeranalysis-grafeas-integration.yaml @@ -20,23 +20,23 @@ replacements: before: | dependencies = \[ "google-api-core\[grpc\] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.3, <2.0.0dev", after: | dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "grafeas >=1.4.1, <2.0dev", - "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.3, <2.0.0dev", count: 1 - paths: [ packages/google-cloud-containeranalysis/testing/constraints-3.7.txt ] before: | google-api-core==1.34.0 - proto-plus==1.22.0 + proto-plus==1.22.3 after: | google-api-core==1.34.0 grafeas==1.4.1 - proto-plus==1.22.0 + proto-plus==1.22.3 count: 1 - paths: [ packages/google-cloud-containeranalysis/google/cloud/devtools/containeranalysis_v1/services/container_analysis/client.py, diff --git a/scripts/client-post-processing/integrate-isolated-handwritten-code.yaml b/scripts/client-post-processing/integrate-isolated-handwritten-code.yaml index 241a3dd8e1ee..c4e94768ea3d 100644 --- a/scripts/client-post-processing/integrate-isolated-handwritten-code.yaml +++ b/scripts/client-post-processing/integrate-isolated-handwritten-code.yaml @@ -61,21 +61,21 @@ replacements: before: | dependencies = \[ "google-api-core\[grpc\] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.3, <2.0.0dev", after: | dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "google-cloud-core >= 1.4.4, <3.0.0dev", - "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.3, <2.0.0dev", count: 1 - paths: [ "packages/google-cloud-translate/testing/constraints-3.7.txt" ] before: | - proto-plus==1.22.0 + proto-plus==1.22.3 protobuf==3.19.5 after: | - proto-plus==1.22.0 + proto-plus==1.22.3 google-cloud-core==1.4.4 protobuf==3.19.5 count: 1 @@ -152,11 +152,11 @@ replacements: ] before: | google-api-core==1.34.0 - proto-plus==1.22.0 + proto-plus==1.22.3 after: | google-api-core==1.34.0 pandas==0.23.2 - proto-plus==1.22.0 + proto-plus==1.22.3 count: 1 - paths: [ packages/google-cloud-monitoring/setup.py, @@ -215,13 +215,13 @@ replacements: ] before: | google-api-core==1.34.0 - proto-plus==1.22.0 + proto-plus==1.22.3 after: | google-api-core==1.34.0 google-cloud-storage==1.18.0 libcst==0.2.5 pandas==1.0.5 - proto-plus==1.22.0 + proto-plus==1.22.3 count: 1 - paths: [ packages/google-cloud-automl/docs/automl_v1beta1/services_.rst, diff --git a/scripts/client-post-processing/mypy-error-with-org-policy-as-dependency.yaml b/scripts/client-post-processing/mypy-error-with-org-policy-as-dependency.yaml index 52dc9cf4f353..04c1d301c954 100644 --- a/scripts/client-post-processing/mypy-error-with-org-policy-as-dependency.yaml +++ b/scripts/client-post-processing/mypy-error-with-org-policy-as-dependency.yaml @@ -20,22 +20,22 @@ replacements: before: | dependencies = \[ "google-api-core\[grpc\] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.3, <2.0.0dev", after: | dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "google-cloud-org-policy >= 0.1.2, <2.0.0dev", - "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.3, <2.0.0dev", count: 1 - paths: [ packages/google-cloud-asset/testing/constraints-3.7.txt ] before: | google-api-core==1.34.0 - proto-plus==1.22.0 + proto-plus==1.22.3 after: | google-api-core==1.34.0 google-cloud-org-policy==0.1.2 - proto-plus==1.22.0 + proto-plus==1.22.3 count: 1 \ No newline at end of file